[#31] refs: Use OwnerID message in all services

Change the type of all fields for identifier of the container owner to
refs.OwnerID. This will allow you to follow a single format and not duplicate
its description.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-05 19:49:16 +03:00 committed by Stanislav Bogatyrev
parent 9bd4934373
commit 40420f3ab0
12 changed files with 27 additions and 24 deletions

View file

@ -7,6 +7,7 @@ import "service/meta.proto";
import "service/verify.proto"; import "service/verify.proto";
import "decimal/decimal.proto"; import "decimal/decimal.proto";
import "accounting/types.proto"; import "accounting/types.proto";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stable_marshaler_all) = true;
@ -19,8 +20,8 @@ service Accounting {
} }
message BalanceRequest { message BalanceRequest {
// OwnerID is a wallet address // OwnerID carries user identifier in NeoFS system.
bytes OwnerID = 1 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; refs.OwnerID OwnerID = 1;
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)

View file

@ -80,8 +80,8 @@ message GetResponse {
} }
message ListRequest { message ListRequest {
// OwnerID is a 25 byte NEO3.0 wallet address. // OwnerID carries identifier of the container owner.
bytes OwnerID = 1; refs.OwnerID OwnerID = 1;
} }
message ListResponse { message ListResponse {

View file

@ -3,6 +3,7 @@ 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";
import "refs/types.proto";
import "github.com/nspcc-dev/netmap/selector.proto"; import "github.com/nspcc-dev/netmap/selector.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
@ -13,8 +14,8 @@ option (gogoproto.stable_marshaler_all) = true;
// 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 is a 25 byte NEO3.0 wallet address. // OwnerID carries identifier of the container owner.
bytes OwnerID = 1; refs.OwnerID OwnerID = 1;
// Nonce is a 16 byte UUID, used to avoid collisions of container id. // Nonce is a 16 byte UUID, used to avoid collisions of container id.
bytes Nonce = 2; bytes Nonce = 2;
// BasicACL contains access control rules for owner, system, others groups and // BasicACL contains access control rules for owner, system, others groups and

View file

@ -105,8 +105,8 @@ message PutResponse {
message DeleteRequest { message DeleteRequest {
// Address of object (container id + object id) // Address of object (container id + object id)
refs.Address Address = 1 [(gogoproto.nullable) = false]; refs.Address Address = 1 [(gogoproto.nullable) = false];
// OwnerID is a wallet address // OwnerID carries identifier of the object owner.
bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; refs.OwnerID OwnerID = 2;
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)

View file

@ -19,8 +19,8 @@ message Header {
// Address carries object address in the NeoFS system. // Address carries object address in the NeoFS system.
// It encapsulates the object and the container identifiers. // It encapsulates the object and the container identifiers.
refs.Address Address = 2; refs.Address Address = 2;
// OwnerID carries identifier the object owner in a binary format. // OwnerID carries identifier of the object owner.
bytes OwnerID = 3; refs.OwnerID OwnerID = 3;
} }
// Main carries the main part of the header. // Main carries the main part of the header.

View file

@ -86,7 +86,7 @@ Balance returns current balance status of the NeoFS user
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries user identifier in NeoFS system. |
| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) |
| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) |

View file

@ -185,7 +185,7 @@ via consensus in inner ring nodes
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| OwnerID | [bytes](#bytes) | | OwnerID is a 25 byte NEO3.0 wallet address. | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the container owner. |
<a name="container.ListResponse"></a> <a name="container.ListResponse"></a>
@ -279,7 +279,7 @@ SHA256 hash of stable-marshalled container message.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| OwnerID | [bytes](#bytes) | | OwnerID is a 25 byte NEO3.0 wallet address. | | 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 | [Attribute](#container.Attribute) | repeated | Attributes define any immutable characteristics of container. |

View file

@ -147,7 +147,7 @@ calculated for XORed data.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) |
| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the object owner. |
| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) |
| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) |
@ -458,7 +458,7 @@ Message fields are presented in all NeoFS objects.
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| PayloadLength | [uint64](#uint64) | | PayloadLength carries length of the object payload. Each object has a fixed payload length since it's immutable. | | PayloadLength | [uint64](#uint64) | | PayloadLength carries length of the object payload. Each object has a fixed payload length since it's immutable. |
| Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. | | Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. |
| OwnerID | [bytes](#bytes) | | OwnerID carries identifier the object owner in a binary format. | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the object owner. |
<a name="object.Object"></a> <a name="object.Object"></a>

View file

@ -125,7 +125,7 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ACLRules | [bytes](#bytes) | | ACLRules carries a binary representation of the table of extended ACL rules | | ACLRules | [bytes](#bytes) | | ACLRules carries a binary representation of the table of extended ACL rules |
| OwnerID | [bytes](#bytes) | | OwnerID is an owner of token | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the token owner. |
| ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime | | ValidUntil | [uint64](#uint64) | | ValidUntil carries a last epoch of token lifetime |
@ -176,7 +176,7 @@ User token granting rights for object manipulation
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes | | ID | [bytes](#bytes) | | ID is a token identifier. valid UUIDv4 represented in bytes |
| OwnerID | [bytes](#bytes) | | OwnerID is an owner of manipulation object | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries identifier of the manipulation object owner. |
| verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued | | verb | [Token.Info.Verb](#service.Token.Info.Verb) | | Verb is a type of request for which the token is issued |
| Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued | | Address | [refs.Address](#refs.Address) | | Address is an object address for which token is issued |
| Lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session | | Lifetime | [TokenLifetime](#service.TokenLifetime) | | Lifetime is a lifetime of the session |

View file

@ -52,7 +52,7 @@ CreateRequest carries an information necessary for opening a session
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| OwnerID | [bytes](#bytes) | | OwnerID carries an identifier of a session initiator | | OwnerID | [refs.OwnerID](#refs.OwnerID) | | OwnerID carries an identifier of a session initiator. |
| Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Lifetime carries a lifetime of the session | | Lifetime | [service.TokenLifetime](#service.TokenLifetime) | | Lifetime carries a lifetime of the session |
| Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) | | Meta | [service.RequestMetaHeader](#service.RequestMetaHeader) | | RequestMetaHeader contains information about request meta headers (should be embedded into message) |
| Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) | | Verify | [service.RequestVerificationHeader](#service.RequestVerificationHeader) | | RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message) |

View file

@ -34,8 +34,8 @@ message Token {
// ID is a token identifier. valid UUIDv4 represented in bytes // ID is a token identifier. valid UUIDv4 represented in bytes
bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false]; bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false];
// OwnerID is an owner of manipulation object // OwnerID carries identifier of the manipulation object owner.
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; refs.OwnerID OwnerID = 2;
// Verb is an enumeration of session request types // Verb is an enumeration of session request types
enum Verb { enum Verb {
@ -101,8 +101,8 @@ message BearerTokenMsg {
// ACLRules carries a binary representation of the table of extended ACL rules // ACLRules carries a binary representation of the table of extended ACL rules
bytes ACLRules = 1; bytes ACLRules = 1;
// OwnerID is an owner of token // OwnerID carries identifier of the token owner.
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false]; refs.OwnerID OwnerID = 2;
// ValidUntil carries a last epoch of token lifetime // ValidUntil carries a last epoch of token lifetime
uint64 ValidUntil = 3; uint64 ValidUntil = 3;

View file

@ -5,6 +5,7 @@ option csharp_namespace = "NeoFS.API.Session";
import "service/meta.proto"; import "service/meta.proto";
import "service/verify.proto"; import "service/verify.proto";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stable_marshaler_all) = true;
@ -17,8 +18,8 @@ service Session {
// CreateRequest carries an information necessary for opening a session // CreateRequest carries an information necessary for opening a session
message CreateRequest { message CreateRequest {
// OwnerID carries an identifier of a session initiator // OwnerID carries an identifier of a session initiator.
bytes OwnerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; refs.OwnerID OwnerID = 1;
// Lifetime carries a lifetime of the session // Lifetime carries a lifetime of the session
service.TokenLifetime Lifetime = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; service.TokenLifetime Lifetime = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false];