[#37] Add matryoska-style meta and verification headers
Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
parent
658bc45fb9
commit
4b1eb63b59
2 changed files with 51 additions and 20 deletions
|
@ -5,6 +5,16 @@ 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 "acl/types.proto";
|
||||||
|
import "service/verify.proto";
|
||||||
|
|
||||||
|
message XHeader {
|
||||||
|
// Key of the X-Header.
|
||||||
|
string key = 1;
|
||||||
|
// Value of the X-Header.
|
||||||
|
string value = 2;
|
||||||
|
}
|
||||||
|
|
||||||
// Represents API version used by node.
|
// Represents API version used by node.
|
||||||
message Version {
|
message Version {
|
||||||
// Major API version.
|
// Major API version.
|
||||||
|
@ -13,19 +23,32 @@ message Version {
|
||||||
uint32 minor = 2;
|
uint32 minor = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestMetaHeader contains information about request meta headers.
|
// Information about the request
|
||||||
message RequestMetaHeader {
|
message RequestMetaHeader {
|
||||||
// Carries maximum number of nodes in the request route.
|
// Client API version.
|
||||||
uint32 ttl = 1;
|
Version version = 1;
|
||||||
|
// Client local epoch number. Set to 0 if unknown.
|
||||||
|
uint64 epoch = 2;
|
||||||
|
// Maximum number of nodes in the request route.
|
||||||
|
uint32 ttl = 3;
|
||||||
|
// Request X-Headers.
|
||||||
|
repeated XHeader x_headers = 4;
|
||||||
|
|
||||||
message XHeader {
|
// RequestMetaHeader of the origin request.
|
||||||
// Carries key to the X-Header.
|
RequestMetaHeader origin = 98;
|
||||||
string key = 1;
|
|
||||||
|
|
||||||
// Carries value of the X-Header.
|
|
||||||
string value = 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Carries request X-Headers.
|
// Information about the response
|
||||||
repeated XHeader x_headers = 2;
|
message ResponseMetaHeader {
|
||||||
|
// Server API version.
|
||||||
|
Version version = 1;
|
||||||
|
// Server local epoch number.
|
||||||
|
uint64 epoch = 2;
|
||||||
|
// Maximum number of nodes in the response route.
|
||||||
|
uint32 ttl = 3;
|
||||||
|
// Response X-Headers.
|
||||||
|
repeated XHeader x_headers = 4;
|
||||||
|
|
||||||
|
// Carries response meta header of the origin response.
|
||||||
|
ResponseMetaHeader origin = 98;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,17 +15,17 @@ message Signature {
|
||||||
bytes sign = 2;
|
bytes sign = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// RequestVerificationHeader is a set of signatures of every NeoFS Node that
|
// Verification info for request signed by all intermediate nodes
|
||||||
// processed request.
|
|
||||||
message RequestVerificationHeader {
|
message RequestVerificationHeader {
|
||||||
// Signatures is a set of signatures of every passed NeoFS Node
|
Signature body_signature = 1;
|
||||||
repeated Signature signatures = 1;
|
Signature meta_signature = 2;
|
||||||
|
|
||||||
// Token is a token of the session within which the request is sent
|
// Token is a token of the session within which the request is sent
|
||||||
SessionToken token = 2;
|
SessionToken token = 3;
|
||||||
|
|
||||||
// Bearer is a Bearer token of the request
|
// Bearer is a Bearer token of the request
|
||||||
BearerTokenMsg bearer = 3;
|
BearerTokenMsg bearer = 4;
|
||||||
|
|
||||||
|
RequestVerificationHeader origin = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Represents the NeoFS session token.
|
// Represents the NeoFS session token.
|
||||||
|
@ -112,3 +112,11 @@ message BearerTokenMsg {
|
||||||
// Signature is a signature of token information
|
// Signature is a signature of token information
|
||||||
bytes signature = 3;
|
bytes signature = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Verification info for response signed by all intermediate nodes
|
||||||
|
message ResponseVerificationHeader {
|
||||||
|
Signature body_signature = 1;
|
||||||
|
Signature meta_signature = 2;
|
||||||
|
|
||||||
|
ResponseVerificationHeader origin = 3;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue