Update object package docs

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-10-15 21:28:19 +03:00 committed by Stanislav Bogatyrev
parent 3f6c211fef
commit 27f4b1ad63
2 changed files with 177 additions and 161 deletions

View file

@ -9,93 +9,98 @@ import "object/types.proto";
import "refs/types.proto"; import "refs/types.proto";
import "session/types.proto"; import "session/types.proto";
// Object service provides API for manipulating with the object. // `ObjectService` provides API for manipulating objects. Object operations do
// not interact with sidechain and are only served by nodes in p2p style.
service ObjectService { service ObjectService {
// Get the object from container. Response uses gRPC stream. First response // Receive full object structure, including Headers and payload. Response uses
// message carry object of requested address. Chunk messages are parts of // gRPC stream. First response message carries object with requested address.
// the object's payload if it is needed. All messages except first carry // Chunk messages are parts of the object's payload if it is needed. All
// chunks. Requested object can be restored by concatenation of object // messages, except the first one, carry payload chunks. Requested object can
// message payload and all chunks keeping receiving order. // be restored by concatenation of object message payload and all chunks
// keeping receiving order.
rpc Get(GetRequest) returns (stream GetResponse); rpc Get(GetRequest) returns (stream GetResponse);
// Put the object into container. Request uses gRPC stream. First message // Put the object into container. Request uses gRPC stream. First message
// SHOULD BE type of PutHeader. Container id and Owner id of object SHOULD // SHOULD be of PutHeader type. `ContainerID` and `OwnerID` of an object
// BE set. Session token SHOULD BE obtained before put operation (see // SHOULD be set. Session token SHOULD be obtained before `PUT` operation (see
// session package). Chunk messages considered by server as part of object // session package). Chunk messages are considered by server as a part of an
// payload. All messages except first SHOULD BE chunks. Chunk messages // object payload. All messages, except first one, SHOULD be payload chunks.
// SHOULD BE sent in direct order of fragmentation. // Chunk messages SHOULD be sent in direct order of fragmentation.
rpc Put(stream PutRequest) returns (PutResponse); rpc Put(stream PutRequest) returns (PutResponse);
// Delete the object from a container // Delete the object from a container. There is no immediate removal
// guarantee. Object will be marked for removal and deleted eventually.
rpc Delete(DeleteRequest) returns (DeleteResponse); rpc Delete(DeleteRequest) returns (DeleteResponse);
// Head returns the object without data payload. Object in the // Returns the object Headers without data payload. By default full header is
// response has system header only. If full headers flag is set, extended // returned. If `main_only` request field is set, the short header with only
// headers are also present. // the very minimal information would be returned instead.
rpc Head(HeadRequest) returns (HeadResponse); rpc Head(HeadRequest) returns (HeadResponse);
// Search objects in container. Version of query language format SHOULD BE // Search objects in container. Search query allows to match by Object
// set to 1. Search query represented in serialized format (see query // Header's filed values. Please see the corresponding NeoFS Technical
// package). // Specification section for more details.
rpc Search(SearchRequest) returns (stream SearchResponse); rpc Search(SearchRequest) returns (stream SearchResponse);
// GetRange of data payload. Range is a pair (offset, length). // Get byte range of data payload. Range is set as an (offset, length) tuple.
// Requested range can be restored by concatenation of all chunks // Like in `Get` method, the response uses gRPC stream. Requested range can be
// keeping receiving order. // restored by concatenation of all received payload chunks keeping receiving
// order.
rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse); rpc GetRange(GetRangeRequest) returns (stream GetRangeResponse);
// GetRangeHash returns homomorphic hash of object payload range after XOR // Returns homomorphic or regular hash of object's payload range after
// operation. Ranges are set of pairs (offset, length). Hashes order in // applying XOR operation with the provided `salt`. Ranges are set of (offset,
// response corresponds to ranges order in request. Homomorphic hash is // length) tuples. Hashes order in response corresponds to ranges order in
// calculated for XORed data. // request. Note that hash is calculated for XORed data.
rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse); rpc GetRangeHash(GetRangeHashRequest) returns (GetRangeHashResponse);
} }
// Get object request // GET object request
message GetRequest { message GetRequest {
// Request body // GET Object request body
message Body { message Body {
// Address of the requested object. // Address of the requested object
neo.fs.v2.refs.Address address = 1; neo.fs.v2.refs.Address address = 1;
// Carries the raw option flag of the request. // If `raw` flag is set, request will work only with objects that are
// Raw request is sent to receive only the objects // physically stored on the peer node
// that are physically stored on the server.
bool raw = 2; bool raw = 2;
} }
// Body of get object request message. // Body of get object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// get object response // GET object response
message GetResponse { message GetResponse {
// Response body // GET Object Response body
message Body { message Body {
// Initialization parameters of the object got from NeoFS. // Initial part of the `Object` structure stream. Technically it's a
// set of all `Object` structure's fields except `payload`.
message Init { message Init {
// Object ID // Object's unique identifier.
neo.fs.v2.refs.ObjectID object_id = 1; neo.fs.v2.refs.ObjectID object_id = 1;
// Object signature // Signed `ObjectID`
neo.fs.v2.refs.Signature signature = 2; neo.fs.v2.refs.Signature signature = 2;
// Object header. // Object metadata headers
Header header = 3; Header header = 3;
} }
// Carries the single message of the response stream. // Single message in the response stream.
oneof object_part { oneof object_part {
// Initialization parameters of the object stream. // Initial part of the object stream
Init init = 1; Init init = 1;
// Part of the object payload. // Chunked object payload
bytes chunk = 2; bytes chunk = 2;
} }
} }
@ -107,58 +112,58 @@ message GetResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }
// Put object request // PUT object request
message PutRequest { message PutRequest {
// Request body // PUT request body
message Body { message Body {
// Groups initialization parameters of object placement in NeoFS. // Newly created object structure parameters. If some optional parameters
// are not set, they will be calculated by a peer node.
message Init { message Init {
// Object ID, where available // ObjectID if available.
neo.fs.v2.refs.ObjectID object_id = 1; neo.fs.v2.refs.ObjectID object_id = 1;
// Object signature, were available // Object signature if available
neo.fs.v2.refs.Signature signature = 2; neo.fs.v2.refs.Signature signature = 2;
// Header of the object to save in the system. // Object's Header
Header header = 3; Header header = 3;
// Number of the object copies to store within the RPC call. // Number of the object copies to store within the RPC call. By default
// Default zero value is processed according to the // object is processed according to the container's placement policy.
// container placement rules.
uint32 copies_number = 4; uint32 copies_number = 4;
} }
// Carries the single part of the query stream. // Single message in the request stream.
oneof object_part { oneof object_part {
// Carries the initialization parameters of the object stream. // Initial part of the object stream
Init init = 1; Init init = 1;
// Carries part of the object payload. // Chunked object payload
bytes chunk = 2; bytes chunk = 2;
} }
} }
// Body of put object request message. // Body of put object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// Put object response // PUT Object response
message PutResponse { message PutResponse {
// Response body // PUT Object response body
message Body { message Body {
// Carries identifier of the saved object. // Identifier of the saved object
// It is used to access an object in the container.
neo.fs.v2.refs.ObjectID object_id = 1; neo.fs.v2.refs.ObjectID object_id = 1;
} }
// Body of put object response message. // Body of put object response message.
@ -169,34 +174,35 @@ message PutResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }
// Object Delete request // Object DELETE request
message DeleteRequest { message DeleteRequest {
// Request body // Object DELETE request body
message Body { message Body {
// Carries the address of the object to be deleted. // Address of the object to be deleted
neo.fs.v2.refs.Address address = 1; neo.fs.v2.refs.Address address = 1;
} }
// Body of delete object request message. // Body of delete object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// DeleteResponse is empty because we cannot guarantee permanent object removal // DeleteResponse body is empty because we cannot guarantee permanent object
// in distributed system. // removal in distributed system.
message DeleteResponse { message DeleteResponse {
// Response body // Object DELETE Response has an empty body.
message Body { } message Body { }
// Body of delete object response message. // Body of delete object response message.
@ -207,57 +213,60 @@ message DeleteResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }
// Object head request // Object HEAD request
message HeadRequest { message HeadRequest {
// Request body // Object HEAD request body
message Body { message Body {
// Address of the object with the requested header. // Address of the object with the requested Header
neo.fs.v2.refs.Address address = 1; neo.fs.v2.refs.Address address = 1;
// Return only minimal header subset // Return only minimal header subset
bool main_only = 2; bool main_only = 2;
// Carries the raw option flag of the request. // If `raw` flag is set, request will work only with objects that are
// Raw request is sent to receive only the headers of the objects // physically stored on the peer node
// that are physically stored on the server.
bool raw = 3; bool raw = 3;
} }
// Body of head object request message. // Body of head object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// Tuple of full object header and signature of object ID. // Tuple of full object header and signature of `ObjectID`. \
// Signed `ObjectID` is present to verify full header's authenticity through the
// following steps:
//
// 1. Calculate `SHA-256` of marshalled `Header` structure
// 2. Check if the resulting hash matched `ObjectID`
// 3. Check if `ObjectID` signature in `signature` field is correct
message HeaderWithSignature { message HeaderWithSignature {
// Full object header // Full object header
Header header = 1; Header header = 1;
// Signed object_id to verify full header's authenticity through following steps: // Signed `ObjectID` to verify full header's authenticity
// 1. Calculate SHA-256 of marshalled Headers structure.
// 2. Check if the resulting hash matched ObjectID
// 3. Check if ObjectID's signature in signature field is correct.
neo.fs.v2.refs.Signature signature = 2; neo.fs.v2.refs.Signature signature = 2;
} }
// Head response // Object HEAD response
message HeadResponse { message HeadResponse {
// Response body // Object HEAD response body
message Body { message Body {
// Carries the requested object header or it's part // Requested object header or it's part.
oneof head{ oneof head{
// Full object header with object ID signature // Full object's `Header` with `ObjectID` signature
HeaderWithSignature header = 1; HeaderWithSignature header = 1;
// Short object header // Short object header
@ -272,16 +281,16 @@ message HeadResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }
// Search objects request // Object Search request
message SearchRequest { message SearchRequest {
// Request body // Object Search request body
message Body { message Body {
// Carries search container identifier. // Container identifier were to search
neo.fs.v2.refs.ContainerID container_id = 1; neo.fs.v2.refs.ContainerID container_id = 1;
// Version of the Query Language used // Version of the Query Language used
@ -303,20 +312,21 @@ message SearchRequest {
// Body of search object request message. // Body of search object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// Search response // Search response
message SearchResponse { message SearchResponse {
// Response body // Object Search response body
message Body { message Body {
// Carries list of object identifiers that match the search query // List of `ObjectID`s that match the search query
repeated neo.fs.v2.refs.ObjectID id_list = 1; repeated neo.fs.v2.refs.ObjectID id_list = 1;
} }
// Body of search object response message. // Body of search object response message.
@ -327,48 +337,52 @@ message SearchResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }
// Range groups the parameters of object payload range. // Object payload range.Ranges of zero length SHOULD be considered as invalid.
message Range { message Range {
// Carries the offset of the range from the object payload start. // Offset of the range from the object payload start
uint64 offset = 1; uint64 offset = 1;
// Carries the length of the object payload range. // Length in bytes of the object payload range
uint64 length = 2; uint64 length = 2;
} }
// Request to get part of object's payload // Request part of object's payload
message GetRangeRequest { message GetRangeRequest {
// Request Body // Byte range of object's payload request body
message Body { message Body {
// Address carries address of the object that contains the requested payload range. // Address of the object containing the requested payload range
neo.fs.v2.refs.Address address = 1; neo.fs.v2.refs.Address address = 1;
// Range carries the parameters of the requested payload range. // Requested payload range
Range range = 2; Range range = 2;
} }
// Body of get range object request message. // Body of get range object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// Get part of object's payload // Get part of object's payload
message GetRangeResponse { message GetRangeResponse {
// Response body // Get Range response body uses streams to transfer the response. Because
// object payload considered a byte sequence, there is no need to have some
// initial preamble message. The requested byte range is sent as a series
// chunks.
message Body { message Body {
// Carries part of the object payload. // Chunked object payload's range
bytes chunk = 1; bytes chunk = 1;
} }
@ -380,22 +394,22 @@ message GetRangeResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }
// Get hash of object's payload part // Get hash of object's payload part
message GetRangeHashRequest { message GetRangeHashRequest {
// Request body // Get hash of object's payload part request body.
message Body { message Body {
// Carries address of the object that contains the requested payload range. // Address of the object that containing the requested payload range
neo.fs.v2.refs.Address address = 1; neo.fs.v2.refs.Address address = 1;
// Carries the list of object payload range to calculate homomorphic hash. // List of object's payload ranges to calculate homomorphic hash
repeated Range ranges = 2; repeated Range ranges = 2;
// Carries binary salt to XOR object payload ranges before hash calculation. // Binary salt to XOR object's payload ranges before hash calculation
bytes salt = 3; bytes salt = 3;
// Checksum algorithm type // Checksum algorithm type
@ -404,23 +418,24 @@ message GetRangeHashRequest {
// Body of get range hash object request message. // Body of get range hash object request message.
Body body = 1; Body body = 1;
// Carries request meta information. Header data is used only to regulate message // Carries request meta information. Header data is used only to regulate
// transport and does not affect request execution. // message transport and does not affect request execution.
neo.fs.v2.session.RequestMetaHeader meta_header = 2; neo.fs.v2.session.RequestMetaHeader meta_header = 2;
// Carries request verification information. This header is used to authenticate // Carries request verification information. This header is used to
// the nodes of the message route and check the correctness of transmission. // authenticate the nodes of the message route and check the correctness of
// transmission.
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// Get hash of object's payload part // Get hash of object's payload part
message GetRangeHashResponse { message GetRangeHashResponse {
// Response body // Get hash of object's payload part response body.
message Body { message Body {
// Checksum algorithm type // Checksum algorithm type
neo.fs.v2.refs.ChecksumType type = 1; neo.fs.v2.refs.ChecksumType type = 1;
// List of range hashes in a binary format. // List of range hashes in a binary format
repeated bytes hash_list = 2; repeated bytes hash_list = 2;
} }
// Body of get range hash object response message. // Body of get range hash object response message.
@ -431,7 +446,7 @@ message GetRangeHashResponse {
neo.fs.v2.session.ResponseMetaHeader meta_header = 2; neo.fs.v2.session.ResponseMetaHeader meta_header = 2;
// Carries response verification information. This header is used to // Carries response verification information. This header is used to
// authenticate the nodes of the message route and check the correctness // authenticate the nodes of the message route and check the correctness of
// of transmission. // transmission.
neo.fs.v2.session.ResponseVerificationHeader verify_header = 3; neo.fs.v2.session.ResponseVerificationHeader verify_header = 3;
} }

View file

@ -8,7 +8,7 @@ option csharp_namespace = "NeoFS.API.v2.Object";
import "refs/types.proto"; import "refs/types.proto";
import "session/types.proto"; import "session/types.proto";
// Type of the object payload content // Type of the object payload content.
enum ObjectType { enum ObjectType {
// Just a normal object // Just a normal object
REGULAR = 0; REGULAR = 0;
@ -16,7 +16,7 @@ enum ObjectType {
// Used internally to identify deleted objects // Used internally to identify deleted objects
TOMBSTONE = 1; TOMBSTONE = 1;
// Identifies that the object holds StorageGroup information // StorageGroup information
STORAGE_GROUP = 2; STORAGE_GROUP = 2;
} }
@ -30,7 +30,8 @@ enum MatchType {
// Short header fields // Short header fields
message ShortHeader { message ShortHeader {
// Object format version. // Object format version. Effectively the version of API library used to
// create particular object
neo.fs.v2.refs.Version version = 1; neo.fs.v2.refs.Version version = 1;
// Epoch when the object was created // Epoch when the object was created
@ -43,14 +44,14 @@ message ShortHeader {
ObjectType object_type = 4; ObjectType object_type = 4;
// Size of payload in bytes. // Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown
uint64 payload_length = 5; uint64 payload_length = 5;
} }
// Object Headers // Object Header
message Header { message Header {
// Object format version. // Object format version. Effectively the version of API library used to
// Effectively the version of API library used to create particular object // create particular object
neo.fs.v2.refs.Version version = 1; neo.fs.v2.refs.Version version = 1;
// Object's container // Object's container
@ -63,20 +64,20 @@ message Header {
uint64 creation_epoch = 4; uint64 creation_epoch = 4;
// Size of payload in bytes. // Size of payload in bytes.
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown // `0xFFFFFFFFFFFFFFFF` means `payload_length` is unknown
uint64 payload_length = 5; uint64 payload_length = 5;
// Hash of payload bytes // Hash of payload bytes
neo.fs.v2.refs.Checksum payload_hash = 6; neo.fs.v2.refs.Checksum payload_hash = 6;
// Special object type // Type of the object payload content
ObjectType object_type = 7; ObjectType object_type = 7;
// Homomorphic hash of the object payload. // Homomorphic hash of the object payload.
neo.fs.v2.refs.Checksum homomorphic_hash = 8; neo.fs.v2.refs.Checksum homomorphic_hash = 8;
// Session token, if it was used during Object creation. // Session token, if it was used during Object creation. Need it to verify
// Need it to verify integrity and authenticity out of Request scope. // integrity and authenticity out of Request scope.
neo.fs.v2.session.SessionToken session_token = 9; neo.fs.v2.session.SessionToken session_token = 9;
// `Attribute` is a user-defined Key-Value metadata pair attached to the // `Attribute` is a user-defined Key-Value metadata pair attached to the
@ -99,14 +100,15 @@ message Header {
// User-defined object attributes // User-defined object attributes
repeated Attribute attributes = 10; repeated Attribute attributes = 10;
// Information about spawning the objects through a payload splitting. // Bigger objects can be split into a chain of smaller objects. Information
// about inter-dependencies between spawned objects and how to re-construct
// the original one is in the `Split` headers. Parent and children objects
// must be within the same container.
message Split { message Split {
// Identifier of the origin object. // Identifier of the origin object. Known only to the minor child.
// Parent and children objects must be within the same container.
// Parent object_id is known only to the minor child.
neo.fs.v2.refs.ObjectID parent = 1; neo.fs.v2.refs.ObjectID parent = 1;
// Previous carries identifier of the left split neighbor. // Identifier of the left split neighbor
neo.fs.v2.refs.ObjectID previous = 2; neo.fs.v2.refs.ObjectID previous = 2;
// `signature` field of the parent object. Used to reconstruct parent. // `signature` field of the parent object. Used to reconstruct parent.
@ -115,19 +117,18 @@ message Header {
// `header` field of the parent object. Used to reconstruct parent. // `header` field of the parent object. Used to reconstruct parent.
Header parent_header = 4; Header parent_header = 4;
// Children carries list of identifiers of the objects generated by splitting the current. // List of identifiers of the objects generated by splitting current one.
repeated neo.fs.v2.refs.ObjectID children = 5; repeated neo.fs.v2.refs.ObjectID children = 5;
} }
// Position of the object in the split hierarchy. // Position of the object in the split hierarchy
Split split = 11; Split split = 11;
} }
// Object structure. // Object structure. Object is immutable and content-addressed. It means
// `ObjectID` will change if header or payload changes. It's calculated as a
// hash of header field, which contains hash of object's payload.
message Object { message Object {
// Object's unique identifier. // Object's unique identifier.
// Object is content-addressed. It means id will change if header or payload
// changes. It's calculated as a hash of header field, which contains hash of
// object's payload
neo.fs.v2.refs.ObjectID object_id = 1; neo.fs.v2.refs.ObjectID object_id = 1;
// Signed object_id // Signed object_id