[#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

@ -179,6 +179,19 @@ func GenerateObjectSessionContext(empty bool) *session.ObjectSessionContext {
return m
}
func GenerateContainerSessionContext(empty bool) *session.ContainerSessionContext {
m := new(session.ContainerSessionContext)
if !empty {
m.SetVerb(session.ContainerVerbDelete)
m.SetWildcard(true)
}
m.SetContainerID(refstest.GenerateContainerID(empty))
return m
}
func GenerateXHeader(empty bool) *session.XHeader {
m := new(session.XHeader)