frostfs-api/object/types.proto
Leonard Lyubich fb2064803e [#26] object: Replace PayloadChecksum to Integrity
This commit replaces PayloadChecksum field from ExtendedHeader to
IntegrityHeader for assembling all verification data in one structure.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-08-06 21:59:42 +03:00

101 lines
3.6 KiB
Protocol Buffer

syntax = "proto3";
package object;
option go_package = "github.com/nspcc-dev/neofs-api-go/object";
option csharp_namespace = "NeoFS.API.Object";
import "refs/types.proto";
import "service/verify.proto";
import "storagegroup/types.proto";
// Attribute groups the parameters of the object attributes.
message Attribute {
// Key carries the string key to the object attribute.
string Key = 1;
// Value carries the string value of the object attribute.
string Value = 2;
}
message ExtendedHeader {
// Attribute is a set of K-V object attributes
Attribute Attribute = 3;
// Split carries the position of the object in the split hierarchy.
SplitHeader SplitHeader = 4;
// Tombstone header that set up in deleted objects
Tombstone Tombstone = 5;
// Token header contains token of the session within which the object was created
service.Token Token = 6;
// HomoHash is a homomorphic hash of original object payload
bytes HomoHash = 7;
// Integrity header with checksum of all above headers in the object
IntegrityHeader Integrity = 9;
// StorageGroup contains meta information for the data audit
storagegroup.StorageGroup StorageGroup = 10;
}
message Tombstone {}
message SystemHeader {
// PayloadLength is an object payload length
uint64 PayloadLength = 1;
// Address carries object address in the NeoFS system.
// It encapsulates the object and the container identifiers.
refs.Address Address = 2;
// OwnerID is a wallet address
bytes OwnerID = 3;
// CreationEpoch carries number of NeoFS epoch on which the object was created.
uint64 CreationEpoch = 4;
}
message IntegrityHeader {
// PayloadChecksum carries the checksum of object payload bytes.
// Changing any byte of the payload changes the checksum.
// It is calculated as a SHA-256 hash over payload bytes.
bytes PayloadChecksum = 1;
// HeaderChecksum carries checksum of the object header structure.
// It covers all object attributes. Changing any field of the object except
// CreatorKey and ChecksumSignature changes the checksum.
// PayloadChecksum and HeaderChecksum cannot be merged due to the need
// to verify the header in the absence of a payload (e.g. in object.Head rpc).
// It is calculated as a SHA-256 hash over marshaled object header
// with cut CreatorKey and ChecksumSignature.
bytes HeaderChecksum = 2;
// CreatorKey carries public key of the object creator in a binary format.
bytes CreatorKey = 3;
// ChecksumSignature is an user's signature of checksum to verify if it is correct
bytes ChecksumSignature = 4;
}
// SplitHeader groups information about spawning the object through a payload splitting.
message SplitHeader {
// Parent carries identifier of the origin object.
refs.ObjectID Parent = 1;
// Previous carries identifier of the left split neighbor.
refs.ObjectID Previous = 2;
// Previous carries identifier of the right split neighbor.
refs.ObjectID Next = 3;
// Children carries list of identifiers of the objects generated by splitting the current.
repeated refs.ObjectID Children = 4;
// Origin carries the header of the origin object.
Header Origin = 5;
}
// Header groups the information about the NeoFS object.
message Header {
// SystemHeader describes system header
SystemHeader SystemHeader = 1;
// ExtendedHeader carries the additional part of the header.
ExtendedHeader ExtendedHeader = 2;
}
message Object {
// Header carries the object header.
Header Header = 1;
// Payload is an object's payload
bytes Payload = 2;
}