From 4ed939773b020ee6e305f9123b53e62cdbd6f859 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Fri, 3 Jun 2022 11:20:47 +0300 Subject: [PATCH] [#487] Use updated SDK method to get bearer issuer Signed-off-by: Alex Vanin --- api/layer/layer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/layer/layer.go b/api/layer/layer.go index 41d7200f..fe85918d 100644 --- a/api/layer/layer.go +++ b/api/layer/layer.go @@ -325,8 +325,8 @@ func (n *layer) Owner(ctx context.Context) user.ID { } func (n *layer) prepareAuthParameters(ctx context.Context, prm *neofs.PrmAuth, bktOwner user.ID) { - if bd, ok := ctx.Value(api.BoxData).(*accessbox.Box); ok && bd != nil && bd.Gate != nil { - if issuer, ok := bd.Gate.BearerToken.Issuer(); ok && bktOwner.Equals(issuer) { + if bd, ok := ctx.Value(api.BoxData).(*accessbox.Box); ok && bd != nil && bd.Gate != nil && bd.Gate.BearerToken != nil { + if bktOwner.Equals(bearer.ResolveIssuer(*bd.Gate.BearerToken)) { prm.BearerToken = bd.Gate.BearerToken return }