2019-11-18 13:34:06 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package session;
|
2020-01-30 13:32:50 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api/session";
|
2020-02-05 13:58:06 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.Session";
|
2019-11-18 13:34:06 +00:00
|
|
|
|
|
|
|
import "session/types.proto";
|
2019-11-18 16:22:08 +00:00
|
|
|
import "service/meta.proto";
|
|
|
|
import "service/verify.proto";
|
2019-11-18 13:34:06 +00:00
|
|
|
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
|
|
|
|
|
|
|
|
option (gogoproto.stable_marshaler_all) = true;
|
|
|
|
|
2019-11-20 16:46:30 +00:00
|
|
|
|
2019-11-18 13:34:06 +00:00
|
|
|
service Session {
|
2019-11-21 07:26:01 +00:00
|
|
|
// Create is a method that used to open a trusted session to manipulate
|
|
|
|
// an object. In order to put or delete object client have to obtain session
|
|
|
|
// token with trusted node. Trusted node will modify client's object
|
|
|
|
// (add missing headers, checksums, homomorphic hash) and sign id with
|
|
|
|
// session key. Session is established during 4-step handshake in one gRPC stream
|
|
|
|
//
|
2019-11-20 16:46:30 +00:00
|
|
|
// - First client stream message SHOULD BE type of `CreateRequest_Init`.
|
|
|
|
// - First server stream message SHOULD BE type of `CreateResponse_Unsigned`.
|
|
|
|
// - Second client stream message SHOULD BE type of `CreateRequest_Signed`.
|
|
|
|
// - Second server stream message SHOULD BE type of `CreateResponse_Result`.
|
2019-11-18 13:34:06 +00:00
|
|
|
rpc Create (stream CreateRequest) returns (stream CreateResponse);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
message CreateRequest {
|
2019-11-20 16:46:30 +00:00
|
|
|
// Message should be one of
|
2019-11-18 13:34:06 +00:00
|
|
|
oneof Message {
|
2019-11-21 07:26:01 +00:00
|
|
|
// Init is a message to initialize session opening. Carry:
|
2019-11-20 16:46:30 +00:00
|
|
|
// owner of manipulation object;
|
|
|
|
// ID of manipulation object;
|
|
|
|
// token lifetime bounds.
|
2019-11-18 13:34:06 +00:00
|
|
|
session.Token Init = 1;
|
2019-11-20 16:46:30 +00:00
|
|
|
// Signed Init message response (Unsigned) from server with user private key
|
2019-11-18 13:34:06 +00:00
|
|
|
session.Token Signed = 2;
|
|
|
|
}
|
2019-11-21 12:27:17 +00:00
|
|
|
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
|
2019-11-18 16:22:08 +00:00
|
|
|
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
2019-11-21 12:27:17 +00:00
|
|
|
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
|
2019-11-18 16:22:08 +00:00
|
|
|
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
|
2019-11-18 13:34:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message CreateResponse {
|
|
|
|
oneof Message {
|
2019-11-20 16:46:30 +00:00
|
|
|
// Unsigned token with token ID and session public key generated on server side
|
2019-11-18 13:34:06 +00:00
|
|
|
session.Token Unsigned = 1;
|
2019-11-21 07:26:01 +00:00
|
|
|
// Result is a resulting token which can be used for object placing through an trusted intermediary
|
2019-11-18 13:34:06 +00:00
|
|
|
session.Token Result = 2;
|
|
|
|
}
|
|
|
|
}
|