From 12dd5e07ba44fa35dd52fdb97666f258c6d51322 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 6 Aug 2020 01:20:53 +0300 Subject: [PATCH] container: Tidy up the format Signed-off-by: Leonard Lyubich --- container/service.proto | 13 ++++++++++--- container/types.proto | 43 ++++++++++++++++++++++++----------------- proto-docs/container.md | 28 +++++++++++++-------------- 3 files changed, 49 insertions(+), 35 deletions(-) diff --git a/container/service.proto b/container/service.proto index 2ae4ced..450ccab 100644 --- a/container/service.proto +++ b/container/service.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package container; + option go_package = "github.com/nspcc-dev/neofs-api-go/container"; option csharp_namespace = "NeoFS.API.Container"; @@ -42,9 +44,11 @@ service Service { message PutRequest { // Container to create in NeoFS. container.Container Container = 1; + // 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. bytes PublicKey = 2; + // Signature of stable-marshalled container according to RFC-6979. bytes Signature = 3; } @@ -57,8 +61,9 @@ message PutResponse { message DeleteRequest { // ContainerID carries identifier of the container to delete from NeoFS. refs.ContainerID ContainerID = 1; + // Signature of container id according to RFC-6979. - bytes Signature = 2; + bytes Signature = 2; } // DeleteResponse is empty because delete operation is asynchronous and done @@ -89,8 +94,9 @@ message ListResponse { message SetExtendedACLRequest { // EACL to set for the container. acl.EACLTable EACL = 1; + // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes Signature = 2; + bytes Signature = 2; } message SetExtendedACLResponse {} @@ -103,6 +109,7 @@ message GetExtendedACLRequest { message GetExtendedACLResponse { // EACL that has been requested if it was set up. acl.EACLTable EACL = 1; + // Signature of stable-marshalled Extended ACL according to RFC-6979. - bytes Signature = 2; + bytes Signature = 2; } diff --git a/container/types.proto b/container/types.proto index 5db48f0..c05fe7d 100644 --- a/container/types.proto +++ b/container/types.proto @@ -1,5 +1,7 @@ syntax = "proto3"; + package container; + option go_package = "github.com/nspcc-dev/neofs-api-go/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 // SHA256 hash of stable-marshalled container message. message Container { - // OwnerID carries identifier of the container owner. + // OwnerID carries identifier of the container owner. 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. -message Attribute { - // Key of immutable container attribute. - string Key = 1; - // Value of immutable container attribute. - string Value = 2; -} \ No newline at end of file + // 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; + + // 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; +} diff --git a/proto-docs/container.md b/proto-docs/container.md index 1fb70bd..14bf6e7 100644 --- a/proto-docs/container.md +++ b/proto-docs/container.md @@ -25,8 +25,8 @@ - [container/types.proto](#container/types.proto) - Messages - - [Attribute](#container.Attribute) - [Container](#container.Container) + - [Container.Attribute](#container.Container.Attribute) - [Scalar Value Types](#scalar-value-types) @@ -256,18 +256,6 @@ via consensus in inner ring nodes - - -### 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. | - - ### 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. | | 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. | -| 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. | + + + +### 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. | +