-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing defect with SAML origin users not being properly mapped for op…
…timized user role mapping
- Loading branch information
Caleb Washburn
committed
Apr 3, 2017
1 parent
0af6d99
commit a1ba707
Showing
5 changed files
with
73 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,6 +140,38 @@ var _ = Describe("given SpaceManager", func() { | |
Ω(ok).Should(BeTrue()) | ||
}) | ||
|
||
It("update other origin users where users are in uaac and already in space", func() { | ||
config := &l.Config{ | ||
Enabled: true, | ||
Origin: "other", | ||
} | ||
uaacUsers := make(map[string]string) | ||
uaacUsers["[email protected]"] = "[email protected]" | ||
spaceUsers := make(map[string]string) | ||
spaceUsers["[email protected]"] = "[email protected]" | ||
updateUsersInput := UpdateUsersInput{ | ||
SpaceGUID: "my-space-guid", | ||
OrgGUID: "my-org-guid", | ||
Role: "my-role", | ||
LdapGroupName: "ldap-group-name", | ||
} | ||
|
||
ldapGroupUsers := []l.User{l.User{ | ||
UserDN: "user-dn", | ||
UserID: "user-id", | ||
Email: "[email protected]", | ||
}} | ||
|
||
mockCloudController.EXPECT().GetCFUsers("my-space-guid", "spaces", "my-role").Return(spaceUsers, nil) | ||
mockLdap.EXPECT().GetUserIDs(config, "ldap-group-name").Return(ldapGroupUsers, nil) | ||
|
||
err := userManager.UpdateSpaceUsers(config, uaacUsers, updateUsersInput) | ||
Ω(err).Should(BeNil()) | ||
Ω(len(uaacUsers)).Should(BeEquivalentTo(1)) | ||
_, ok := uaacUsers["[email protected]"] | ||
Ω(ok).Should(BeTrue()) | ||
}) | ||
|
||
It("update ldap users where users are not in uaac", func() { | ||
config := &l.Config{ | ||
Enabled: true, | ||
|
@@ -269,8 +301,8 @@ var _ = Describe("given SpaceManager", func() { | |
uaacUsers["user-1"] = "user-1" | ||
uaacUsers["user-2"] = "user-2" | ||
spaceUsers := make(map[string]string) | ||
spaceUsers["user-1"] = "user-1" | ||
spaceUsers["user-2"] = "user-2" | ||
spaceUsers["user-1"] = "asfdsdf-1" | ||
spaceUsers["user-2"] = "asdfsaf-2" | ||
updateUsersInput := UpdateUsersInput{ | ||
SpaceGUID: "my-space-guid", | ||
OrgGUID: "my-org-guid", | ||
|