From 5beca3b0d1d84528ce8f3b6c57f5b125d0ed94af Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 4 Aug 2020 13:18:38 +0300 Subject: [PATCH] [#26] object: Define message for object header In previous version of the format Object message included two header fields: SystemHeader and list of ExtendedHeader. Due to the fact that all headers were not encapsulated in a single message, some messages were forced to use Object to convey the full header of the object (e.g. object.HeadResponse). To resolve this semantic inconsistency, this commit defines a Header message, consisting of a system and an extended portion. As a result, the Object now consists of two fields - Header and Payload. Signed-off-by: Leonard Lyubich --- object/types.proto | 11 +++++++++-- proto-docs/object.md | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/object/types.proto b/object/types.proto index 37d80a4..0b249fd 100644 --- a/object/types.proto +++ b/object/types.proto @@ -109,13 +109,20 @@ message Transform { Type type = 1; } -message Object { +// Header groups the information about the NeoFS object. +message Header { // SystemHeader describes system header SystemHeader SystemHeader = 1; + // ExtendedHeaders describes a set of an extended headers repeated ExtendedHeader ExtendedHeaders = 2; +} + +message Object { + // Header carries the object header. + Header Header = 1; // Payload is an object's payload - bytes Payload = 3; + bytes Payload = 2; } message PublicKey { diff --git a/proto-docs/object.md b/proto-docs/object.md index fdc2275..8115802 100644 --- a/proto-docs/object.md +++ b/proto-docs/object.md @@ -32,6 +32,7 @@ - [Attribute](#object.Attribute) - [CreationPoint](#object.CreationPoint) - [ExtendedHeader](#object.ExtendedHeader) + - [Header](#object.Header) - [IntegrityHeader](#object.IntegrityHeader) - [Link](#object.Link) - [Object](#object.Object) @@ -406,6 +407,18 @@ Attribute groups the parameters of the object attributes. | PublicKey | [PublicKey](#object.PublicKey) | | PublicKey of owner of the object. Key is used for verification and can be based on NeoID or x509 cert. | + + +### Message Header +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 | + + ### Message IntegrityHeader @@ -438,8 +451,7 @@ Attribute groups the parameters of the object attributes. | 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 | +| Header | [Header](#object.Header) | | Header carries the object header. | | Payload | [bytes](#bytes) | | Payload is an object's payload |