From dea7b39805bfebaa504a1d50d836e124649cef8f Mon Sep 17 00:00:00 2001 From: Denis Kirillov Date: Fri, 23 Jun 2023 11:20:05 +0300 Subject: [PATCH] [#131] Fix session token limit by container Signed-off-by: Denis Kirillov --- authmate/authmate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authmate/authmate.go b/authmate/authmate.go index 0faed2c6..6f9c91e0 100644 --- a/authmate/authmate.go +++ b/authmate/authmate.go @@ -404,7 +404,9 @@ func buildBearerTokens(key *keys.PrivateKey, impersonate bool, table *eacl.Table func buildSessionToken(key *keys.PrivateKey, lifetime lifetimeOptions, ctx sessionTokenContext, gateKey *keys.PublicKey) (*session.Container, error) { tok := new(session.Container) tok.ForVerb(ctx.verb) - tok.AppliedTo(ctx.containerID) + if !ctx.containerID.Equals(cid.ID{}) { + tok.ApplyOnlyTo(ctx.containerID) + } tok.SetID(uuid.New()) tok.SetAuthKey((*frostfsecdsa.PublicKey)(gateKey))