container: Tidy up the format

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-06 01:20:53 +03:00 committed by Stanislav Bogatyrev
parent f9c865eb53
commit 12dd5e07ba
3 changed files with 49 additions and 35 deletions

View file

@ -1,5 +1,7 @@
syntax = "proto3"; syntax = "proto3";
package container; package container;
option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option go_package = "github.com/nspcc-dev/neofs-api-go/container";
option csharp_namespace = "NeoFS.API.Container"; option csharp_namespace = "NeoFS.API.Container";
@ -42,9 +44,11 @@ service Service {
message PutRequest { message PutRequest {
// Container to create in NeoFS. // Container to create in NeoFS.
container.Container Container = 1; container.Container Container = 1;
// PublicKey of container owner. It can be public key of the owner // PublicKey of container owner. It can be public key of the owner
// or it can be public key that bound in neofs.id smart-contract. // or it can be public key that bound in neofs.id smart-contract.
bytes PublicKey = 2; bytes PublicKey = 2;
// Signature of stable-marshalled container according to RFC-6979. // Signature of stable-marshalled container according to RFC-6979.
bytes Signature = 3; bytes Signature = 3;
} }
@ -57,8 +61,9 @@ message PutResponse {
message DeleteRequest { message DeleteRequest {
// ContainerID carries identifier of the container to delete from NeoFS. // ContainerID carries identifier of the container to delete from NeoFS.
refs.ContainerID ContainerID = 1; refs.ContainerID ContainerID = 1;
// Signature of container id according to RFC-6979. // Signature of container id according to RFC-6979.
bytes Signature = 2; bytes Signature = 2;
} }
// DeleteResponse is empty because delete operation is asynchronous and done // DeleteResponse is empty because delete operation is asynchronous and done
@ -89,8 +94,9 @@ message ListResponse {
message SetExtendedACLRequest { message SetExtendedACLRequest {
// EACL to set for the container. // EACL to set for the container.
acl.EACLTable EACL = 1; acl.EACLTable EACL = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979. // Signature of stable-marshalled Extended ACL according to RFC-6979.
bytes Signature = 2; bytes Signature = 2;
} }
message SetExtendedACLResponse {} message SetExtendedACLResponse {}
@ -103,6 +109,7 @@ message GetExtendedACLRequest {
message GetExtendedACLResponse { message GetExtendedACLResponse {
// EACL that has been requested if it was set up. // EACL that has been requested if it was set up.
acl.EACLTable EACL = 1; acl.EACLTable EACL = 1;
// Signature of stable-marshalled Extended ACL according to RFC-6979. // Signature of stable-marshalled Extended ACL according to RFC-6979.
bytes Signature = 2; bytes Signature = 2;
} }

View file

@ -1,5 +1,7 @@
syntax = "proto3"; syntax = "proto3";
package container; package container;
option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option go_package = "github.com/nspcc-dev/neofs-api-go/container";
option csharp_namespace = "NeoFS.API.Container"; option csharp_namespace = "NeoFS.API.Container";
@ -11,23 +13,28 @@ import "netmap/types.proto";
// and access control information. ID of the container is a 32 byte long // and access control information. ID of the container is a 32 byte long
// SHA256 hash of stable-marshalled container message. // SHA256 hash of stable-marshalled container message.
message Container { message Container {
// OwnerID carries identifier of the container owner. // OwnerID carries identifier of the container owner.
refs.OwnerID OwnerID = 1; refs.OwnerID OwnerID = 1;
// Nonce is a 16 byte UUID, used to avoid collisions of container id.
bytes Nonce = 2;
// BasicACL contains access control rules for owner, system, others groups and
// permission bits for bearer token and Extended ACL.
uint32 BasicACL = 3;
// Attributes define any immutable characteristics of container.
repeated Attribute Attributes = 4;
// Rules define storage policy for the object inside the container.
netmap.PlacementRule Rules = 5;
}
// Attribute is a key-value pair of strings. // Nonce is a 16 byte UUID, used to avoid collisions of container id.
message Attribute { bytes Nonce = 2;
// Key of immutable container attribute.
string Key = 1; // BasicACL contains access control rules for owner, system, others groups and
// Value of immutable container attribute. // permission bits for bearer token and Extended ACL.
string Value = 2; uint32 BasicACL = 3;
}
// Attribute is a key-value pair of strings.
message Attribute {
// Key of immutable container attribute.
string Key = 1;
// Value of immutable container attribute.
string Value = 2;
}
// Attributes define any immutable characteristics of container.
repeated Attribute Attributes = 4;
// Rules define storage policy for the object inside the container.
netmap.PlacementRule Rules = 5;
}

View file

@ -25,8 +25,8 @@
- [container/types.proto](#container/types.proto) - [container/types.proto](#container/types.proto)
- Messages - Messages
- [Attribute](#container.Attribute)
- [Container](#container.Container) - [Container](#container.Container)
- [Container.Attribute](#container.Container.Attribute)
- [Scalar Value Types](#scalar-value-types) - [Scalar Value Types](#scalar-value-types)
@ -256,18 +256,6 @@ via consensus in inner ring nodes
<!-- end services --> <!-- end services -->
<a name="container.Attribute"></a>
### Message Attribute
Attribute is a key-value pair of strings.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Key | [string](#string) | | Key of immutable container attribute. |
| Value | [string](#string) | | Value of immutable container attribute. |
<a name="container.Container"></a> <a name="container.Container"></a>
### Message Container ### Message Container
@ -282,9 +270,21 @@ SHA256 hash of stable-marshalled container message.
| OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. |
| Nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. | | Nonce | [bytes](#bytes) | | Nonce is a 16 byte UUID, used to avoid collisions of container id. |
| BasicACL | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. | | BasicACL | [uint32](#uint32) | | BasicACL contains access control rules for owner, system, others groups and permission bits for bearer token and Extended ACL. |
| Attributes | [Attribute](#container.Attribute) | repeated | Attributes define any immutable characteristics of container. | | Attributes | [Container.Attribute](#container.Container.Attribute) | repeated | Attributes define any immutable characteristics of container. |
| Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | | Rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. |
<a name="container.Container.Attribute"></a>
### Message Container.Attribute
Attribute is a key-value pair of strings.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Key | [string](#string) | | Key of immutable container attribute. |
| Value | [string](#string) | | Value of immutable container attribute. |
<!-- end messages --> <!-- end messages -->
<!-- end enums --> <!-- end enums -->