[#485] Upgrade SDK with latest bearer package API

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-01 17:00:30 +03:00 committed by Alex Vanin
parent ea252421f5
commit 4f43aad495
6 changed files with 27 additions and 16 deletions

View file

@ -11,6 +11,7 @@ import (
"github.com/nspcc-dev/neofs-s3-gw/api/data"
"github.com/nspcc-dev/neofs-s3-gw/api/errors"
"github.com/nspcc-dev/neofs-s3-gw/api/layer"
"github.com/nspcc-dev/neofs-sdk-go/bearer"
"go.uber.org/zap"
)
@ -159,8 +160,8 @@ func (h *handler) sendNotifications(ctx context.Context, p *SendNotificationPara
}
box, err := layer.GetBoxData(ctx)
if err == nil {
p.User = box.Gate.BearerToken.OwnerID().String()
if err == nil && box.Gate.BearerToken != nil {
p.User = bearer.ResolveIssuer(*box.Gate.BearerToken).EncodeToString()
}
topics := filterSubjects(conf, p.Event, p.ObjInfo.Name)