[#283] v2/session: Support ContainerSessionContext message

Define `ContainerSessionContext` structure, implement getters / setters,
JSON and binary encoders, gRPC converters. Support new type of context in
SessionTokenBody message. Add test message generator and cover methods with
unit tests.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-24 17:46:39 +03:00 committed by Alex Vanin
parent f2be7509d3
commit 9eb567a53a
6 changed files with 261 additions and 0 deletions

View file

@ -119,3 +119,11 @@ func (r *ResponseVerificationHeader) UnmarshalJSON(data []byte) error {
return r.FromGRPCMessage(msg)
}
func (x *ContainerSessionContext) MarshalJSON() ([]byte, error) {
return message.MarshalJSON(x)
}
func (x *ContainerSessionContext) UnmarshalJSON(data []byte) error {
return message.UnmarshalJSON(x, data, new(session.ContainerSessionContext))
}