-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(brokers/cache): Change user info validations to require at least…
… one remote group (#131) We used to allow the brokers to provide user information without any group. This creates problems when managing local groups. To prevent this, we now force the brokers to return at least one group for the user. The user group list must contain at least one remote group (with UGID) to act as the default group for the user. This means that it must be the first group in the list. UDENG-1865
- Loading branch information
Showing
15 changed files
with
112 additions
and
81 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
12 changes: 12 additions & 0 deletions
12
...ers/testdata/TestIsAuthenticated/golden/error_when_broker_returns_userinfo_with_no_groups
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FIRST CALL: | ||
access: | ||
data: | ||
err: invalid user information provided by the broker ({ | ||
"name": "IA_info_missing_groups", | ||
"uuid": "uuid-IA_info_missing_groups", | ||
"gecos": "gecos for IA_info_missing_groups", | ||
"dir": "/home/IA_info_missing_groups", | ||
"shell": "/bin/sh/IA_info_missing_groups", | ||
"avatar": "avatar for IA_info_missing_groups", | ||
"groups": [ ] | ||
}): empty groups |
4 changes: 4 additions & 0 deletions
4
...estdata/TestIsAuthenticated/golden/no_error_when_broker_returns_userinfo_with_empty_gecos
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FIRST CALL: | ||
access: granted | ||
data: {"Name":"IA_info_missing_gecos","UID":67151,"Gecos":"","Dir":"/home/IA_info_missing_gecos","Shell":"/bin/sh/IA_info_missing_gecos","Groups":[{"Name":"group-IA_info_missing_gecos","GID":66857}]} | ||
err: <nil> |
4 changes: 0 additions & 4 deletions
4
internal/brokers/testdata/TestIsAuthenticated/golden/no_ugid_means_local_group
This file was deleted.
Oops, something went wrong.
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
13 changes: 13 additions & 0 deletions
13
...cache/testdata/TestUpdateFromUserInfo/golden/insert_new_user_without_optional_gecos_field
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
GroupByID: | ||
"11111": '{"Name":"group1","GID":11111}' | ||
GroupByName: | ||
group1: '{"Name":"group1","GID":11111}' | ||
GroupToUsers: | ||
"11111": '{"GID":11111,"UIDs":[1111]}' | ||
UserByID: | ||
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}' | ||
UserByName: | ||
user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}' | ||
UserToBroker: {} | ||
UserToGroups: | ||
"1111": '{"UID":1111,"GIDs":[11111]}' |
13 changes: 0 additions & 13 deletions
13
.../golden/invalid_value_entry_in_groupbyname_recreates_entries_even_without_restating_group
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...estUpdateFromUserInfo/golden/update_user_and_keep_existing_groups_without_specifying_them
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
...ata/TestUpdateFromUserInfo/golden/update_user_by_removing_optional_gecos_field_if_not_set
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
GroupByID: | ||
"11111": '{"Name":"group1","GID":11111}' | ||
GroupByName: | ||
group1: '{"Name":"group1","GID":11111}' | ||
GroupToUsers: | ||
"11111": '{"GID":11111,"UIDs":[1111]}' | ||
UserByID: | ||
"1111": '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}' | ||
UserByName: | ||
user1: '{"Name":"user1","UID":1111,"GID":11111,"Gecos":"","Dir":"/home/user1","Shell":"/bin/bash","LastPwdChange":-1,"MaxPwdAge":-1,"PwdWarnPeriod":-1,"PwdInactivity":-1,"MinPwdAge":-1,"ExpirationDate":-1,"LastLogin":"ABCDETIME"}' | ||
UserToBroker: {} | ||
UserToGroups: | ||
"1111": '{"UID":1111,"GIDs":[11111]}' |
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