diff --git a/pkg/services/object/put/remote.go b/pkg/services/object/put/remote.go index ab57ce677..eadbb2996 100644 --- a/pkg/services/object/put/remote.go +++ b/pkg/services/object/put/remote.go @@ -78,6 +78,7 @@ func (t *remoteTarget) Close() (*transformer.AccessIdentifiers, error) { ), client.WithTTL(1), // FIXME: use constant client.WithBearer(t.bearer), + client.WithSession(t.token), ) if err != nil { return nil, errors.Wrapf(err, "(%T) could not put object to %s", t, addr) diff --git a/pkg/services/object/put/streamer.go b/pkg/services/object/put/streamer.go index d8af83004..f91421069 100644 --- a/pkg/services/object/put/streamer.go +++ b/pkg/services/object/put/streamer.go @@ -46,9 +46,7 @@ func (p *Streamer) initTarget(prm *PutInitPrm) error { return errors.Wrapf(err, "(%T) could not prepare put parameters", p) } - sToken := prm.common.SessionToken() - - if sToken == nil { + if prm.hdr.Signature() != nil { // prepare untrusted-Put object target p.target = &validatingTarget{ nextTarget: p.newCommonTarget(prm), @@ -58,6 +56,8 @@ func (p *Streamer) initTarget(prm *PutInitPrm) error { return nil } + sToken := prm.common.SessionToken() + // prepare trusted-Put object target // get private token from local storage