[#26] object: Use nested types in ExtendedHeader

This commit replaces all message definitions related to extended header to
ExtendedHeader message.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-04 23:36:24 +03:00 committed by Stanislav Bogatyrev
parent 72edea28db
commit 81a4adb202
2 changed files with 117 additions and 115 deletions

View file

@ -7,45 +7,9 @@ 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 {
// Integrity header with checksum of all above headers in the object
IntegrityHeader Integrity = 1;
// Attributes carries list of the object attributes in a string key-value format.
repeated Attribute Attributes = 2;
// CreationEpoch carries number of NeoFS epoch on which the object was created.
uint64 CreationEpoch = 3;
// Tombstone header that set up in deleted objects
Tombstone Tombstone = 4;
// HomoHash is a homomorphic hash of original object payload
bytes HomoHash = 5;
// StorageGroup contains meta information for the data audit
storagegroup.StorageGroup StorageGroup = 6;
// Split carries the position of the object in the split hierarchy.
SplitHeader SplitHeader = 7;
}
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;
}
message IntegrityHeader {
// Integrity groups evidence of the integrity of an object's structure.
message Integrity {
// 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.
@ -64,12 +28,37 @@ message IntegrityHeader {
service.Token SessionToken = 3;
// CreatorKey carries public key of the object creator in a binary format.
bytes CreatorKey = 4;
// ChecksumSignature is an user's signature of checksum to verify if it is correct
// ChecksumSignature carries signature of the structure checksum by the object creator.
bytes ChecksumSignature = 5;
}
// Integrity carries object integrity evidence.
Integrity integrity = 1;
// SplitHeader groups information about spawning the object through a payload splitting.
message SplitHeader {
// 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;
}
// Attributes carries list of the object attributes in a string key-value format.
repeated Attribute Attributes = 2;
// CreationEpoch carries number of NeoFS epoch on which the object was created.
uint64 CreationEpoch = 3;
// Tombstone groups the options for deleting an object.
message Tombstone {
}
// Tombstone marks the object to be deleted.
Tombstone tombstone = 4;
// HomomorphicHash carries homomorphic hash of the object payload.
bytes HomomorphicHash = 5;
// StorageGroup carries information about the NeoFS storage group.
storagegroup.StorageGroup StorageGroup = 6;
// Split groups information about spawning the object through a payload splitting.
message Split {
// Parent carries identifier of the origin object.
refs.ObjectID Parent = 1;
@ -85,6 +74,19 @@ message SplitHeader {
// Origin carries the header of the origin object.
Header Origin = 5;
}
// Split carries the position of the object in the split hierarchy.
Split split = 7;
}
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;
}
// Header groups the information about the NeoFS object.
message Header {

View file

@ -29,14 +29,14 @@
- [object/types.proto](#object/types.proto)
- Messages
- [Attribute](#object.Attribute)
- [ExtendedHeader](#object.ExtendedHeader)
- [ExtendedHeader.Attribute](#object.ExtendedHeader.Attribute)
- [ExtendedHeader.Integrity](#object.ExtendedHeader.Integrity)
- [ExtendedHeader.Split](#object.ExtendedHeader.Split)
- [ExtendedHeader.Tombstone](#object.ExtendedHeader.Tombstone)
- [Header](#object.Header)
- [IntegrityHeader](#object.IntegrityHeader)
- [Object](#object.Object)
- [SplitHeader](#object.SplitHeader)
- [SystemHeader](#object.SystemHeader)
- [Tombstone](#object.Tombstone)
- [Scalar Value Types](#scalar-value-types)
@ -359,9 +359,26 @@ in distributed system.
<!-- end services -->
<a name="object.Attribute"></a>
<a name="object.ExtendedHeader"></a>
### Message Attribute
### Message ExtendedHeader
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| integrity | [ExtendedHeader.Integrity](#object.ExtendedHeader.Integrity) | | Integrity carries object integrity evidence. |
| Attributes | [ExtendedHeader.Attribute](#object.ExtendedHeader.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. |
| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. |
| tombstone | [ExtendedHeader.Tombstone](#object.ExtendedHeader.Tombstone) | | Tombstone marks the object to be deleted. |
| HomomorphicHash | [bytes](#bytes) | | HomomorphicHash carries homomorphic hash of the object payload. |
| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup carries information about the NeoFS storage group. |
| split | [ExtendedHeader.Split](#object.ExtendedHeader.Split) | | Split carries the position of the object in the split hierarchy. |
<a name="object.ExtendedHeader.Attribute"></a>
### Message ExtendedHeader.Attribute
Attribute groups the parameters of the object attributes.
@ -371,21 +388,41 @@ Attribute groups the parameters of the object attributes.
| Value | [string](#string) | | Value carries the string value of the object attribute. |
<a name="object.ExtendedHeader"></a>
### Message ExtendedHeader
<a name="object.ExtendedHeader.Integrity"></a>
### Message ExtendedHeader.Integrity
Integrity groups evidence of the integrity of an object's structure.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Integrity | [IntegrityHeader](#object.IntegrityHeader) | | Integrity header with checksum of all above headers in the object |
| Attributes | [Attribute](#object.Attribute) | repeated | Attributes carries list of the object attributes in a string key-value format. |
| CreationEpoch | [uint64](#uint64) | | CreationEpoch carries number of NeoFS epoch on which the object was created. |
| Tombstone | [Tombstone](#object.Tombstone) | | Tombstone header that set up in deleted objects |
| HomoHash | [bytes](#bytes) | | HomoHash is a homomorphic hash of original object payload |
| StorageGroup | [storagegroup.StorageGroup](#storagegroup.StorageGroup) | | StorageGroup contains meta information for the data audit |
| SplitHeader | [SplitHeader](#object.SplitHeader) | | Split carries the position of the object in the split hierarchy. |
| PayloadChecksum | [bytes](#bytes) | | 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. |
| HeaderChecksum | [bytes](#bytes) | | 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. |
| SessionToken | [service.Token](#service.Token) | | SessionToken carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the CreatorKey. |
| CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. |
| ChecksumSignature | [bytes](#bytes) | | ChecksumSignature carries signature of the structure checksum by the object creator. |
<a name="object.ExtendedHeader.Split"></a>
### Message ExtendedHeader.Split
Split groups information about spawning the object through a payload splitting.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. |
| Previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. |
| Next | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the right split neighbor. |
| Children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. |
| Origin | [Header](#object.Header) | | Origin carries the header of the origin object. |
<a name="object.ExtendedHeader.Tombstone"></a>
### Message ExtendedHeader.Tombstone
Tombstone groups the options for deleting an object.
<a name="object.Header"></a>
@ -400,21 +437,6 @@ Header groups the information about the NeoFS object.
| ExtendedHeader | [ExtendedHeader](#object.ExtendedHeader) | | ExtendedHeader carries the additional part of the header. |
<a name="object.IntegrityHeader"></a>
### Message IntegrityHeader
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| PayloadChecksum | [bytes](#bytes) | | 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. |
| HeaderChecksum | [bytes](#bytes) | | 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. |
| SessionToken | [service.Token](#service.Token) | | SessionToken carries token of the session within which the object was created. If session token is presented in object, it acts as the user's proof of the correctness of the CreatorKey. |
| CreatorKey | [bytes](#bytes) | | CreatorKey carries public key of the object creator in a binary format. |
| ChecksumSignature | [bytes](#bytes) | | ChecksumSignature is an user's signature of checksum to verify if it is correct |
<a name="object.Object"></a>
### Message Object
@ -427,21 +449,6 @@ Header groups the information about the NeoFS object.
| Payload | [bytes](#bytes) | | Payload is an object's payload |
<a name="object.SplitHeader"></a>
### Message SplitHeader
SplitHeader groups information about spawning the object through a payload splitting.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| Parent | [refs.ObjectID](#refs.ObjectID) | | Parent carries identifier of the origin object. |
| Previous | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the left split neighbor. |
| Next | [refs.ObjectID](#refs.ObjectID) | | Previous carries identifier of the right split neighbor. |
| Children | [refs.ObjectID](#refs.ObjectID) | repeated | Children carries list of identifiers of the objects generated by splitting the current. |
| Origin | [Header](#object.Header) | | Origin carries the header of the origin object. |
<a name="object.SystemHeader"></a>
### Message SystemHeader
@ -454,13 +461,6 @@ SplitHeader groups information about spawning the object through a payload split
| Address | [refs.Address](#refs.Address) | | Address carries object address in the NeoFS system. It encapsulates the object and the container identifiers. |
| OwnerID | [bytes](#bytes) | | OwnerID is a wallet address |
<a name="object.Tombstone"></a>
### Message Tombstone
<!-- end messages -->
<!-- end enums -->