Skip to content

Commit c3bfddc

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

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

app/controlplane/pkg/biz/apitoken_integration_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,12 @@ func (s *apiTokenTestSuite) TestAuthzPolicies() {
150150

151151
// With the new architecture, API token policies are stored in the database, not in Casbin
152152
// Verify that the token has the default policies stored
153+
expectedPolicies := append(s.APIToken.DefaultAuthzPolicies, biz.OrgLevelAPITokenPolicies...)
153154
s.Require().NotNil(token.Policies)
154-
s.Len(token.Policies, len(s.APIToken.DefaultAuthzPolicies))
155+
s.Len(token.Policies, len(expectedPolicies))
155156

156-
// Check that all default policies are present
157-
for _, expectedPolicy := range s.APIToken.DefaultAuthzPolicies {
157+
// Check that all default policies for org-scoped token are present
158+
for _, expectedPolicy := range expectedPolicies {
158159
found := false
159160
for _, actualPolicy := range token.Policies {
160161
if actualPolicy.Resource == expectedPolicy.Resource && actualPolicy.Action == expectedPolicy.Action {

0 commit comments

Comments
 (0)