Map platform-root group to platform operator
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 26s
All checks were successful
Build and Publish Container Image / build-and-push (push) Successful in 26s
This commit is contained in:
parent
41d2e1d1f6
commit
90a20783e5
2 changed files with 34 additions and 0 deletions
|
|
@ -167,6 +167,31 @@ func TestLookupUser_IgnoresAmbiguousTenantGroups(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestLookupUser_MapsEstablishedPlatformAdminGroup(t *testing.T) {
|
||||
conn := &mockConn{
|
||||
searchFn: func(req *ldap.SearchRequest) (*ldap.SearchResult, error) {
|
||||
return singleEntryResult(
|
||||
"uid=platform-root,ou=people,dc=test,dc=local",
|
||||
"platform-root", "Platform", "Root", "root@example.test",
|
||||
[]string{
|
||||
"cn=net-kingdom-admins,ou=groups,dc=test,dc=local",
|
||||
"cn=net-kingdom-users,ou=groups,dc=test,dc=local",
|
||||
},
|
||||
), nil
|
||||
},
|
||||
}
|
||||
user, err := makeAdapter(testConfig(), conn).LookupUser(context.Background(), "platform-root")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if user.Tenant != "tenant:platform" {
|
||||
t.Fatalf("tenant = %q", user.Tenant)
|
||||
}
|
||||
if len(user.Roles) != 2 || user.Roles[1] != "platform-operator" {
|
||||
t.Fatalf("roles = %v", user.Roles)
|
||||
}
|
||||
}
|
||||
|
||||
func TestLookupUser_DisplayName_FallsBackToSN(t *testing.T) {
|
||||
dn := "uid=bob,ou=users,dc=netkingdom,dc=local"
|
||||
conn := &mockConn{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue