Skip to content

Commit

Permalink
[Dembo] Add test plugin gate auth verify insufficient group
Browse files Browse the repository at this point in the history
  • Loading branch information
walbertus committed Aug 28, 2019
1 parent 1d59b36 commit 542b0a2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions plugins/gate-auth-plugin/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,22 @@ func TestGateAuth_VerifyInactiveUser(t *testing.T) {
assert.Equal(t, false, result)
assert.NoError(t, err)
}

func TestGateAuth_VerifyInsufficientGroup(t *testing.T) {
ctx := newContext()
ctx.setUp(t)
defer ctx.tearDown()

userDetail := auth.UserDetail{
Name: "William Albertus Dembo",
Email: "w.albertusd@gmail.com",
Active: true,
Groups: []string{"system", "proctor_executor"},
}
requiredGroups := []string{"system", "proctor_maintainer"}

result, err := ctx.instance().gateAuth.Verify(userDetail, requiredGroups)

assert.Equal(t, false, result)
assert.NoError(t, err)
}

0 comments on commit 542b0a2

Please sign in to comment.