2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-05 23:25:50 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.service;
|
2020-08-05 23:25:50 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/service/grpc;service";
|
2020-08-12 21:43:51 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.v2.Service";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
import "acl/types.proto";
|
2020-08-11 15:21:45 +00:00
|
|
|
import "refs/types.proto";
|
2020-08-11 14:49:31 +00:00
|
|
|
import "service/verify.proto";
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Extended headers for Request/Response
|
2020-08-11 14:49:31 +00:00
|
|
|
message XHeader {
|
|
|
|
// Key of the X-Header.
|
|
|
|
string key = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Value of the X-Header.
|
|
|
|
string value = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Represents API version used by node.
|
|
|
|
message Version {
|
|
|
|
// Major API version.
|
|
|
|
uint32 major = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Minor API version.
|
|
|
|
uint32 minor = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Lifetime parameters of the token. Filed names taken from rfc7519.
|
|
|
|
message TokenLifetime {
|
|
|
|
// Expiration Epoch
|
|
|
|
uint64 exp = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Not valid before Epoch
|
|
|
|
uint64 nbf = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Issued at Epoch
|
|
|
|
uint64 iat = 3;
|
|
|
|
}
|
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Context information for Session Tokens related to ObjectService requests
|
2020-08-18 11:00:34 +00:00
|
|
|
message ObjectSessionContext {
|
2020-08-13 20:51:55 +00:00
|
|
|
// Object request verbs
|
|
|
|
enum Verb {
|
|
|
|
// Unknown verb
|
|
|
|
VERB_UNSPECIFIED = 0;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.Put RPC call
|
|
|
|
PUT = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.Get RPC call
|
|
|
|
GET = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.Head RPC call
|
|
|
|
HEAD = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.Search RPC call
|
|
|
|
SEARCH = 4;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.Delete RPC call
|
|
|
|
DELETE = 5;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.GetRange RPC call
|
|
|
|
RANGE = 6;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Refers to object.GetRangeHash RPC call
|
|
|
|
RANGEHASH = 7;
|
|
|
|
}
|
|
|
|
// Verb is a type of request for which the token is issued
|
|
|
|
Verb verb = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// Related Object address
|
|
|
|
neo.fs.v2.refs.Address address = 2;
|
|
|
|
}
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-13 20:51:55 +00:00
|
|
|
// 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.
|
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Lifetime is a lifetime of the session
|
2020-08-13 20:51:55 +00:00
|
|
|
TokenLifetime lifetime = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// SessionKey is a public key of session key
|
2020-08-13 20:51:55 +00:00
|
|
|
bytes session_key = 4;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Carries context of the session.
|
|
|
|
oneof context {
|
2020-08-13 20:51:55 +00:00
|
|
|
// ObjectService session context.
|
2020-08-18 11:00:34 +00:00
|
|
|
ObjectSessionContext object = 5;
|
2020-08-11 15:21:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Session Token body
|
2020-08-12 21:43:51 +00:00
|
|
|
Body body = 1;
|
2020-08-11 15:21:45 +00:00
|
|
|
|
|
|
|
// Signature is a signature of session token information
|
|
|
|
Signature signature = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// BearerToken has information about request ACL rules with limited lifetime
|
|
|
|
message BearerToken {
|
2020-08-12 21:43:51 +00:00
|
|
|
// Bearer Token body
|
2020-08-11 15:21:45 +00:00
|
|
|
message Body {
|
|
|
|
// EACLTable carries table of extended ACL rules
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.acl.EACLTable eacl_table = 1;
|
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// OwnerID carries identifier of the token owner
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 2;
|
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Token expiration and valid time period parameters
|
|
|
|
TokenLifetime lifetime = 3;
|
|
|
|
}
|
|
|
|
// Bearer Token body
|
2020-08-12 21:43:51 +00:00
|
|
|
Body body = 1;
|
2020-08-11 15:21:45 +00:00
|
|
|
|
|
|
|
// Signature of BearerToken body
|
|
|
|
Signature signature = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Information about the request
|
2020-01-30 11:41:24 +00:00
|
|
|
message RequestMetaHeader {
|
2020-08-11 14:49:31 +00:00
|
|
|
// Client API version.
|
|
|
|
Version version = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Client local epoch number. Set to 0 if unknown.
|
|
|
|
uint64 epoch = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Maximum number of nodes in the request route.
|
|
|
|
uint32 ttl = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Request X-Headers.
|
|
|
|
repeated XHeader x_headers = 4;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Token is a token of the session within which the request is sent
|
2020-08-12 21:43:51 +00:00
|
|
|
SessionToken session_token = 5;
|
|
|
|
|
2020-08-11 15:21:45 +00:00
|
|
|
// Bearer is a Bearer token of the request
|
2020-08-12 21:43:51 +00:00
|
|
|
BearerToken bearer_token = 6;
|
2020-02-13 14:21:46 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// RequestMetaHeader of the origin request.
|
2020-08-11 15:21:45 +00:00
|
|
|
RequestMetaHeader origin = 7;
|
2020-08-11 14:49:31 +00:00
|
|
|
}
|
2020-06-18 08:49:10 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Information about the response
|
|
|
|
message ResponseMetaHeader {
|
|
|
|
// Server API version.
|
|
|
|
Version version = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Server local epoch number.
|
|
|
|
uint64 epoch = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Maximum number of nodes in the response route.
|
|
|
|
uint32 ttl = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Response X-Headers.
|
|
|
|
repeated XHeader x_headers = 4;
|
2020-06-18 08:49:10 +00:00
|
|
|
|
2020-08-11 14:49:31 +00:00
|
|
|
// Carries response meta header of the origin response.
|
2020-08-11 15:21:45 +00:00
|
|
|
ResponseMetaHeader origin = 5;
|
2020-06-18 08:49:10 +00:00
|
|
|
}
|