-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Package tests for `internal/services/pam`. UDENG-1172
- Loading branch information
Showing
18 changed files
with
681 additions
and
8 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- id: local_ID | ||
name: local | ||
brandicon: "" | ||
- id: BrokerMock_ID | ||
name: BrokerMock | ||
brandicon: mock_icon.png |
2 changes: 2 additions & 0 deletions
2
...ices/pam/testdata/TestGetAuthenticationModes/golden/successfully_get_authentication_modes
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,2 @@ | ||
- id: mode1 | ||
label: Mode 1 |
4 changes: 4 additions & 0 deletions
4
...testdata/TestGetAuthenticationModes/golden/successfully_get_multiple_authentication_modes
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 @@ | ||
- id: mode1 | ||
label: Mode 1 | ||
- id: mode2 | ||
label: Mode 2 |
4 changes: 4 additions & 0 deletions
4
...services/pam/testdata/TestIsAuthorized/golden/denies_authentication_when_broker_times_out
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: denied | ||
data: {"mock_answer": "denied by time out"} | ||
err: <nil> |
4 changes: 4 additions & 0 deletions
4
internal/services/pam/testdata/TestIsAuthorized/golden/empty_data_gets_json_formatted
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: allowed | ||
data: {} | ||
err: <nil> |
4 changes: 4 additions & 0 deletions
4
internal/services/pam/testdata/TestIsAuthorized/golden/error_when_authorizing
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: | ||
data: | ||
err: rpc error: code = Unknown desc = can't check authorization: Broker "BrokerMock": IsAuthorized errored out |
4 changes: 4 additions & 0 deletions
4
...al/services/pam/testdata/TestIsAuthorized/golden/error_when_broker_returns_invalid_access
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: | ||
data: | ||
err: rpc error: code = Unknown desc = can't check authorization: invalid access authorization key: invalid |
4 changes: 4 additions & 0 deletions
4
...rnal/services/pam/testdata/TestIsAuthorized/golden/error_when_broker_returns_invalid_data
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: | ||
data: | ||
err: rpc error: code = Unknown desc = can't check authorization: invalid user information (not json formatted): invalid |
8 changes: 8 additions & 0 deletions
8
...es/pam/testdata/TestIsAuthorized/golden/error_when_calling_second_time_without_cancelling
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,8 @@ | ||
FIRST CALL: | ||
access: allowed | ||
data: {"mock_answer": "authentication allowed by timeout"} | ||
err: <nil> | ||
SECOND CALL: | ||
access: | ||
data: | ||
err: rpc error: code = Unknown desc = can't check authorization: Broker "BrokerMock": IsAuthorized already running for session "TestIsAuthorized/Error_when_calling_second_time_without_cancelling_separator_IA_second_call-session_id" |
4 changes: 4 additions & 0 deletions
4
internal/services/pam/testdata/TestIsAuthorized/golden/error_when_sessionid_is_empty
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: | ||
data: | ||
err: rpc error: code = Unknown desc = can't check authorization: no session ID provided |
4 changes: 4 additions & 0 deletions
4
internal/services/pam/testdata/TestIsAuthorized/golden/error_when_there_is_no_broker
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: | ||
data: | ||
err: rpc error: code = Unknown desc = can't check authorization: no broker found for session "no broker" |
4 changes: 4 additions & 0 deletions
4
internal/services/pam/testdata/TestIsAuthorized/golden/successfully_authorize
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: allowed | ||
data: {"mock_answer": "authentication allowed by default"} | ||
err: <nil> |
8 changes: 8 additions & 0 deletions
8
...ces/pam/testdata/TestIsAuthorized/golden/successfully_authorize_if_first_call_is_canceled
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,8 @@ | ||
FIRST CALL: | ||
access: | ||
data: | ||
err: rpc error: code = Canceled desc = context canceled | ||
SECOND CALL: | ||
access: allowed | ||
data: {"mock_answer": "authentication allowed by timeout"} | ||
err: <nil> |
6 changes: 6 additions & 0 deletions
6
.../TestSelectAuthenticationMode/golden/successfully_select_mode_with_missing_optional_value
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,6 @@ | ||
type: optional-entry | ||
label: "" | ||
button: "" | ||
wait: "" | ||
entry: "" | ||
content: "" |
6 changes: 6 additions & 0 deletions
6
...testdata/TestSelectAuthenticationMode/golden/successfully_select_mode_with_required_value
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,6 @@ | ||
type: required-entry | ||
label: "" | ||
button: "" | ||
wait: "" | ||
entry: entry_type | ||
content: "" |
2 changes: 2 additions & 0 deletions
2
...pam/testdata/TestSelectBroker/golden/successfully_select_a_broker_and_creates_the_session
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,2 @@ | ||
ID: BROKER_ID-TestSelectBroker/Successfully_select_a_broker_and_creates_the_session_separator_success-session_id | ||
Encryption Key: BrokerMock_key |
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