-
Notifications
You must be signed in to change notification settings - Fork 31
Only convert user and group names to lowercase in API methods #1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
48766fb
Remove leftover golden files
adombeck 98b3d0b
Fix test name
adombeck 69fd38a
Use lowercase username in GetPreviousBroker
adombeck 5f84f80
Use lowercase username in SetDefaultBrokerForUser
adombeck cd31aca
Minor refactoring
adombeck 174db19
Convert groups to lowercase in pam.Service.IsAuthenticated
adombeck 8b24d42
TestIsAuthenticated: Test uppercase user and group names
adombeck cf81760
Fix typo
adombeck 1971dcf
Convert names to lowercase in user service methods
adombeck 78c8b27
Fix test name
adombeck cb41920
Test GetGroupByName with uppercase group
adombeck 258dbb8
Check that user and group names are lowercase
adombeck 71cbe6a
Test LockUser and UnlockUser with uppercase
adombeck 8a18e38
Rename test cases
adombeck c4e47f6
Store DB content as golden file in lock/unlock tests
adombeck 8066a69
Avoid unnecessary lowercase conversions
adombeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
4 changes: 4 additions & 0 deletions
4
.../golden/TestIsAuthenticated/Successfully_authenticate_user_with_uppercase/IsAuthenticated
This file contains hidden or 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 | ||
| msg: | ||
| err: <nil> |
20 changes: 20 additions & 0 deletions
20
...estdata/golden/TestIsAuthenticated/Successfully_authenticate_user_with_uppercase/cache.db
This file contains hidden or 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,20 @@ | ||
| users: | ||
| - name: testisauthenticated/successfully_authenticate_user_with_uppercase_separator_success | ||
| uid: 1111 | ||
| gid: 1111 | ||
| gecos: gecos for success | ||
| dir: /home/success | ||
| shell: /bin/sh/success | ||
| groups: | ||
| - name: testisauthenticated/successfully_authenticate_user_with_uppercase_separator_success | ||
| gid: 1111 | ||
| ugid: testisauthenticated/successfully_authenticate_user_with_uppercase_separator_success | ||
| - name: group-success | ||
| gid: 22222 | ||
| ugid: ugid-success | ||
| users_to_groups: | ||
| - uid: 1111 | ||
| gid: 1111 | ||
| - uid: 1111 | ||
| gid: 22222 | ||
| schema_version: 2 |
4 changes: 4 additions & 0 deletions
4
.../TestIsAuthenticated/Successfully_authenticate_with_groups_with_uppercase/IsAuthenticated
This file contains hidden or 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 | ||
| msg: | ||
| err: <nil> |
30 changes: 30 additions & 0 deletions
30
.../golden/TestIsAuthenticated/Successfully_authenticate_with_groups_with_uppercase/cache.db
This file contains hidden or 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,30 @@ | ||
| users: | ||
| - name: testisauthenticated/successfully_authenticate_with_groups_with_uppercase_separator_success_with_uppercase_groups | ||
| uid: 1111 | ||
| gid: 1111 | ||
| gecos: gecos for success_with_uppercase_groups | ||
| dir: /home/success_with_uppercase_groups | ||
| shell: /bin/sh/success_with_uppercase_groups | ||
| groups: | ||
| - name: testisauthenticated/successfully_authenticate_with_groups_with_uppercase_separator_success_with_uppercase_groups | ||
| gid: 1111 | ||
| ugid: testisauthenticated/successfully_authenticate_with_groups_with_uppercase_separator_success_with_uppercase_groups | ||
| - name: group-success_with_uppercase_groups | ||
| gid: 22222 | ||
| ugid: ugid-success_with_uppercase_groups | ||
| - name: group1 | ||
| gid: 33333 | ||
| ugid: "12345678" | ||
| - name: group2 | ||
| gid: 44444 | ||
| ugid: "87654321" | ||
| users_to_groups: | ||
| - uid: 1111 | ||
| gid: 1111 | ||
| - uid: 1111 | ||
| gid: 22222 | ||
| - uid: 1111 | ||
| gid: 33333 | ||
| - uid: 1111 | ||
| gid: 44444 | ||
| schema_version: 2 |
76 changes: 76 additions & 0 deletions
76
...ces/pam/testdata/golden/TestSetDefaultBrokerForUser/Username_is_case_insensitive/cache.db
This file contains hidden or 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,76 @@ | ||
| users: | ||
| - name: userwithbroker | ||
| uid: 1111 | ||
| gid: 11111 | ||
| gecos: |- | ||
| userwithbroker gecos | ||
| On multiple lines | ||
| dir: /home/userwithbroker | ||
| shell: /bin/bash | ||
| broker_id: broker-id | ||
| - name: userwithinactivebroker | ||
| uid: 2222 | ||
| gid: 22222 | ||
| gecos: userwithinactivebroker | ||
| dir: /home/userwithinactivebroker | ||
| shell: /bin/dash | ||
| broker_id: inactive-broker-id | ||
| - name: userlocalbroker | ||
| uid: 3333 | ||
| gid: 33333 | ||
| gecos: userlocalbroker | ||
| dir: /home/userlocalbroker | ||
| shell: /bin/zsh | ||
| - name: usersetbroker | ||
| uid: 4444 | ||
| gid: 44444 | ||
| gecos: usersetbroker | ||
| dir: /home/usersetbroker | ||
| shell: /bin/dash | ||
| broker_id: "1902181170" | ||
| - name: userupdatebroker | ||
| uid: 5555 | ||
| gid: 55555 | ||
| gecos: userupdatebroker | ||
| dir: /home/userupdatebroker | ||
| shell: /bin/zsh | ||
| broker_id: tobereplaced-broker-id | ||
| groups: | ||
| - name: group1 | ||
| gid: 11111 | ||
| ugid: group1 | ||
| - name: group2 | ||
| gid: 22222 | ||
| ugid: group2 | ||
| - name: group3 | ||
| gid: 33333 | ||
| ugid: group3 | ||
| - name: group4 | ||
| gid: 44444 | ||
| ugid: group4 | ||
| - name: group5 | ||
| gid: 55555 | ||
| ugid: group5 | ||
| - name: commongroup | ||
| gid: 99999 | ||
| ugid: commongroup | ||
| users_to_groups: | ||
| - uid: 1111 | ||
| gid: 11111 | ||
| - uid: 2222 | ||
| gid: 22222 | ||
| - uid: 2222 | ||
| gid: 99999 | ||
| - uid: 3333 | ||
| gid: 33333 | ||
| - uid: 3333 | ||
| gid: 99999 | ||
| - uid: 4444 | ||
| gid: 44444 | ||
| - uid: 4444 | ||
| gid: 99999 | ||
| - uid: 5555 | ||
| gid: 55555 | ||
| - uid: 5555 | ||
| gid: 99999 | ||
| schema_version: 2 |
5 changes: 5 additions & 0 deletions
5
...nal/services/user/testdata/golden/TestGetGroupByName/Return_existing_group_with_uppercase
This file contains hidden or 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,5 @@ | ||
| name: group1 | ||
| gid: 11111 | ||
| members: | ||
| - user1 | ||
| passwd: "" |
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is already tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's tested by https://github.com/ubuntu/authd/pull/1125/files#diff-0c73c59e48e29415b50ca12882e6c4fa9c1bd19cb60c23d45a3a06dcbb2998c3R445