From f059c49dec5561166abe14a87c9ee469eade60c1 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 18 Jun 2020 11:49:10 +0300 Subject: [PATCH] service: support extended headers of the request --- proto-docs/service.md | 26 ++++++++++++++++++++++++++ service/meta.proto | 17 +++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/proto-docs/service.md b/proto-docs/service.md index 423599b..4d96f61 100644 --- a/proto-docs/service.md +++ b/proto-docs/service.md @@ -6,6 +6,8 @@ - [service/meta.proto](#service/meta.proto) - Messages + - [RequestExtendedHeader](#service.RequestExtendedHeader) + - [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) - [RequestMetaHeader](#service.RequestMetaHeader) - [ResponseMetaHeader](#service.ResponseMetaHeader) @@ -33,6 +35,29 @@ + + +### Message RequestExtendedHeader +RequestExtendedHeader contains extended headers of request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| Headers | [RequestExtendedHeader.KV](#service.RequestExtendedHeader.KV) | repeated | Headers carries list of key-value headers | + + + + +### Message RequestExtendedHeader.KV +KV contains string key-value pair + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| K | [string](#string) | | K carries extended header key | +| V | [string](#string) | | V carries extra header value | + + ### Message RequestMetaHeader @@ -46,6 +71,7 @@ RequestMetaHeader contains information about request meta headers | Epoch | [uint64](#uint64) | | Epoch for user can be empty, because node sets epoch to the actual value | | Version | [uint32](#uint32) | | Version defines protocol version TODO: not used for now, should be implemented in future | | Raw | [bool](#bool) | | Raw determines whether the request is raw or not | +| ExtendedHeader | [RequestExtendedHeader](#service.RequestExtendedHeader) | | ExtendedHeader carries extended headers of the request | diff --git a/service/meta.proto b/service/meta.proto index 093f118..8171980 100644 --- a/service/meta.proto +++ b/service/meta.proto @@ -19,6 +19,8 @@ message RequestMetaHeader { uint32 Version = 3; // Raw determines whether the request is raw or not bool Raw = 4; + // ExtendedHeader carries extended headers of the request + RequestExtendedHeader ExtendedHeader = 5 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; } // ResponseMetaHeader contains meta information based on request processing by server @@ -30,3 +32,18 @@ message ResponseMetaHeader { // TODO: not used for now, should be implemented in future uint32 Version = 2; } + +// RequestExtendedHeader contains extended headers of request +message RequestExtendedHeader { + // KV contains string key-value pair + message KV { + // K carries extended header key + string K = 1; + + // V carries extended header value + string V = 2; + } + + // Headers carries list of key-value headers + repeated KV Headers = 1 [(gogoproto.nullable) = false]; +}