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

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
remotes/fyrchik/split-info-json
Alex Vanin 2022-03-02 15:49:03 +03:00 committed by Alex Vanin
parent d109594d75
commit bf23b548ab
1 changed files with 4 additions and 1 deletions

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) {