frostfs-api/session/service.proto
Leonard Lyubich 6b68940643 token: update structure
This commit:

  * moves Token message to service package;

  * updates token structure (new verb field, some renaming);

  * replaces VerificationHeader header with Token in object package;

  * removes no longer used VerificationHeader message.
2020-04-27 10:59:44 +03:00

52 lines
2.3 KiB
Protocol Buffer

syntax = "proto3";
package session;
option go_package = "github.com/nspcc-dev/neofs-api-go/session";
option csharp_namespace = "NeoFS.API.Session";
import "service/meta.proto";
import "service/verify.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
service Session {
// 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
//
// - 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`.
rpc Create (stream CreateRequest) returns (stream CreateResponse);
}
message CreateRequest {
// Message should be one of
oneof Message {
// Init is a message to initialize session opening. Carry:
// owner of manipulation object;
// ID of manipulation object;
// token lifetime bounds.
service.Token Init = 1;
// Signed Init message response (Unsigned) from server with user private key
service.Token Signed = 2;
}
// RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
service.RequestVerificationHeader Verify = 99 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
}
message CreateResponse {
oneof Message {
// Unsigned token with token ID and session public key generated on server side
service.Token Unsigned = 1;
// Result is a resulting token which can be used for object placing through an trusted intermediary
service.Token Result = 2;
}
}