service: Tidy up the format

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-06 02:25:50 +03:00 committed by Stanislav Bogatyrev
parent 23f571f76f
commit 0ca83fcef6
4 changed files with 37 additions and 70 deletions

View file

@ -10,7 +10,6 @@ import "service/verify.proto";
// Object service provides API for manipulating with the object. // Object service provides API for manipulating with the object.
service Service { service Service {
// Get the object from container. Response uses gRPC stream. First response // Get the object from container. Response uses gRPC stream. First response
// message carry object of requested address. Chunk messages are parts of // message carry object of requested address. Chunk messages are parts of
// the object's payload if it is needed. All messages except first carry // the object's payload if it is needed. All messages except first carry

View file

@ -6,9 +6,8 @@
- [service/meta.proto](#service/meta.proto) - [service/meta.proto](#service/meta.proto)
- Messages - Messages
- [RequestExtendedHeader](#service.RequestExtendedHeader)
- [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV)
- [RequestMetaHeader](#service.RequestMetaHeader) - [RequestMetaHeader](#service.RequestMetaHeader)
- [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader)
- [service/verify.proto](#service/verify.proto) - [service/verify.proto](#service/verify.proto)
@ -36,42 +35,28 @@
<!-- end services --> <!-- end services -->
<a name="service.RequestExtendedHeader"></a>
### Message RequestExtendedHeader
RequestExtendedHeader contains extended headers of request
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Headers | [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) | repeated | Headers carries list of key-value headers |
<a name="service.RequestExtendedHeader.KV"></a>
### Message RequestExtendedHeader.KV
KV contains string key-value pair
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| K | [string](#string) | | K carries extended header key |
| V | [string](#string) | | V carries extended header value |
<a name="service.RequestMetaHeader"></a> <a name="service.RequestMetaHeader"></a>
### Message RequestMetaHeader ### Message RequestMetaHeader
RequestMetaHeader contains information about request meta headers RequestMetaHeader contains information about request meta headers.
(should be embedded into message)
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | | TTL | [uint32](#uint32) | | Carries maximum number of nodes in the request route. |
| Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | XHeaders | [RequestMetaHeader.XHeader](#service.RequestMetaHeader.XHeader) | repeated | Carries request X-Headers. |
| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future |
| ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request |
<a name="service.RequestMetaHeader.XHeader"></a>
### Message RequestMetaHeader.XHeader
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Key | [string](#string) | | Carries key to the X-Header. |
| Value | [string](#string) | | Carries value of the X-Header. |
<!-- end messages --> <!-- end messages -->
@ -117,8 +102,7 @@ BearerTokenMsg carries information about request ACL rules with limited lifetime
<a name="service.RequestVerificationHeader"></a> <a name="service.RequestVerificationHeader"></a>
### Message RequestVerificationHeader ### Message RequestVerificationHeader
RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request.
(should be embedded into message).
| Field | Type | Label | Description | | Field | Type | Label | Description |
@ -136,8 +120,8 @@ RequestVerificationHeader is a set of signatures of every NeoFS Node that proces
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| Key | [bytes](#bytes) | | Key is compressed public key used for signature. |
| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | | Sign | [bytes](#bytes) | | Sign is signature of the request or session key. |
| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. |
<a name="service.Token"></a> <a name="service.Token"></a>

View file

@ -1,33 +1,23 @@
syntax = "proto3"; syntax = "proto3";
package service; package service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option go_package = "github.com/nspcc-dev/neofs-api-go/service";
option csharp_namespace = "NeoFS.API.Service"; option csharp_namespace = "NeoFS.API.Service";
// RequestMetaHeader contains information about request meta headers // RequestMetaHeader contains information about request meta headers.
// (should be embedded into message)
message RequestMetaHeader { message RequestMetaHeader {
// TTL must be larger than zero, it decreased in every NeoFS Node // Carries maximum number of nodes in the request route.
uint32 TTL = 1; uint32 TTL = 1;
// Epoch for user can be empty, because node sets epoch to the actual value
uint64 Epoch = 2; message XHeader {
// Version defines protocol version // Carries key to the X-Header.
// TODO: not used for now, should be implemented in future string Key = 1;
uint32 Version = 3;
// ExtendedHeader carries extended headers of the request // Carries value of the X-Header.
RequestExtendedHeader ExtendedHeader = 5; string Value = 2;
} }
// RequestExtendedHeader contains extended headers of request // Carries request X-Headers.
message RequestExtendedHeader { repeated XHeader XHeaders = 2;
// KV contains string key-value pair
message KV {
// K carries extended header key
string K = 1;
// V carries extended header value
string V = 2;
}
// Headers carries list of key-value headers
repeated KV Headers = 1;
} }

View file

@ -1,18 +1,20 @@
syntax = "proto3"; syntax = "proto3";
package service; package service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option go_package = "github.com/nspcc-dev/neofs-api-go/service";
option csharp_namespace = "NeoFS.API.Service"; option csharp_namespace = "NeoFS.API.Service";
import "refs/types.proto"; import "refs/types.proto";
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request.
// (should be embedded into message).
message RequestVerificationHeader { message RequestVerificationHeader {
message Signature { message Signature {
// Key is compressed public key used for signature.
bytes Key = 1;
// Sign is signature of the request or session key. // Sign is signature of the request or session key.
bytes Sign = 1; bytes Sign = 2;
// Peer is compressed public key used for signature.
bytes Peer = 2;
} }
// Signatures is a set of signatures of every passed NeoFS Node // Signatures is a set of signatures of every passed NeoFS Node
@ -84,14 +86,6 @@ message TokenLifetime {
uint64 ValidUntil = 2; uint64 ValidUntil = 2;
} }
// TODO: for variable token types and version redefine message
// Example:
// message Token {
// TokenType TokenType = 1;
// uint32 Version = 2;
// bytes Data = 3;
// }
// BearerTokenMsg carries information about request ACL rules with limited lifetime // BearerTokenMsg carries information about request ACL rules with limited lifetime
message BearerTokenMsg { message BearerTokenMsg {
message Info { message Info {