2020-08-18 13:49:05 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package neo.fs.v2.session;
|
|
|
|
|
2023-03-07 08:50:02 +00:00
|
|
|
option go_package = "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session/grpc;session";
|
2021-03-10 10:54:06 +00:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Session";
|
2020-08-18 13:49:05 +00:00
|
|
|
|
|
|
|
import "refs/types.proto";
|
2020-08-19 14:00:23 +00:00
|
|
|
import "acl/types.proto";
|
2021-10-04 11:34:43 +00:00
|
|
|
import "status/types.proto";
|
2020-08-18 13:49:05 +00:00
|
|
|
|
|
|
|
// Context information for Session Tokens related to ObjectService requests
|
|
|
|
message ObjectSessionContext {
|
|
|
|
// Object request verbs
|
|
|
|
enum Verb {
|
|
|
|
// Unknown verb
|
|
|
|
VERB_UNSPECIFIED = 0;
|
|
|
|
|
|
|
|
// Refers to object.Put RPC call
|
|
|
|
PUT = 1;
|
|
|
|
|
|
|
|
// Refers to object.Get RPC call
|
|
|
|
GET = 2;
|
|
|
|
|
|
|
|
// Refers to object.Head RPC call
|
|
|
|
HEAD = 3;
|
|
|
|
|
|
|
|
// Refers to object.Search RPC call
|
|
|
|
SEARCH = 4;
|
|
|
|
|
|
|
|
// Refers to object.Delete RPC call
|
|
|
|
DELETE = 5;
|
|
|
|
|
|
|
|
// Refers to object.GetRange RPC call
|
|
|
|
RANGE = 6;
|
|
|
|
|
|
|
|
// Refers to object.GetRangeHash RPC call
|
|
|
|
RANGEHASH = 7;
|
2024-08-05 17:43:00 +00:00
|
|
|
|
|
|
|
// Refers to object.Patch RPC call
|
|
|
|
PATCH = 8;
|
2020-08-18 13:49:05 +00:00
|
|
|
}
|
2020-10-16 06:20:47 +00:00
|
|
|
// Type of request for which the token is issued
|
2024-02-28 15:53:04 +00:00
|
|
|
Verb verb = 1 [ json_name = "verb" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
2022-09-16 14:11:53 +00:00
|
|
|
// Carries objects involved in the object session.
|
|
|
|
message Target {
|
|
|
|
// Indicates which container the session is spread to. Field MUST be set
|
|
|
|
// and correct.
|
2024-02-28 15:53:04 +00:00
|
|
|
refs.ContainerID container = 1 [ json_name = "container" ];
|
2022-09-16 14:11:53 +00:00
|
|
|
|
|
|
|
// Indicates which objects the session is spread to. Objects are expected
|
2024-09-05 13:24:35 +00:00
|
|
|
// to be stored in the FrostFS container referenced by `container` field.
|
2022-09-16 14:11:53 +00:00
|
|
|
// Each element MUST have correct format.
|
2024-02-28 15:53:04 +00:00
|
|
|
repeated refs.ObjectID objects = 2 [ json_name = "objects" ];
|
2022-09-16 14:11:53 +00:00
|
|
|
}
|
|
|
|
// Object session target. MUST be correctly formed and set. If `objects`
|
|
|
|
// field is not empty, then the session applies only to these elements,
|
|
|
|
// otherwise, to all objects from the specified container.
|
2024-02-28 15:53:04 +00:00
|
|
|
Target target = 2 [ json_name = "target" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
}
|
|
|
|
|
2021-05-24 11:12:03 +00:00
|
|
|
// Context information for Session Tokens related to ContainerService requests.
|
|
|
|
message ContainerSessionContext {
|
2024-02-28 15:53:04 +00:00
|
|
|
// Container request verbs
|
|
|
|
enum Verb {
|
|
|
|
// Unknown verb
|
|
|
|
VERB_UNSPECIFIED = 0;
|
2021-05-24 11:12:03 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// Refers to container.Put RPC call
|
|
|
|
PUT = 1;
|
2021-05-24 11:12:03 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// Refers to container.Delete RPC call
|
|
|
|
DELETE = 2;
|
2021-05-24 11:12:03 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// Refers to container.SetExtendedACL RPC call
|
|
|
|
SETEACL = 3;
|
|
|
|
}
|
|
|
|
// Type of request for which the token is issued
|
|
|
|
Verb verb = 1 [ json_name = "verb" ];
|
2021-05-24 11:12:03 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// Spreads the action to all owner containers.
|
|
|
|
// If set, container_id field is ignored.
|
|
|
|
bool wildcard = 2 [ json_name = "wildcard" ];
|
2021-05-24 11:12:03 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// Particular container to which the action applies.
|
|
|
|
// Ignored if wildcard flag is set.
|
|
|
|
refs.ContainerID container_id = 3 [ json_name = "containerID" ];
|
2021-05-24 11:12:03 +00:00
|
|
|
}
|
|
|
|
|
2024-09-05 13:24:35 +00:00
|
|
|
// FrostFS Session Token.
|
2020-08-18 13:49:05 +00:00
|
|
|
message SessionToken {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session Token body
|
2020-08-18 13:49:05 +00:00
|
|
|
message Body {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Token identifier is a valid UUIDv4 in binary form
|
2024-02-28 15:53:04 +00:00
|
|
|
bytes id = 1 [ json_name = "id" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Identifier of the session initiator
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 2 [ json_name = "ownerID" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
2020-11-25 10:16:52 +00:00
|
|
|
// Lifetime parameters of the token. Field names taken from rfc7519.
|
2020-08-18 13:49:05 +00:00
|
|
|
message TokenLifetime {
|
|
|
|
// Expiration Epoch
|
2024-02-28 15:53:04 +00:00
|
|
|
uint64 exp = 1 [ json_name = "exp" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
|
|
|
// Not valid before Epoch
|
2024-02-28 15:53:04 +00:00
|
|
|
uint64 nbf = 2 [ json_name = "nbf" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
|
|
|
// Issued at Epoch
|
2024-02-28 15:53:04 +00:00
|
|
|
uint64 iat = 3 [ json_name = "iat" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
}
|
2020-10-16 06:20:47 +00:00
|
|
|
// Lifetime of the session
|
2024-02-28 15:53:04 +00:00
|
|
|
TokenLifetime lifetime = 3 [ json_name = "lifetime" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Public key used in session
|
2024-02-28 15:53:04 +00:00
|
|
|
bytes session_key = 4 [ json_name = "sessionKey" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session Context information
|
2020-08-18 13:49:05 +00:00
|
|
|
oneof context {
|
2020-10-16 06:20:47 +00:00
|
|
|
// ObjectService session context
|
2024-02-28 15:53:04 +00:00
|
|
|
ObjectSessionContext object = 5 [ json_name = "object" ];
|
2021-05-24 11:14:22 +00:00
|
|
|
|
|
|
|
// ContainerService session context
|
2024-02-28 15:53:04 +00:00
|
|
|
ContainerSessionContext container = 6 [ json_name = "container" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
}
|
|
|
|
}
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session Token contains the proof of trust between peers to be attached in
|
|
|
|
// requests for further verification. Please see corresponding section of
|
2024-09-05 13:24:35 +00:00
|
|
|
// FrostFS Technical Specification for details.
|
2024-02-28 15:53:04 +00:00
|
|
|
Body body = 1 [ json_name = "body" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Signature of `SessionToken` information
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature signature = 2 [ json_name = "signature" ];
|
2020-08-18 13:49:05 +00:00
|
|
|
}
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2024-02-28 15:53:04 +00:00
|
|
|
// Extended headers for Request/Response. They may contain any user-defined
|
|
|
|
// headers to be interpreted on application level.
|
2021-01-11 14:11:36 +00:00
|
|
|
//
|
2024-02-28 15:53:04 +00:00
|
|
|
// Key name must be a unique valid UTF-8 string. Value can't be empty. Requests
|
|
|
|
// or Responses with duplicated header names or headers with empty values will
|
|
|
|
// be considered invalid.
|
2021-01-11 14:11:36 +00:00
|
|
|
//
|
2024-02-28 15:53:04 +00:00
|
|
|
// There are some "well-known" headers starting with `__SYSTEM__` (`__NEOFS__`
|
|
|
|
// is deprecated) prefix that affect system behaviour:
|
2021-01-11 14:11:36 +00:00
|
|
|
//
|
2023-03-14 07:24:35 +00:00
|
|
|
// * [ __SYSTEM__NETMAP_EPOCH ] \
|
|
|
|
// (`__NEOFS__NETMAP_EPOCH` is deprecated) \
|
2021-01-11 14:11:36 +00:00
|
|
|
// Netmap epoch to use for object placement calculation. The `value` is string
|
|
|
|
// encoded `uint64` in decimal presentation. If set to '0' or not set, the
|
|
|
|
// current epoch only will be used.
|
2023-03-14 07:24:35 +00:00
|
|
|
// * [ __SYSTEM__NETMAP_LOOKUP_DEPTH ] \
|
|
|
|
// (`__NEOFS__NETMAP_LOOKUP_DEPTH` is deprecated) \
|
2021-01-11 14:11:36 +00:00
|
|
|
// If object can't be found using current epoch's netmap, this header limits
|
2022-04-13 06:21:33 +00:00
|
|
|
// how many past epochs the node can look up through. The `value` is string
|
2024-02-28 15:53:04 +00:00
|
|
|
// encoded `uint64` in decimal presentation. If set to '0' or not set, only
|
|
|
|
// the current epoch will be used.
|
2020-08-19 14:00:23 +00:00
|
|
|
message XHeader {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Key of the X-Header
|
2024-02-28 15:53:04 +00:00
|
|
|
string key = 1 [ json_name = "key" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Value of the X-Header
|
2024-02-28 15:53:04 +00:00
|
|
|
string value = 2 [ json_name = "value" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
}
|
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Meta information attached to the request. When forwarded between peers,
|
|
|
|
// request meta headers are folded in matryoshka style.
|
2020-08-19 14:00:23 +00:00
|
|
|
message RequestMetaHeader {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Peer's API version used
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Peer's local epoch number. Set to 0 if unknown.
|
2024-02-28 15:53:04 +00:00
|
|
|
uint64 epoch = 2 [ json_name = "epoch" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Maximum number of intermediate nodes in the request route
|
2024-02-28 15:53:04 +00:00
|
|
|
uint32 ttl = 3 [ json_name = "ttl" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Request X-Headers
|
2024-02-28 15:53:04 +00:00
|
|
|
repeated XHeader x_headers = 4 [ json_name = "xHeaders" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session token within which the request is sent
|
2024-02-28 15:53:04 +00:00
|
|
|
SessionToken session_token = 5 [ json_name = "sessionToken" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// `BearerToken` with eACL overrides for the request
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.acl.BearerToken bearer_token = 6 [ json_name = "bearerToken" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// `RequestMetaHeader` of the origin request
|
2024-02-28 15:53:04 +00:00
|
|
|
RequestMetaHeader origin = 7 [ json_name = "origin" ];
|
2022-01-10 12:26:42 +00:00
|
|
|
|
2024-09-05 13:24:35 +00:00
|
|
|
// FrostFS network magic. Must match the value for the network
|
2022-01-10 12:26:42 +00:00
|
|
|
// that the server belongs to.
|
2024-02-28 15:53:04 +00:00
|
|
|
uint64 magic_number = 8 [ json_name = "magicNumber" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Information about the response
|
|
|
|
message ResponseMetaHeader {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Peer's API version used
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Version version = 1 [ json_name = "version" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Peer's local epoch number
|
2024-02-28 15:53:04 +00:00
|
|
|
uint64 epoch = 2 [ json_name = "epoch" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Maximum number of intermediate nodes in the request route
|
2024-02-28 15:53:04 +00:00
|
|
|
uint32 ttl = 3 [ json_name = "ttl" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Response X-Headers
|
2024-02-28 15:53:04 +00:00
|
|
|
repeated XHeader x_headers = 4 [ json_name = "xHeaders" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// `ResponseMetaHeader` of the origin request
|
2024-02-28 15:53:04 +00:00
|
|
|
ResponseMetaHeader origin = 5 [ json_name = "origin" ];
|
2021-10-04 11:34:43 +00:00
|
|
|
|
2021-11-12 16:10:39 +00:00
|
|
|
// Status return
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.status.Status status = 6 [ json_name = "status" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
}
|
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// Verification info for the request signed by all intermediate nodes.
|
2020-08-19 14:00:23 +00:00
|
|
|
message RequestVerificationHeader {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Request Body signature. Should be generated once by the request initiator.
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ];
|
2020-10-16 06:20:47 +00:00
|
|
|
// Request Meta signature is added and signed by each intermediate node
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ];
|
2020-10-16 06:20:47 +00:00
|
|
|
// Signature of previous hops
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature origin_signature = 3
|
|
|
|
[ json_name = "originSignature" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
|
|
|
// Chain of previous hops signatures
|
2024-02-28 15:53:04 +00:00
|
|
|
RequestVerificationHeader origin = 4 [ json_name = "origin" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
}
|
|
|
|
|
2022-04-13 06:21:33 +00:00
|
|
|
// Verification info for the response signed by all intermediate nodes
|
2020-08-19 14:00:23 +00:00
|
|
|
message ResponseVerificationHeader {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Response Body signature. Should be generated once by an answering node.
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature body_signature = 1 [ json_name = "bodySignature" ];
|
2020-10-16 06:20:47 +00:00
|
|
|
// Response Meta signature is added and signed by each intermediate node
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature meta_signature = 2 [ json_name = "metaSignature" ];
|
2020-10-16 06:20:47 +00:00
|
|
|
// Signature of previous hops
|
2024-02-28 15:53:04 +00:00
|
|
|
neo.fs.v2.refs.Signature origin_signature = 3
|
|
|
|
[ json_name = "originSignature" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
|
|
|
|
// Chain of previous hops signatures
|
2024-02-28 15:53:04 +00:00
|
|
|
ResponseVerificationHeader origin = 4 [ json_name = "origin" ];
|
2020-08-19 14:00:23 +00:00
|
|
|
}
|