Skip to content

Commit bfe1290

Browse files
committed
lint
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
1 parent c3bfddc commit bfe1290

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

app/controlplane/pkg/biz/apitoken_integration_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"testing"
2222
"time"
2323

24+
"github.com/chainloop-dev/chainloop/app/controlplane/pkg/authz"
2425
"github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz"
2526
"github.com/chainloop-dev/chainloop/app/controlplane/pkg/biz/testhelpers"
2627
"github.com/golang-jwt/jwt/v4"
@@ -150,7 +151,9 @@ func (s *apiTokenTestSuite) TestAuthzPolicies() {
150151

151152
// With the new architecture, API token policies are stored in the database, not in Casbin
152153
// Verify that the token has the default policies stored
153-
expectedPolicies := append(s.APIToken.DefaultAuthzPolicies, biz.OrgLevelAPITokenPolicies...)
154+
expectedPolicies := make([]*authz.Policy, 0, len(s.APIToken.DefaultAuthzPolicies)+len(biz.OrgLevelAPITokenPolicies))
155+
expectedPolicies = append(expectedPolicies, s.APIToken.DefaultAuthzPolicies...)
156+
expectedPolicies = append(expectedPolicies, biz.OrgLevelAPITokenPolicies...)
154157
s.Require().NotNil(token.Policies)
155158
s.Len(token.Policies, len(expectedPolicies))
156159

0 commit comments

Comments
 (0)