2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-04 21:10:51 +00:00
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
package neo.fs.v2.object;
|
2020-08-04 21:10:51 +00:00
|
|
|
|
2020-08-14 18:27:31 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/v2/object/grpc;object";
|
2020-08-12 21:43:51 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.v2.Object";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
|
|
|
import "refs/types.proto";
|
2020-08-18 11:13:16 +00:00
|
|
|
import "service/types.proto";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Type of the object payload content
|
|
|
|
enum ObjectType {
|
|
|
|
// Just a normal object
|
|
|
|
REGULAR = 0;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Used internally to identify deleted objects
|
|
|
|
TOMBSTONE = 1;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Identifies that the object holds StorageGroup information
|
|
|
|
STORAGE_GROUP = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-14 19:04:56 +00:00
|
|
|
// Type of match expression
|
|
|
|
enum MatchType {
|
|
|
|
// Unknown. Not used
|
|
|
|
MATCH_TYPE_UNSPECIFIED = 0;
|
|
|
|
// Full string match
|
|
|
|
STRING_EQUAL = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Short header fields
|
|
|
|
message ShortHeader {
|
|
|
|
// Object format version.
|
2020-08-18 13:14:25 +00:00
|
|
|
neo.fs.v2.refs.Version version = 1;
|
2020-08-14 19:04:56 +00:00
|
|
|
|
|
|
|
// Epoch when the object was created
|
|
|
|
uint64 creation_epoch = 2;
|
|
|
|
|
|
|
|
// Object's owner
|
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 3;
|
|
|
|
|
|
|
|
// Type of the object payload content
|
|
|
|
ObjectType object_type = 4;
|
|
|
|
|
|
|
|
// Size of payload in bytes.
|
|
|
|
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
|
|
|
|
uint64 payload_length = 5;
|
|
|
|
}
|
|
|
|
|
2020-08-12 21:43:51 +00:00
|
|
|
// Object Headers
|
2020-08-04 20:43:33 +00:00
|
|
|
message Header {
|
2020-08-14 19:44:32 +00:00
|
|
|
// Object format version.
|
|
|
|
// Effectively the version of API library used to create particular object
|
2020-08-18 13:14:25 +00:00
|
|
|
neo.fs.v2.refs.Version version = 1;
|
2020-08-14 19:44:32 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object's container
|
2020-08-14 19:44:32 +00:00
|
|
|
neo.fs.v2.refs.ContainerID container_id = 2;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object's owner
|
2020-08-14 19:44:32 +00:00
|
|
|
neo.fs.v2.refs.OwnerID owner_id = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-14 19:44:32 +00:00
|
|
|
// Object creation Epoch
|
|
|
|
uint64 creation_epoch = 4;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Size of payload in bytes.
|
|
|
|
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
|
|
|
|
uint64 payload_length = 5;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Hash of payload bytes
|
|
|
|
bytes payload_hash = 6;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
|
|
|
// Special object type
|
2020-08-11 10:54:58 +00:00
|
|
|
ObjectType object_type = 7;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Homomorphic hash of the object payload.
|
|
|
|
bytes homomorphic_hash = 8;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Session token, if it was used during Object creation.
|
|
|
|
// Need it to verify integrity and authenticity out of Request scope.
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.service.SessionToken session_token = 9;
|
2020-08-11 10:54:58 +00:00
|
|
|
|
|
|
|
// Attribute groups the user-defined Key-Value pairs attached to the object
|
|
|
|
message Attribute {
|
|
|
|
// string key to the object attribute
|
|
|
|
string key = 1;
|
|
|
|
// string value of the object attribute
|
|
|
|
string value = 2;
|
2020-08-11 09:03:50 +00:00
|
|
|
}
|
2020-08-12 21:43:51 +00:00
|
|
|
// User-defined object attributes
|
2020-08-11 10:54:58 +00:00
|
|
|
repeated Attribute attributes = 10;
|
|
|
|
|
|
|
|
// Information about spawning the objects through a payload splitting.
|
|
|
|
message Split {
|
|
|
|
// Identifier of the origin object.
|
|
|
|
// Parent and children objects must be within the same container.
|
|
|
|
// Parent object_id is known only to the minor child.
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.ObjectID parent = 1;
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Previous carries identifier of the left split neighbor.
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.ObjectID previous = 2;
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// `signature` field of the parent object. Used to reconstruct parent.
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.service.Signature parent_signature = 3;
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// `header` field of the parent object. Used to reconstruct parent.
|
|
|
|
Header parent_header = 4;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Children carries list of identifiers of the objects generated by splitting the current.
|
2020-08-12 21:43:51 +00:00
|
|
|
repeated neo.fs.v2.refs.ObjectID children = 5;
|
2020-08-11 09:03:50 +00:00
|
|
|
}
|
2020-08-11 10:54:58 +00:00
|
|
|
// Position of the object in the split hierarchy.
|
|
|
|
Split split = 11;
|
2020-08-04 10:18:38 +00:00
|
|
|
}
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object structure.
|
2020-08-04 10:18:38 +00:00
|
|
|
message Object {
|
2020-08-11 10:54:58 +00:00
|
|
|
// 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
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.refs.ObjectID object_id = 1;
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Signed object_id
|
2020-08-12 21:43:51 +00:00
|
|
|
neo.fs.v2.service.Signature signature = 2;
|
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object metadata headers
|
|
|
|
Header header = 3;
|
2020-08-12 21:43:51 +00:00
|
|
|
|
2020-08-11 10:54:58 +00:00
|
|
|
// Payload bytes.
|
|
|
|
bytes payload = 4;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|