[#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:
parent
cbd4cf63f9
commit
9666fd4bc7
2 changed files with 25 additions and 27 deletions
|
@ -17,30 +17,28 @@ message Attribute {
|
|||
}
|
||||
|
||||
message ExtendedHeader {
|
||||
oneof Value {
|
||||
// Link to other objects
|
||||
Link Link = 1;
|
||||
// Redirect not used yet
|
||||
refs.Address Redirect = 2;
|
||||
// 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;
|
||||
// PayloadChecksum of actual object's payload
|
||||
bytes PayloadChecksum = 8;
|
||||
// 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;
|
||||
// PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert.
|
||||
PublicKey PublicKey = 11;
|
||||
}
|
||||
// Link to other objects
|
||||
Link Link = 1;
|
||||
// Redirect not used yet
|
||||
refs.Address Redirect = 2;
|
||||
// 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;
|
||||
// PayloadChecksum of actual object's payload
|
||||
bytes PayloadChecksum = 8;
|
||||
// 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;
|
||||
// PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert.
|
||||
PublicKey PublicKey = 11;
|
||||
}
|
||||
|
||||
message Tombstone {}
|
||||
|
@ -109,8 +107,8 @@ message Header {
|
|||
// SystemHeader describes system header
|
||||
SystemHeader SystemHeader = 1;
|
||||
|
||||
// ExtendedHeaders describes a set of an extended headers
|
||||
repeated ExtendedHeader ExtendedHeaders = 2;
|
||||
// ExtendedHeader carries the additional part of the header.
|
||||
ExtendedHeader ExtendedHeader = 2;
|
||||
}
|
||||
|
||||
message Object {
|
||||
|
|
|
@ -403,7 +403,7 @@ Header groups the information about the NeoFS object.
|
|||
| Field | Type | Label | Description |
|
||||
| ----- | ---- | ----- | ----------- |
|
||||
| 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>
|
||||
|
|
Loading…
Reference in a new issue