Update to neofs-api v0.7.2

This commit is contained in:
Leonard Lyubich 2020-04-28 12:50:52 +03:00
parent 0cf8e19f36
commit e63d112cb2
13 changed files with 74 additions and 64 deletions

View file

@ -1,4 +1,4 @@
PROTO_VERSION=v0.7.1 PROTO_VERSION=v0.7.2
PROTO_URL=https://github.com/nspcc-dev/neofs-api/archive/$(PROTO_VERSION).tar.gz PROTO_URL=https://github.com/nspcc-dev/neofs-api/archive/$(PROTO_VERSION).tar.gz
B=\033[0;1m B=\033[0;1m

Binary file not shown.

View file

@ -5,7 +5,6 @@ option csharp_namespace = "NeoFS.API.Object";
import "refs/types.proto"; import "refs/types.proto";
import "object/types.proto"; import "object/types.proto";
import "session/types.proto";
import "service/meta.proto"; import "service/meta.proto";
import "service/verify.proto"; import "service/verify.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
@ -58,8 +57,6 @@ service Service {
message GetRequest { message GetRequest {
// Address of object (container id + object id) // Address of object (container id + object id)
refs.Address Address = 1 [(gogoproto.nullable) = false]; refs.Address Address = 1 [(gogoproto.nullable) = false];
// Raw is the request flag of a physically stored representation of an object
bool Raw = 2;
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; 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) // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
@ -82,10 +79,8 @@ message PutRequest {
message PutHeader { message PutHeader {
// Object with at least container id and owner id fields // Object with at least container id and owner id fields
Object Object = 1; Object Object = 1;
// Token with session public key and user's signature
session.Token Token = 2;
// Number of the object copies to store within the RPC call (zero is processed according to the placement rules) // Number of the object copies to store within the RPC call (zero is processed according to the placement rules)
uint32 CopiesNumber = 3; uint32 CopiesNumber = 2;
} }
oneof R { oneof R {
@ -112,8 +107,6 @@ message DeleteRequest {
refs.Address Address = 1 [(gogoproto.nullable) = false]; refs.Address Address = 1 [(gogoproto.nullable) = false];
// OwnerID is a wallet address // OwnerID is a wallet address
bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"]; bytes OwnerID = 2 [(gogoproto.nullable) = false, (gogoproto.customtype) = "OwnerID"];
// Token with session public key and user's signature
session.Token Token = 3;
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; 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) // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)
@ -132,8 +125,6 @@ message HeadRequest {
refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"]; refs.Address Address = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"];
// FullHeaders can be set true for extended headers in the object // FullHeaders can be set true for extended headers in the object
bool FullHeaders = 2; bool FullHeaders = 2;
// Raw is the request flag of a physically stored representation of an object
bool Raw = 3;
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; 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) // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request (should be embedded into message)

Binary file not shown.

View file

@ -4,7 +4,7 @@ option go_package = "github.com/nspcc-dev/neofs-api-go/object";
option csharp_namespace = "NeoFS.API.Object"; option csharp_namespace = "NeoFS.API.Object";
import "refs/types.proto"; import "refs/types.proto";
import "session/types.proto"; import "service/verify.proto";
import "storagegroup/types.proto"; import "storagegroup/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
@ -36,8 +36,8 @@ message Header {
Transform Transform = 4; Transform Transform = 4;
// Tombstone header that set up in deleted objects // Tombstone header that set up in deleted objects
Tombstone Tombstone = 5; Tombstone Tombstone = 5;
// Verify header that contains session public key and user's signature // Token header contains token of the session within which the object was created
session.VerificationHeader Verify = 6; service.Token Token = 6;
// HomoHash is a homomorphic hash of original object payload // HomoHash is a homomorphic hash of original object payload
bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"]; bytes HomoHash = 7 [(gogoproto.customtype) = "Hash"];
// PayloadChecksum of actual object's payload // PayloadChecksum of actual object's payload

Binary file not shown.

View file

@ -17,6 +17,8 @@ message RequestMetaHeader {
// Version defines protocol version // Version defines protocol version
// TODO: not used for now, should be implemented in future // TODO: not used for now, should be implemented in future
uint32 Version = 3; uint32 Version = 3;
// Raw determines whether the request is raw or not
bool Raw = 4;
} }
// ResponseMetaHeader contains meta information based on request processing by server // ResponseMetaHeader contains meta information based on request processing by server

Binary file not shown.

View file

@ -3,6 +3,7 @@ package service;
option go_package = "github.com/nspcc-dev/neofs-api-go/service"; option go_package = "github.com/nspcc-dev/neofs-api-go/service";
option csharp_namespace = "NeoFS.API.Service"; option csharp_namespace = "NeoFS.API.Service";
import "refs/types.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true; option (gogoproto.stable_marshaler_all) = true;
@ -10,22 +11,74 @@ option (gogoproto.stable_marshaler_all) = true;
// RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request // RequestVerificationHeader is a set of signatures of every NeoFS Node that processed request
// (should be embedded into message). // (should be embedded into message).
message RequestVerificationHeader { message RequestVerificationHeader {
message Sign { message Signature {
// Sign is signature of the request or session key. // Sign is signature of the request or session key.
bytes Sign = 1; bytes Sign = 1;
// Peer is compressed public key used for signature. // Peer is compressed public key used for signature.
bytes Peer = 2; bytes Peer = 2;
} }
message Signature {
// Sign is a signature and public key of the request.
Sign Sign = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// Origin used for requests, when trusted node changes it and re-sign with session key.
// If session key used for signature request, then Origin should contain
// public key of user and signed session key.
Sign Origin = 2;
}
// Signatures is a set of signatures of every passed NeoFS Node // Signatures is a set of signatures of every passed NeoFS Node
repeated Signature Signatures = 1; repeated Signature Signatures = 1;
// Token is a token of the session within which the request is sent
Token Token = 2;
} }
// User token granting rights for object manipulation
message Token {
message Info {
// ID is a token identifier. valid UUIDv4 represented in bytes
bytes ID = 1 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false];
// OwnerID is an owner of manipulation object
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// Verb is an enumeration of session request types
enum Verb {
// Put refers to object.Put RPC call
Put = 0;
// Get refers to object.Get RPC call
Get = 1;
// Head refers to object.Head RPC call
Head = 2;
// Search refers to object.Search RPC call
Search = 3;
// Delete refers to object.Delete RPC call
Delete = 4;
// Range refers to object.GetRange RPC call
Range = 5;
// RangeHash refers to object.GetRangeHash RPC call
RangeHash = 6;
}
// Verb is a type of request for which the token is issued
Verb verb = 3 [(gogoproto.customname) = "Verb"];
// Address is an object address for which token is issued
refs.Address Address = 4 [(gogoproto.nullable) = false, (gogoproto.customtype) = "Address"];
// Created is an initial epoch of token lifetime
uint64 Created = 5;
// ValidUntil is a last epoch of token lifetime
uint64 ValidUntil = 6;
// SessionKey is a public key of session key
bytes SessionKey = 7;
}
// TokenInfo is a grouped information about token
Info TokenInfo = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
// Signature is a signature of session token information
bytes Signature = 8;
}
// TODO: for variable token types and version redefine message
// Example:
// message Token {
// TokenType TokenType = 1;
// uint32 Version = 2;
// bytes Data = 3;
// }

Binary file not shown.

View file

@ -3,7 +3,6 @@ package session;
option go_package = "github.com/nspcc-dev/neofs-api-go/session"; option go_package = "github.com/nspcc-dev/neofs-api-go/session";
option csharp_namespace = "NeoFS.API.Session"; option csharp_namespace = "NeoFS.API.Session";
import "session/types.proto";
import "service/meta.proto"; import "service/meta.proto";
import "service/verify.proto"; import "service/verify.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto";
@ -33,9 +32,9 @@ message CreateRequest {
// owner of manipulation object; // owner of manipulation object;
// ID of manipulation object; // ID of manipulation object;
// token lifetime bounds. // token lifetime bounds.
session.Token Init = 1; service.Token Init = 1;
// Signed Init message response (Unsigned) from server with user private key // Signed Init message response (Unsigned) from server with user private key
session.Token Signed = 2; service.Token Signed = 2;
} }
// RequestMetaHeader contains information about request meta headers (should be embedded into message) // RequestMetaHeader contains information about request meta headers (should be embedded into message)
service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; service.RequestMetaHeader Meta = 98 [(gogoproto.embed) = true, (gogoproto.nullable) = false];
@ -46,8 +45,8 @@ message CreateRequest {
message CreateResponse { message CreateResponse {
oneof Message { oneof Message {
// Unsigned token with token ID and session public key generated on server side // Unsigned token with token ID and session public key generated on server side
session.Token Unsigned = 1; service.Token Unsigned = 1;
// Result is a resulting token which can be used for object placing through an trusted intermediary // Result is a resulting token which can be used for object placing through an trusted intermediary
session.Token Result = 2; service.Token Result = 2;
} }
} }

Binary file not shown.

View file

@ -1,35 +0,0 @@
syntax = "proto3";
package session;
option go_package = "github.com/nspcc-dev/neofs-api-go/session";
option csharp_namespace = "NeoFS.API.Session";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.stable_marshaler_all) = true;
message VerificationHeader {
// PublicKey is a session public key
bytes PublicKey = 1;
// KeySignature is a session public key signature. Signed by trusted side
bytes KeySignature = 2;
}
// User token granting rights for object manipulation
message Token {
// Header carries verification data of session key
VerificationHeader Header = 1 [(gogoproto.nullable) = false];
// OwnerID is an owner of manipulation object
bytes OwnerID = 2 [(gogoproto.customtype) = "OwnerID", (gogoproto.nullable) = false];
// FirstEpoch is an initial epoch of token lifetime
uint64 FirstEpoch = 3;
// LastEpoch is a last epoch of token lifetime
uint64 LastEpoch = 4;
// ObjectID is an object identifier of manipulation object
repeated bytes ObjectID = 5 [(gogoproto.customtype) = "ObjectID", (gogoproto.nullable) = false];
// Signature is a token signature, signed by owner of manipulation object
bytes Signature = 6;
// ID is a token identifier. valid UUIDv4 represented in bytes
bytes ID = 7 [(gogoproto.customtype) = "TokenID", (gogoproto.nullable) = false];
// PublicKeys associated with owner
repeated bytes PublicKeys = 8;
}