[#67] Use tuple of header and signature in object head response

Object.Head method returns either full header or short header.
Since it can't return anything else, signature must be paired
with full header in explicit tuple message.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-09-04 11:09:22 +03:00 committed by Stanislav Bogatyrev
parent a07a518a1e
commit 4aea595cc6

View file

@ -239,23 +239,29 @@ message HeadRequest {
neo.fs.v2.session.RequestVerificationHeader verify_header = 3; neo.fs.v2.session.RequestVerificationHeader verify_header = 3;
} }
// Tuple of full object header and signature of object ID.
message HeaderWithSignature {
// Full object header
Header header = 1;
// Signed object_id to verify full header's authenticity through following steps:
// 1. Calculate SHA-256 of marshalled Headers structure.
// 2. Check if the resulting hash matched ObjectID
// 3. Check if ObjectID's signature in signature field is correct.
neo.fs.v2.refs.Signature signature = 2;
}
// Head response // Head response
message HeadResponse { message HeadResponse {
// Response body // Response body
message Body { message Body {
// Carries the requested object header or it's part // Carries the requested object header or it's part
oneof head{ oneof head{
// Full object header // Full object header with object ID signature
Header header = 1; Header HeaderWithSignature = 1;
// Short object header // Short object header
ShortHeader short_header = 2; ShortHeader short_header = 2;
// Signed object_id to verify full header's authenticity through following steps:
// 1. Calculate SHA-256 of marshalled Headers structure.
// 2. Check if the resulting hash matched ObjectID
// 3. Check if ObjectID's signature in signature field is correct.
neo.fs.v2.refs.Signature signature = 3;
} }
} }
// Body of head object response message. // Body of head object response message.