2020-01-30 11:41:24 +00:00
|
|
|
syntax = "proto3";
|
2020-08-04 21:10:51 +00:00
|
|
|
|
2020-01-30 11:41:24 +00:00
|
|
|
package object;
|
2020-08-04 21:10:51 +00:00
|
|
|
|
2020-03-31 06:58:22 +00:00
|
|
|
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
|
2020-02-05 12:14:39 +00:00
|
|
|
option csharp_namespace = "NeoFS.API.Object";
|
2020-01-30 11:41:24 +00:00
|
|
|
|
|
|
|
import "refs/types.proto";
|
2020-08-11 10:54:58 +00:00
|
|
|
import "service/meta.proto";
|
2020-04-24 16:18:28 +00:00
|
|
|
import "service/verify.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;
|
|
|
|
// Used internally to identify deleted objects
|
|
|
|
TOMBSTONE = 1;
|
|
|
|
// Identifies that the object holds StorageGroup information
|
|
|
|
STORAGE_GROUP = 2;
|
|
|
|
}
|
|
|
|
|
2020-08-04 20:43:33 +00:00
|
|
|
message Header {
|
2020-08-11 10:54:58 +00:00
|
|
|
// Object's container
|
|
|
|
refs.ContainerID container_id = 1;
|
|
|
|
// Object's owner
|
|
|
|
refs.OwnerID owner_id = 2;
|
|
|
|
// Epoch when the object was created
|
|
|
|
uint64 creation_epoch = 3;
|
|
|
|
// Object format version.
|
|
|
|
// Effectively the version of API library used to create particular object
|
|
|
|
service.Version version = 4;
|
|
|
|
// Size of payload in bytes.
|
|
|
|
// 0xFFFFFFFFFFFFFFFF means `payload_length` is unknown
|
|
|
|
uint64 payload_length = 5;
|
|
|
|
// Hash of payload bytes
|
|
|
|
bytes payload_hash = 6;
|
|
|
|
ObjectType object_type = 7;
|
|
|
|
// Homomorphic hash of the object payload.
|
|
|
|
bytes homomorphic_hash = 8;
|
|
|
|
// Session token, if it was used during Object creation.
|
|
|
|
// Need it to verify integrity and authenticity out of Request scope.
|
|
|
|
service.SessionToken session_token = 9;
|
|
|
|
|
|
|
|
// 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-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.
|
|
|
|
refs.ObjectID parent = 1;
|
|
|
|
// Previous carries identifier of the left split neighbor.
|
|
|
|
refs.ObjectID previous = 2;
|
|
|
|
// `signature` field of the parent object. Used to reconstruct parent.
|
|
|
|
service.Signature parent_signature = 3;
|
|
|
|
// `header` field of the parent object. Used to reconstruct parent.
|
|
|
|
Header parent_header = 4;
|
|
|
|
// Children carries list of identifiers of the objects generated by splitting the current.
|
|
|
|
repeated 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
|
|
|
|
refs.ObjectID object_id = 1;
|
|
|
|
// Signed object_id
|
|
|
|
service.Signature signature = 2;
|
|
|
|
// Object metadata headers
|
|
|
|
Header header = 3;
|
|
|
|
// Payload bytes.
|
|
|
|
bytes payload = 4;
|
2020-01-30 11:41:24 +00:00
|
|
|
}
|