[#26] object: Remake ExtendedHeader to field set

In previous version of the format ExtendedHeader consisted of one field
Value, defined by oneof mechanism. Such a definition format give complete
freedom when composing an object header, however, it did not allow strictly
structuring the header format at the level of type syntax. Since the object
has a well-defined structure in the system, this commit replaces the
definition through oneof with a set of fields. As a consequence, storing a
set of extended headers of the new type in the general header became
redundant, so the repeated keyword was removed.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-08-04 17:08:09 +03:00 committed by Stanislav Bogatyrev
parent cbd4cf63f9
commit 9666fd4bc7
2 changed files with 25 additions and 27 deletions

View file

@ -17,30 +17,28 @@ message Attribute {
} }
message ExtendedHeader { message ExtendedHeader {
oneof Value { // Link to other objects
// Link to other objects Link Link = 1;
Link Link = 1; // Redirect not used yet
// Redirect not used yet refs.Address Redirect = 2;
refs.Address Redirect = 2; // Attribute is a set of K-V object attributes
// Attribute is a set of K-V object attributes Attribute Attribute = 3;
Attribute Attribute = 3; // Split carries the position of the object in the split hierarchy.
// Split carries the position of the object in the split hierarchy. SplitHeader SplitHeader = 4;
SplitHeader SplitHeader = 4; // Tombstone header that set up in deleted objects
// Tombstone header that set up in deleted objects Tombstone Tombstone = 5;
Tombstone Tombstone = 5; // Token header contains token of the session within which the object was created
// Token header contains token of the session within which the object was created service.Token Token = 6;
service.Token Token = 6; // HomoHash is a homomorphic hash of original object payload
// HomoHash is a homomorphic hash of original object payload bytes HomoHash = 7;
bytes HomoHash = 7; // PayloadChecksum of actual object's payload
// PayloadChecksum of actual object's payload bytes PayloadChecksum = 8;
bytes PayloadChecksum = 8; // Integrity header with checksum of all above headers in the object
// Integrity header with checksum of all above headers in the object IntegrityHeader Integrity = 9;
IntegrityHeader Integrity = 9; // StorageGroup contains meta information for the data audit
// StorageGroup contains meta information for the data audit storagegroup.StorageGroup StorageGroup = 10;
storagegroup.StorageGroup StorageGroup = 10; // PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert.
// PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. PublicKey PublicKey = 11;
PublicKey PublicKey = 11;
}
} }
message Tombstone {} message Tombstone {}
@ -109,8 +107,8 @@ message Header {
// SystemHeader describes system header // SystemHeader describes system header
SystemHeader SystemHeader = 1; SystemHeader SystemHeader = 1;
// ExtendedHeaders describes a set of an extended headers // ExtendedHeader carries the additional part of the header.
repeated ExtendedHeader ExtendedHeaders = 2; ExtendedHeader ExtendedHeader = 2;
} }
message Object { message Object {

View file

@ -403,7 +403,7 @@ Header groups the information about the NeoFS object.
| Field | Type | Label | Description | | Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header | | SystemHeader | [SystemHeader](#object.SystemHeader) | | SystemHeader describes system header |
| ExtendedHeaders | [ExtendedHeader](#object.ExtendedHeader) | repeated | ExtendedHeaders describes a set of an extended headers | | ExtendedHeader | [ExtendedHeader](#object.ExtendedHeader) | | ExtendedHeader carries the additional part of the header. |
<a name="object.IntegrityHeader"></a> <a name="object.IntegrityHeader"></a>