Skip to content

Commit 680e648

Browse files
Hubtrick-Gittimbastin
authored andcommitted
fix tests
1 parent d7c9933 commit 680e648

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

accesscontrol/external_entity_provider_rbac_test.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@ func TestIsAllowed(t *testing.T) {
2424
}
2525

2626
tests := []testCase{
27-
{
28-
name: "admin token can read",
29-
userID: "admin-token",
30-
object: shared.ObjectProject,
31-
action: shared.ActionRead,
32-
expectedResult: true,
33-
},
3427
{
3528
name: "all users can read organization",
3629
userID: "user1",
@@ -47,20 +40,6 @@ func TestIsAllowed(t *testing.T) {
4740
mockErr: errors.New("some error"),
4841
expectErr: true,
4942
},
50-
{
51-
name: "admin token can not create",
52-
userID: "admin-token",
53-
object: shared.ObjectProject,
54-
action: shared.ActionCreate,
55-
expectedResult: false,
56-
},
57-
{
58-
name: "admin token cannot delete",
59-
userID: "admin-token",
60-
object: shared.ObjectProject,
61-
action: shared.ActionDelete,
62-
expectedResult: false,
63-
},
6443
}
6544

6645
for _, tc := range tests {
@@ -93,23 +72,6 @@ func TestIsAllowed(t *testing.T) {
9372
}
9473

9574
func TestHasAccess(t *testing.T) {
96-
t.Run("admin token should have access", func(t *testing.T) {
97-
ctx := mocks.NewContext(t)
98-
rootAccessControl := mocks.NewAccessControl(t)
99-
thirdpartyIntegrationMock := mocks.NewIntegrationAggregate(t)
100-
101-
rbac := NewExternalEntityProviderRBAC(
102-
ctx,
103-
rootAccessControl,
104-
thirdpartyIntegrationMock,
105-
"external-entity-provider-id",
106-
)
107-
108-
hasAccess, err := rbac.HasAccess(context.Background(), "admin-token")
109-
assert.NoError(t, err)
110-
assert.True(t, hasAccess)
111-
})
112-
11375
t.Run("if no admin token is provided, the third party integration should be called", func(t *testing.T) {
11476
ctx := mocks.NewContext(t)
11577
rootAccessControl := mocks.NewAccessControl(t)

0 commit comments

Comments
 (0)