diff --git a/pkg/client/object.go b/pkg/client/object.go index 60d2970..6fd25ad 100644 --- a/pkg/client/object.go +++ b/pkg/client/object.go @@ -1301,8 +1301,6 @@ func (c *clientImpl) attachV2SessionToken(opts *callOptions, hdr *v2session.Requ return nil } - token := new(v2session.SessionToken) - opCtx := new(v2session.ObjectSessionContext) opCtx.SetAddress(info.addr) opCtx.SetVerb(info.verb) @@ -1319,6 +1317,9 @@ func (c *clientImpl) attachV2SessionToken(opts *callOptions, hdr *v2session.Requ body.SetContext(opCtx) body.SetLifetime(lt) + token := new(v2session.SessionToken) + token.SetBody(body) + signWrapper := signature.StableMarshalerWrapper{SM: token.GetBody()} err := signer.SignDataWithHandler(opts.key, signWrapper, func(key []byte, sig []byte) {