[#45] Fix linter errors

- Changed package names adding version
- Added documentation descriptions (sometimes useless) for all fields
- Changed enum format
- Made SessionToken and BearerToken field names more clear

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-08-13 00:43:51 +03:00 committed by Alex Vanin
parent 35d1d34ee0
commit 42e35fefff
13 changed files with 393 additions and 224 deletions

View file

@ -1,17 +1,19 @@
syntax = "proto3";
package service;
package neo.fs.v2.service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service";
option csharp_namespace = "NeoFS.API.Service";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service";
option csharp_namespace = "NeoFS.API.v2.Service";
import "acl/types.proto";
import "refs/types.proto";
import "service/verify.proto";
// Extended headers for Request/Response
message XHeader {
// Key of the X-Header.
string key = 1;
// Value of the X-Header.
string value = 2;
}
@ -20,6 +22,7 @@ message XHeader {
message Version {
// Major API version.
uint32 major = 1;
// Minor API version.
uint32 minor = 2;
}
@ -28,50 +31,67 @@ message Version {
message TokenLifetime {
// Expiration Epoch
uint64 exp = 1;
// Not valid before Epoch
uint64 nbf = 2;
// Issued at Epoch
uint64 iat = 3;
}
// NeoFS session token.
message SessionToken {
// Session token body
message Body {
// ID is a token identifier. valid UUIDv4 represented in bytes
bytes id = 1;
// OwnerID carries identifier of the session initiator.
refs.OwnerID owner_id = 2;
neo.fs.v2.refs.OwnerID owner_id = 2;
// Verb is an enumeration of session request types
enum Verb {
// Unknown verb
VERB_UNSPECIFIED = 0;
// Refers to object.Put RPC call
OBJECT_PUT = 0;
OBJECT_PUT = 1;
// Refers to object.Get RPC call
OBJECT_GET = 1;
OBJECT_GET = 2;
// Refers to object.Head RPC call
OBJECT_HEAD = 2;
OBJECT_HEAD = 3;
// Refers to object.Search RPC call
OBJECT_SEARCH = 3;
OBJECT_SEARCH = 4;
// Refers to object.Delete RPC call
OBJECT_DELETE = 4;
OBJECT_DELETE = 5;
// Refers to object.GetRange RPC call
OBJECT_RANGE = 5;
OBJECT_RANGE = 6;
// Refers to object.GetRangeHash RPC call
OBJECT_RANGEHASH = 6;
OBJECT_RANGEHASH = 7;
}
// Verb is a type of request for which the token is issued
Verb verb = 3;
// Lifetime is a lifetime of the session
TokenLifetime lifetime = 4;
// SessionKey is a public key of session key
bytes session_key = 5;
// Carries context of the session.
oneof context {
// object_address represents the object session context.
refs.Address object_address = 6;
neo.fs.v2.refs.Address object_address = 6;
}
}
// Session Token body
Body token = 1;
Body body = 1;
// Signature is a signature of session token information
Signature signature = 2;
@ -79,16 +99,19 @@ message SessionToken {
// BearerToken has information about request ACL rules with limited lifetime
message BearerToken {
// Bearer Token body
message Body {
// EACLTable carries table of extended ACL rules
acl.EACLTable eacl_table = 1;
neo.fs.v2.acl.EACLTable eacl_table = 1;
// OwnerID carries identifier of the token owner
refs.OwnerID owner_id = 2;
neo.fs.v2.refs.OwnerID owner_id = 2;
// Token expiration and valid time period parameters
TokenLifetime lifetime = 3;
}
// Bearer Token body
Body token = 1;
Body body = 1;
// Signature of BearerToken body
Signature signature = 2;
@ -98,16 +121,21 @@ message BearerToken {
message RequestMetaHeader {
// Client API version.
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;
// Token is a token of the session within which the request is sent
SessionToken token = 5;
SessionToken session_token = 5;
// Bearer is a Bearer token of the request
BearerToken bearer = 6;
BearerToken bearer_token = 6;
// RequestMetaHeader of the origin request.
RequestMetaHeader origin = 7;
@ -117,10 +145,13 @@ message RequestMetaHeader {
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;

View file

@ -1,9 +1,9 @@
syntax = "proto3";
package service;
package neo.fs.v2.service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service";
option csharp_namespace = "NeoFS.API.Service";
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service;service";
option csharp_namespace = "NeoFS.API.v2.Service";
import "acl/types.proto";
import "refs/types.proto";