[#283] client/container: Attach container session token to request

Write session token of `container.Container` to container PUT request body
during `client.PutContainer` call.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-05-24 21:45:51 +03:00 committed by Alex Vanin
parent d8f85e80c9
commit ddccfe0072

View file

@ -112,7 +112,11 @@ func (c *clientImpl) PutContainer(ctx context.Context, cnr *container.Container,
req := new(v2container.PutRequest) req := new(v2container.PutRequest)
req.SetBody(reqBody) req.SetBody(reqBody)
req.SetMetaHeader(v2MetaHeaderFromOpts(callOptions))
meta := v2MetaHeaderFromOpts(callOptions)
meta.SetSessionToken(cnr.SessionToken().ToV2())
req.SetMetaHeader(meta)
err = v2signature.SignServiceMessage(callOptions.key, req) err = v2signature.SignServiceMessage(callOptions.key, req)
if err != nil { if err != nil {