From 16101b7d84cebf35e855ba0e30ab6d7d552e2385 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:13:07 +0300 Subject: [PATCH 1/7] proto: add version of protocol into meta header --- service/meta.go | 12 +++++++++++- service/meta.proto | 5 +++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/service/meta.go b/service/meta.go index 52874c12..1e3fcc86 100644 --- a/service/meta.go +++ b/service/meta.go @@ -10,6 +10,7 @@ type ( // MetaHeader contains meta information of request. // It provides methods to get or set meta information meta header. // Also contains methods to reset and restore meta header. + // Also contains methods to get or set request protocol version MetaHeader interface { ResetMeta() RequestMetaHeader RestoreMeta(RequestMetaHeader) @@ -20,7 +21,16 @@ type ( // EpochRequest gives possibility to get or set epoch in RPC Requests. GetEpoch() uint64 - SetEpoch(v uint64) + SetEpoch(uint64) + + // VersionHeader allows get or set version of protocol request + VersionHeader + } + + // VersionHeader allows get or set version of protocol request + VersionHeader interface { + GetVersion() uint32 + SetVersion(uint32) } // TTLCondition is closure, that allows to validate request with ttl. diff --git a/service/meta.proto b/service/meta.proto index 4c09fb3c..62866d20 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -7,6 +7,7 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; message RequestMetaHeader { - uint32 TTL = 1; - uint64 Epoch = 2; + uint32 TTL = 1; + uint64 Epoch = 2; + uint32 Version = 3; } From cc3b4d9087a9499b5bde677209ebe8b997adbc77 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:17:54 +0300 Subject: [PATCH 2/7] proto: SearchRequest rename Version to QueryVersion --- object/service.proto | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/object/service.proto b/object/service.proto index 6abe8ede..da544473 100644 --- a/object/service.proto +++ b/object/service.proto @@ -129,12 +129,12 @@ message HeadResponse { } message SearchRequest { - // Version of search query format - uint32 Version = 1; // ContainerID for searching the object - bytes ContainerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "CID"]; + bytes ContainerID = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "CID"]; // Query in the binary serialized format - bytes Query = 3; + bytes Query = 2; + // QueryVersion is a version of search query format + uint32 QueryVersion = 3; // RequestMetaHeader contains information about request meta headers (should be embedded into message) 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) From b8f3641b591e2416fe7fa8222d2bda84a49833b5 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:20:49 +0300 Subject: [PATCH 3/7] service: add `SetVersion` to satisfy `MetaHeader` interface --- service/meta.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/meta.go b/service/meta.go index 1e3fcc86..6b5b8b79 100644 --- a/service/meta.go +++ b/service/meta.go @@ -56,6 +56,9 @@ const ( ErrIncorrectTTL = internal.Error("incorrect ttl") ) +// SetVersion sets protocol version to RequestMetaHeader. +func (m *RequestMetaHeader) SetVersion(v uint32) { m.Version = v } + // SetTTL sets TTL to RequestMetaHeader. func (m *RequestMetaHeader) SetTTL(v uint32) { m.TTL = v } From e2842ae2166ab0f2f6aebd5b5aa0ccb933ef9045 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:14:01 +0300 Subject: [PATCH 4/7] docs: add doc comments for meta and verify proto files --- service/meta.proto | 6 ++++++ service/verify.proto | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/service/meta.proto b/service/meta.proto index 62866d20..d3c3005e 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -6,8 +6,14 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; +// RequestMetaHeader contains information about request meta headers +// (should be embedded into message) message RequestMetaHeader { + // TTL must be larger than zero, it decreased in every NeoFS Node uint32 TTL = 1; + // Epoch for user can be empty, because node sets epoch to the actual value uint64 Epoch = 2; + // Version defines protocol version + // TODO: not used for now, should be implemented in future uint32 Version = 3; } diff --git a/service/verify.proto b/service/verify.proto index 7d833089..c70015b6 100644 --- a/service/verify.proto +++ b/service/verify.proto @@ -6,15 +6,25 @@ import "github.com/gogo/protobuf/gogoproto/gogo.proto"; option (gogoproto.stable_marshaler_all) = true; +// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request +// (should be embedded into message). message RequestVerificationHeader { message Sign { + // Sign is signature of the request or session key. bytes Sign = 1; + // Peer is compressed public key used for signature. bytes Peer = 2; } + message Signature { + // Sign is a signature and public key of the request. Sign Sign = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; + // Origin used for requests, when trusted node changes it and re-sign with session key. + // If session key used for signature request, then Origin should contain + // public key of user and signed session key. Sign Origin = 2; } + // Signatures is a set of signatures of every passed NeoFS Node repeated Signature Signatures = 1; } From c35eefec3b5e4d0d33aff42f827f41ed8d72d440 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:27:17 +0300 Subject: [PATCH 5/7] docs: add doc comments for session and state requests --- session/service.proto | 2 ++ state/service.proto | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/session/service.proto b/session/service.proto index 9b0c65ee..377e77ee 100644 --- a/session/service.proto +++ b/session/service.proto @@ -36,7 +36,9 @@ message CreateRequest { // Signed Init message response (Unsigned) from server with user private key session.Token Signed = 2; } + // RequestMetaHeader contains information about request meta headers (should be embedded into message) 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) service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } diff --git a/state/service.proto b/state/service.proto index cb2698b8..ed90e269 100644 --- a/state/service.proto +++ b/state/service.proto @@ -22,13 +22,17 @@ service Status { // NetmapRequest message to request current node netmap message NetmapRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) 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) service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } // MetricsRequest message to request node metrics message MetricsRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) 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) service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } @@ -41,7 +45,9 @@ message MetricsResponse { // HealthRequest message to check current state message HealthRequest { + // RequestMetaHeader contains information about request meta headers (should be embedded into message) 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) service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } From 0aa2d69dbd55afbd3e7e83758c45297958e46a3b Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:28:15 +0300 Subject: [PATCH 6/7] docs: regenerate proto documentation --- docs/accounting.md | 15 +++-- docs/bootstrap.md | 3 +- docs/container.md | 12 ++-- docs/object.md | 30 ++++----- docs/service.md | 157 +++++++++++++++++++++++++++++++++++++++++++++ docs/session.md | 2 + docs/state.md | 15 +++++ 7 files changed, 209 insertions(+), 25 deletions(-) create mode 100644 docs/service.md diff --git a/docs/accounting.md b/docs/accounting.md index b4317aee..268a1872 100644 --- a/docs/accounting.md +++ b/docs/accounting.md @@ -87,7 +87,8 @@ Balance returns current balance status of the NeoFS user | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -362,7 +363,8 @@ Delete allows user to remove unused cheque | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq request (UUIDv4) | | Signature | [bytes](#bytes) | | Signature is a signature of the sent request | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -382,7 +384,8 @@ DeleteResponse is empty | ----- | ---- | ----- | ----------- | | ID | [bytes](#bytes) | | ID is cheque identifier | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -420,7 +423,8 @@ DeleteResponse is empty | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -447,7 +451,8 @@ DeleteResponse is empty | Height | [uint64](#uint64) | | Height is the neo blockchain height until the cheque is valid | | MessageID | [bytes](#bytes) | | MessageID is a nonce for uniq request (UUIDv4) | | Signature | [bytes](#bytes) | | Signature is a signature of the sent request | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | diff --git a/docs/bootstrap.md b/docs/bootstrap.md index 19967bfa..737e0855 100644 --- a/docs/bootstrap.md +++ b/docs/bootstrap.md @@ -62,7 +62,8 @@ Process is method that allows to register node in the network and receive actual | ----- | ---- | ----- | ----------- | | type | [int32](#int32) | | Type is NodeType, can be InnerRingNode (type=1) or StorageNode (type=2) | | info | [NodeInfo](#bootstrap.NodeInfo) | | Info contains information about node | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | diff --git a/docs/container.md b/docs/container.md index 4f98a47d..bc559ce2 100644 --- a/docs/container.md +++ b/docs/container.md @@ -92,8 +92,9 @@ List returns all user's containers | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Signature | [bytes](#bytes) | | Signature of the container owner | +| 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) | @@ -113,7 +114,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | CID | [bytes](#bytes) | | CID (container id) is a SHA256 hash of the container structure | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -136,7 +138,8 @@ via consensus in inner ring nodes | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -163,7 +166,8 @@ via consensus in inner ring nodes | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | | rules | [netmap.PlacementRule](#netmap.PlacementRule) | | Rules define storage policy for the object inside the container. | | Signature | [bytes](#bytes) | | Signature of the user (owner id) | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | diff --git a/docs/object.md b/docs/object.md index 03e41c84..84077332 100644 --- a/docs/object.md +++ b/docs/object.md @@ -147,11 +147,11 @@ calculated for XORed data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is set by user to 0, node set epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | OwnerID | [bytes](#bytes) | | OwnerID is a wallet address | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Token | [session.Token](#session.Token) | | Token with session public key and user's signature | +| 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) | @@ -170,11 +170,11 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is set by user to 0, node set epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | Ranges | [Range](#object.Range) | repeated | Ranges of object's payload to calculate homomorphic hash | | Salt | [bytes](#bytes) | | Salt is used to XOR object's payload ranges before hashing, it can be nil | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -196,10 +196,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is set by user to 0, node set epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | Ranges | [Range](#object.Range) | repeated | Ranges of object's payload to return | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -221,9 +221,9 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is set by user to 0, node set epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -246,10 +246,10 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch should be empty on user side, node sets epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Address | [refs.Address](#refs.Address) | | Address of object (container id + object id) | | FullHeaders | [bool](#bool) | | FullHeaders can be set true for extended headers in the object | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| 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) | @@ -273,6 +273,8 @@ in distributed system. | ----- | ---- | ----- | ----------- | | Header | [PutRequest.PutHeader](#object.PutRequest.PutHeader) | | Header should be the first message in the stream | | Chunk | [bytes](#bytes) | | Chunk should be a remaining message in stream should be chunks | +| 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) | @@ -283,9 +285,7 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is set by user to 0, node set epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Object | [Object](#object.Object) | | Object with at least container id and owner id fields | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | | Token | [session.Token](#session.Token) | | Token with session public key and user's signature | @@ -308,11 +308,11 @@ in distributed system. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| Epoch | [uint64](#uint64) | | Epoch is set by user to 0, node set epoch to the actual value Deprecated: will be replaced with RequestMetaHeader (see develop branch) | -| Version | [uint32](#uint32) | | Version of search query format | | ContainerID | [bytes](#bytes) | | ContainerID for searching the object | | Query | [bytes](#bytes) | | Query in the binary serialized format | -| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every neofs-node Deprecated: will be replaced with RequestMetaHeader (see develop branch) | +| QueryVersion | [uint32](#uint32) | | QueryVersion is a version of search query format | +| 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) | diff --git a/docs/service.md b/docs/service.md new file mode 100644 index 00000000..454fab42 --- /dev/null +++ b/docs/service.md @@ -0,0 +1,157 @@ +# Protocol Documentation + + +## Table of Contents + +- [service/meta.proto](#service/meta.proto) + + - Messages + - [RequestMetaHeader](#service.RequestMetaHeader) + + +- [service/verify.proto](#service/verify.proto) + + - Messages + - [RequestVerificationHeader](#service.RequestVerificationHeader) + - [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) + - [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) + + +- [service/verify_test.proto](#service/verify_test.proto) + + - Messages + - [TestRequest](#service.TestRequest) + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## service/meta.proto + + + + + + + +### Message RequestMetaHeader +RequestMetaHeader contains information about request meta headers +(should be embedded into message) + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| TTL | [uint32](#uint32) | | TTL must be larger than zero, it decreased in every NeoFS Node | +| Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | +| Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | + + + + + + + + +

Top

+ +## service/verify.proto + + + + + + + +### Message RequestVerificationHeader +RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request +(should be embedded into message). + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Signatures | [RequestVerificationHeader.Signature](#service.RequestVerificationHeader.Signature) | repeated | Signatures is a set of signatures of every passed NeoFS Node | + + + + +### Message RequestVerificationHeader.Sign + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Sign | [bytes](#bytes) | | Sign is signature of the request or session key. | +| Peer | [bytes](#bytes) | | Peer is compressed public key used for signature. | + + + + +### Message RequestVerificationHeader.Signature + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Sign | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Sign is a signature and public key of the request. | +| Origin | [RequestVerificationHeader.Sign](#service.RequestVerificationHeader.Sign) | | Origin used for requests, when trusted node changes it and re-sign with session key. If session key used for signature request, then Origin should contain public key of user and signed session key. | + + + + + + + + +

Top

+ +## service/verify_test.proto + + + + + + + +### Message TestRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| IntField | [int32](#int32) | | | +| StringField | [string](#string) | | | +| BytesField | [bytes](#bytes) | | | +| CustomField | [bytes](#bytes) | | | +| Meta | [RequestMetaHeader](#service.RequestMetaHeader) | | | +| Header | [RequestVerificationHeader](#service.RequestVerificationHeader) | | | + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ Type | Java Type | Python Type | +| ----------- | ----- | -------- | --------- | ----------- | +| double | | double | double | float | +| float | | float | float | float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | +| sfixed32 | Always four bytes. | int32 | int | int | +| sfixed64 | Always eight bytes. | int64 | long | int/long | +| bool | | bool | boolean | boolean | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | + diff --git a/docs/session.md b/docs/session.md index cf4a1fd0..e8633d39 100644 --- a/docs/session.md +++ b/docs/session.md @@ -70,6 +70,8 @@ session key. Session is established during 4-step handshake in one gRPC stream | ----- | ---- | ----- | ----------- | | Init | [Token](#session.Token) | | Init is a message to initialize session opening. Carry: owner of manipulation object; ID of manipulation object; token lifetime bounds. | | Signed | [Token](#session.Token) | | Signed Init message response (Unsigned) from server with user private key | +| 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) | diff --git a/docs/state.md b/docs/state.md index 6d240c1d..e678be32 100644 --- a/docs/state.md +++ b/docs/state.md @@ -70,6 +70,11 @@ If node unhealthy field Status would contains detailed info. HealthRequest message to check current state +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| 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) | + @@ -89,6 +94,11 @@ HealthResponse message with current state MetricsRequest message to request node metrics +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| 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) | + @@ -109,6 +119,11 @@ from github.com/prometheus/client_model/metrics.proto NetmapRequest message to request current node netmap +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| 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) | + From 1a9a840d1789ab58e8453f9e3590c7fa05888a70 Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 21 Nov 2019 15:21:37 +0300 Subject: [PATCH 7/7] proto: regenerate proto files --- object/service.pb.go | Bin 120649 -> 120751 bytes service/meta.pb.go | Bin 8671 -> 9851 bytes service/verify.pb.go | Bin 21382 -> 21894 bytes session/service.pb.go | Bin 27061 -> 27261 bytes state/service.pb.go | Bin 37509 -> 38187 bytes 5 files changed, 0 insertions(+), 0 deletions(-) diff --git a/object/service.pb.go b/object/service.pb.go index d58d391d176e2ba3de903b12eeeeeeaccf14ff9a..4cad2f7bbc2c66113fc0081b3d42a0700ebea040 100644 GIT binary patch delta 5345 zcmYkA&5I>h8Hc$o!^~s?fdt8jIJSW-MmtG;-MUo?A)yBh({ZDs3qi4NeLzBHdYGAn z&O%BIm|!pjD$sv|J0mnQm>upTGC_zUTh& zx930p`26o~94`Mnd}X=+*rlbt_VeZb)l17Cu6^@~@4h+Se*1^x?K`g>-`s!g&VIN5 z)^hXk>*rWsetr0jZ~4%N?ruJ~b^G}4arxB#>vxWCKL3>aKRdj9_Tf*) zz2*0>URXYR<^1ye_n$m_``go(mY0sMEgyXK;_}SVlgr<)Ka=D?dUW~h7f0pOdu6`d zJH9(l2m9Gc#dFy5-W)t~F+0ht_)kB^XW@I!N*13DTeC90*A44Dw?%w!*_m(Rd$wi| z5<1q00R>$jKg{bo{@L(ljSN>ZBxUH|pmX4>wlsWo-BZ0fyC|)x&@iBMKtztV8j~gt zcNjlsY%1|*!dCUHS)VwTA-f!+>$WYL_#fL5CZ9s#;P45^}qi2iMoUq~B zNx}QtkPxa3HX5)Y$_)M&YCw`^Y}hNt8!WETuhfyRBa*g!wQx7Q_sB_bM{_`UENG** zH31K^I%g*?<@m4>^#r;^gLRl{56$kc@YZ~0COVW|ED&P2C6gA{fHt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?sWzla3^~dikmzbM*+XDl7Hj~AY)~j~ z-QoYASx;W-HZCDaz5+3{HfE2*V)DOs^{C;&|zfA#dq)mN_3H5X%bs4(l8Ki;Du}?M9c#J$4 z$vRY{S&BG}wAi8qMlEA!#7!E0&DV-hqqzBu;i*rS{d?bD*#H3I6mw5>wAf4Z2M z&`{fSF&^#4sgL3K=e2$7;t@Pu^e*br;?0?Md0JZ@?=7a6ly|k;Q_A?P_HAyCtG^-y t<(sAMoyohZJ8;y`uzNDZ)v9gVry7#`(^vOv>Fd;?{CHz){C2rp`3DtNQqTYZ delta 499 zcmYjNJxjzu6y%bq=ZPZ7Rf3$=Asn(F$zB#4QS7daSZ9+9+Ng!fHIjc|vwygNpm`vu)+c*1uXP>9b*T|0J{k5W)jr_46$$@>24|mUQZ>mdDy667t z`c9?xCmGt4M7X1s@5DY0zG9wd?qTDl*EeD^VvD(Qa`U*?PU*)OLM{pO2IUk=PAH(r zintb&!8%(gSPi6xQz3;lpA!#C1zo@?HR+Wi5EDQ}CQM-yp zwG19S!N;SnlCZ=yjqn=18oF2L2^q?5=w|3PNX)|m;H_a2ScU|b$Wr4zj@TRu>tGWm k_>Ye<#R3#K3#-BcYH)Y4eIB{3oyW+%4c}MYc(3UH0jW`e7ytkO diff --git a/service/verify.pb.go b/service/verify.pb.go index 3c0f357ec62f5c1b9f723676d4a9c1e2355febde..95a94527cf7b9f61312b264b05f837741b083cad 100644 GIT binary patch delta 648 zcmaixy-or_6omsA5-?F{G_mp8sX?|OvC)VYMlH~U${34f_p&0ynsF_lLr>iR zH_GNUy}3s(>xspG&Rut8lK>1q(!1H}M8tys@>*OSVvGbrQY59A;LyT;IiIt(aBMgzmm(P5knQ)&Kwi delta 117 zcmZo$&Dge_al?KlmXgYX)X4{#q&bR9ib|796sk9`VYX#s3C>KF3{3WBQJlP+MPRZXw;(H6aI(Cx N8<=2&4(CjjQeB0>NF diff --git a/session/service.pb.go b/session/service.pb.go index eef58192979350812ad2f5ceb3ffabf56c925878..853252394b03b14c32b22b18ab6e1031b03a07df 100644 GIT binary patch delta 277 zcmaivJxT;Y6ogrvz%?*15ka9sP29v2Y#=6Xpkm%LU9;1$(@*=oSupYl27LohAc(1# z(A+DSX(HJE#fAl6{XIO5KAuN+sPfHtGoP*Rw37)=csWq*nC6b?JQEs;=0a42*h=c1 z1&MIA42JXrqc1eNZ(OmfoeT?)nqXhkd-`HEDU_<4b1yHd?fhPCDD!Z z!a-?}78>T!*^sDTic6*|%qWMan29H>bB2o~O$jXFe=GhiUK=aZGBn)(eR<9l+R&6s M`E|N_|5iQvPY_dPO8@`> delta 55 xcmex+g>ma;#tjNAlfU!v@+csI$%b5#lPy?eChuX9Vuy-PzRKdhc^>Qi6adQ(57Phu diff --git a/state/service.pb.go b/state/service.pb.go index 8e66a2f8fd1094e11e3cfe81e9efb57e402459ae..520c8ce62a096ee60474980a3e512a8e2acf5669 100644 GIT binary patch delta 722 zcmZo&%CveF(}usyY5MvKL8*nMsl_F}sU?XXsfj76MGDFJc_oRNdBqBud1?7Yxrrs2 z`FRS7N%^HE3Pljb3b{bl3K?MK#R?k58Tq9-DGEuc3aPnCsVOO`DL}0y`9M|0#fj;u znv;Js%S>)(5tbP)g RKOoC7dA