Skip to content

Commit

Permalink
Add CheckAccessActor and CheckAccessHTTP tests for MONITORING role
Browse files Browse the repository at this point in the history
Signed-off-by: ChaitanyaD48 <chaitanya.d48@gmail.com>
  • Loading branch information
ChaitanyaD48 committed Jan 15, 2024
1 parent 51ca03e commit 64de575
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions go/acl/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ func TestSimplePolicy(t *testing.T) {
if err != nil {
t.Errorf("got %v, want no error", err)
}
err = CheckAccessActor("", MONITORING)
if err != nil {
t.Errorf("got %v, want no error", err)
}

err = CheckAccessHTTP(nil, ADMIN)
if err == nil || err.Error() != want {
Expand All @@ -66,6 +70,10 @@ func TestSimplePolicy(t *testing.T) {
if err != nil {
t.Errorf("got %v, want no error", err)
}
err = CheckAccessHTTP(nil, MONITORING)
if err != nil {
t.Errorf("got %v, want no error", err)
}
}

func TestEmptyPolicy(t *testing.T) {
Expand All @@ -78,6 +86,10 @@ func TestEmptyPolicy(t *testing.T) {
if err != nil {
t.Errorf("got %v, want no error", err)
}
err = CheckAccessActor("", MONITORING)
if err != nil {
t.Errorf("got %v, want no error", err)
}

err = CheckAccessHTTP(nil, ADMIN)
if err != nil {
Expand All @@ -87,4 +99,8 @@ func TestEmptyPolicy(t *testing.T) {
if err != nil {
t.Errorf("got %v, want no error", err)
}
err = CheckAccessHTTP(nil, MONITORING)
if err != nil {
t.Errorf("got %v, want no error", err)
}
}

0 comments on commit 64de575

Please sign in to comment.