-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor IsAuthenticated return values
By generating the message ourselves (only relying on strings), we had problems when the error messages invalidated the JSON parsing due to "" in the message. Now that we have a type that implements json.Marshaler, we can avoid doing the error messages manually and should rely on it instead.
- Loading branch information
1 parent
e1ccf92
commit dce370a
Showing
5 changed files
with
30 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,6 @@ data: |- | |
"gecos": "saved-user", | ||
"dir": "/home/[email protected]", | ||
"shell": "/usr/bin/bash", | ||
"groups": [{"name": "saved-remote-group", "gid": "12345"}, {"name": "saved-local-group", "gid": ""}] | ||
"groups": [ {"name": "remote-group", "ugid": "12345"}, {"name": "linux-local-group", "ugid": ""} ] | ||
}} | ||
err: <nil> |
2 changes: 1 addition & 1 deletion
2
...IsAuthenticated/golden/error_when_mode_is_password_and_can_not_fetch_user_info/first_call
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
access: denied | ||
data: '{"message": "could not get user info: could not fetch user info: could not verify token: oidc: failed to unmarshal claims: invalid character ''\u008a'' looking for beginning of value"}' | ||
data: '{"message": "could not get user info: could not fetch user info: could not verify token: oidc: failed to unmarshal claims: invalid character ''\\u008a'' looking for beginning of value"}' | ||
err: <nil> |
4 changes: 1 addition & 3 deletions
4
...estIsAuthenticated/golden/error_when_mode_is_password_but_server_returns_error/first_call
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
access: retry | ||
data: |- | ||
{"message": "could not authenticate user: could not load cached info: could not refresh token: oauth2: cannot fetch token: 400 Bad Request | ||
Response: "} | ||
data: '{"message": "could not authenticate user: could not load cached info: could not refresh token: oauth2: cannot fetch token: 400 Bad Request\nResponse: "}' | ||
err: <nil> |
4 changes: 1 addition & 3 deletions
4
...ata/TestIsAuthenticated/golden/error_when_mode_is_qrcode_and_can_not_get_token/first_call
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
access: retry | ||
data: |- | ||
{"message": "could not authenticate user: oauth2: cannot fetch token: 503 Service Unavailable | ||
Response: "} | ||
data: '{"message": "could not authenticate user: oauth2: cannot fetch token: 503 Service Unavailable\nResponse: "}' | ||
err: <nil> |