[#487] Use updated SDK method to get bearer issuer

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
remotes/KirillovDenis/bugfix/681-fix_acl_parsing
Alex Vanin 2022-06-03 11:20:47 +03:00
parent dbfac29171
commit 4ed939773b
1 changed files with 2 additions and 2 deletions

View File

@ -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
}