2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-05 23:28:57 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.session;
|
2020-08-05 23:28:57 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/session/grpc;session";
|
2021-03-10 10:54:06 +00:00
|
|
|
option csharp_namespace = "Neo.FileStorage.API.Session";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-08-11 09:02:10 +00:00
|
|
|
import "refs/types.proto";
|
2020-08-19 14:00:23 +00:00
|
|
|
import "session/types.proto";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// `SessionService` allows to establish a temporary trust relationship between
|
|
|
|
// two peer nodes and generate a `SessionToken` as the proof of trust to be
|
|
|
|
// attached in requests for further verification. Please see corresponding
|
|
|
|
// section of NeoFS Technical Specification for details.
|
2020-08-12 21:43:51 +00:00
|
|
|
service SessionService {
|
2022-04-13 06:21:33 +00:00
|
|
|
// Open a new session between two peers.
|
2021-11-12 16:10:39 +00:00
|
|
|
//
|
|
|
|
// Statuses:
|
|
|
|
// - **OK** (0, SECTION_SUCCESS):
|
|
|
|
// session has been successfully opened;
|
|
|
|
// - Common failures (SECTION_FAILURE_COMMON).
|
2020-08-11 09:03:50 +00:00
|
|
|
rpc Create (CreateRequest) returns (CreateResponse);
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Information necessary for opening a session.
|
2020-01-30 11:41:24 +00:00
|
|
|
message CreateRequest {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session creation request body
|
2020-08-11 09:02:10 +00:00
|
|
|
message Body {
|
2021-01-11 14:11:36 +00:00
|
|
|
// Session initiating user's or node's key derived `OwnerID`
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 1;
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session expiration `Epoch`
|
2020-08-18 13:41:47 +00:00
|
|
|
uint64 expiration = 2;
|
2020-08-11 09:02:10 +00:00
|
|
|
}
|
2022-04-13 06:21:33 +00:00
|
|
|
// Body of a create session token request message.
|
2020-08-11 09:02:10 +00:00
|
|
|
Body body = 1;
|
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Carries request meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestMetaHeader meta_header = 2;
|
2020-08-05 23:28:57 +00:00
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Carries request verification information. This header is used to
|
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Information about the opened session.
|
2020-01-30 11:41:24 +00:00
|
|
|
message CreateResponse {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Session creation response body
|
2020-08-11 09:02:10 +00:00
|
|
|
message Body {
|
2020-10-16 06:20:47 +00:00
|
|
|
// Identifier of a newly created session
|
2020-08-11 09:02:10 +00:00
|
|
|
bytes id = 1;
|
|
|
|
|
2020-10-16 06:20:47 +00:00
|
|
|
// Public key used for session
|
2020-08-11 09:02:10 +00:00
|
|
|
bytes session_key = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Body of create session token response message.
|
|
|
|
Body body = 1;
|
|
|
|
|
|
|
|
// Carries response meta information. Header data is used only to regulate
|
|
|
|
// message transport and does not affect request execution.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
|
2020-05-07 15:44:23 +00:00
|
|
|
|
2020-08-11 09:02:10 +00:00
|
|
|
// Carries response verification information. This header is used to
|
2020-10-16 06:20:47 +00:00
|
|
|
// authenticate the nodes of the message route and check the correctness of
|
|
|
|
// transmission.
|
2020-08-19 14:00:23 +00:00
|
|
|
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|