[#73] Add JSON field names to object package

Signed-off-by: Stanislav Bogatyrev <stanislav@nspcc.ru>
This commit is contained in:
Stanislav Bogatyrev 2020-10-19 11:27:05 +03:00 committed by Stanislav Bogatyrev
parent 6ea8bc3214
commit a1d9527f34
2 changed files with 17 additions and 16 deletions

View file

@ -254,10 +254,10 @@ message HeadRequest {
// 3. Check if `ObjectID` signature in `signature` field is correct // 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 [json_name = "header"];
// Signed `ObjectID` to verify full header's authenticity // Signed `ObjectID` to verify full header's authenticity
neo.fs.v2.refs.Signature signature = 2; neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"];
} }
// Object HEAD response // Object HEAD response

View file

@ -24,6 +24,7 @@ enum ObjectType {
enum MatchType { enum MatchType {
// Unknown. Not used // Unknown. Not used
MATCH_TYPE_UNSPECIFIED = 0; MATCH_TYPE_UNSPECIFIED = 0;
// Full string match // Full string match
STRING_EQUAL = 1; STRING_EQUAL = 1;
} }
@ -38,14 +39,14 @@ message ShortHeader {
uint64 creation_epoch = 2 [json_name = "creationEpoch"]; uint64 creation_epoch = 2 [json_name = "creationEpoch"];
// Object's owner // Object's owner
neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "owner"]; neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"];
// Type of the object payload content // Type of the object payload content
ObjectType object_type = 4 [json_name = "type"]; ObjectType object_type = 4 [json_name = "objectType"];
// 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 [json_name = "payloadSize"]; uint64 payload_length = 5 [json_name = "payloadLength"];
} }
// Object Header // Object Header
@ -55,30 +56,30 @@ message Header {
neo.fs.v2.refs.Version version = 1 [json_name = "version"]; neo.fs.v2.refs.Version version = 1 [json_name = "version"];
// Object's container // Object's container
neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "container"]; neo.fs.v2.refs.ContainerID container_id = 2 [json_name = "containerID"];
// Object's owner // Object's owner
neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "owner"]; neo.fs.v2.refs.OwnerID owner_id = 3 [json_name = "ownerID"];
// Object creation Epoch // Object creation Epoch
uint64 creation_epoch = 4 [json_name = "creationEpoch"]; uint64 creation_epoch = 4 [json_name = "creationEpoch"];
// 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 [json_name = "payloadSize"]; uint64 payload_length = 5 [json_name = "payloadLength"];
// Hash of payload bytes // Hash of payload bytes
neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"]; neo.fs.v2.refs.Checksum payload_hash = 6 [json_name = "payloadHash"];
// Type of the object payload content // Type of the object payload content
ObjectType object_type = 7 [json_name = "type"]; ObjectType object_type = 7 [json_name = "objectType"];
// Homomorphic hash of the object payload. // Homomorphic hash of the object payload.
neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homoHash"]; neo.fs.v2.refs.Checksum homomorphic_hash = 8 [json_name = "homomorphicHash"];
// Session token, if it was used during Object creation. Need it to verify // Session token, if it was used during Object creation. 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 [json_name = "token"]; neo.fs.v2.session.SessionToken session_token = 9 [json_name = "sessionToken"];
// `Attribute` is a user-defined Key-Value metadata pair attached to the // `Attribute` is a user-defined Key-Value metadata pair attached to the
// object. // object.
@ -115,13 +116,13 @@ message Header {
neo.fs.v2.refs.Signature parent_signature = 3[json_name = "parentSignature"]; neo.fs.v2.refs.Signature parent_signature = 3[json_name = "parentSignature"];
// `header` field of the parent object. Used to reconstruct parent. // `header` field of the parent object. Used to reconstruct parent.
Header parent_header = 4 [json_name = "header"]; Header parent_header = 4 [json_name = "parentHeader"];
// List of identifiers of the objects generated by splitting current one. // List of identifiers of the objects generated by splitting current one.
repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"]; repeated neo.fs.v2.refs.ObjectID children = 5 [json_name = "children"];
} }
// Position of the object in the split hierarchy // Position of the object in the split hierarchy
Split split = 11 [json_name = "Split"]; Split split = 11 [json_name = "split"];
} }
// Object structure. Object is immutable and content-addressed. It means // Object structure. Object is immutable and content-addressed. It means
@ -129,7 +130,7 @@ message Header {
// hash of header field, which contains hash of object's payload. // hash of header field, which contains hash of object's payload.
message Object { message Object {
// Object's unique identifier. // Object's unique identifier.
neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "id"]; neo.fs.v2.refs.ObjectID object_id = 1 [json_name = "objectID"];
// Signed object_id // Signed object_id
neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"]; neo.fs.v2.refs.Signature signature = 2 [json_name = "signature"];