[#158] client: Support object context in session token setter

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2022-03-02 15:49:03 +03:00 committed by Alex Vanin
parent d109594d75
commit bf23b548ab

View file

@ -200,7 +200,8 @@ func (t *Token) Signature() *signature.Signature {
// SetContext sets context of the Token.
//
// Supported contexts:
// - *ContainerContext.
// - *ContainerContext,
// - *ObjectContext.
//
// Resets context if it is not supported.
func (t *Token) SetContext(v interface{}) {
@ -209,6 +210,8 @@ func (t *Token) SetContext(v interface{}) {
switch c := v.(type) {
case *ContainerContext:
cV2 = c.ToV2()
case *ObjectContext:
cV2 = c.ToV2()
}
t.setBodyField(func(body *session.TokenBody) {