Skip to content

Commit

Permalink
maint(pam/nativemodel): Improve wording and consistency of strings (#599
Browse files Browse the repository at this point in the history
)

Use the same terminology and similar behavior of the CLI mode, preserving Polkit functionality

UDENG-5012
  • Loading branch information
3v1n0 authored Nov 6, 2024
2 parents ab5a98a + 2de0fe2 commit c91dd5b
Show file tree
Hide file tree
Showing 42 changed files with 8,842 additions and 6,241 deletions.
25 changes: 14 additions & 11 deletions pam/integration-tests/native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,11 @@ func TestNativeAuthenticate(t *testing.T) {
},
"Authenticate user with mfa": {
tape: "mfa_auth",
tapeSettings: []tapeSetting{{vhsHeight, 700}},
tapeSettings: []tapeSetting{{vhsHeight, 800}},
},
"Authenticate user with form mode with button": {
tape: "form_with_button",
tape: "form_with_button",
tapeSettings: []tapeSetting{{vhsHeight, 600}},
},
"Authenticate user with qr code": {
tape: "qr_code",
Expand All @@ -46,23 +47,23 @@ func TestNativeAuthenticate(t *testing.T) {
},
"Authenticate user with qr code in a TTY": {
tape: "qr_code",
tapeSettings: []tapeSetting{{vhsHeight, 3500}},
tapeSettings: []tapeSetting{{vhsHeight, 3700}},
clientOptions: clientOptions{
PamUser: "user-integration-qr-code-tty",
Term: "linux",
},
},
"Authenticate user with qr code in a TTY session": {
tape: "qr_code",
tapeSettings: []tapeSetting{{vhsHeight, 3500}},
tapeSettings: []tapeSetting{{vhsHeight, 3700}},
clientOptions: clientOptions{
PamUser: "user-integration-qr-code-tty-session",
Term: "xterm-256color", SessionType: "tty",
},
},
"Authenticate user with qr code in screen": {
tape: "qr_code",
tapeSettings: []tapeSetting{{vhsHeight, 3500}},
tapeSettings: []tapeSetting{{vhsHeight, 3700}},
clientOptions: clientOptions{
PamUser: "user-integration-qr-code-screen",
Term: "screen",
Expand Down Expand Up @@ -98,14 +99,14 @@ func TestNativeAuthenticate(t *testing.T) {
},
"Authenticate user switching auth mode": {
tape: "switch_auth_mode",
tapeSettings: []tapeSetting{{vhsHeight, 2350}},
tapeSettings: []tapeSetting{{vhsHeight, 3000}},
},
"Authenticate user switching username": {
tape: "switch_username",
},
"Authenticate user switching to local broker": {
tape: "switch_local_broker",
tapeSettings: []tapeSetting{{vhsHeight, 600}},
tapeSettings: []tapeSetting{{vhsHeight, 700}},
},
"Authenticate user and add it to local group": {
tape: "local_group",
Expand Down Expand Up @@ -152,7 +153,8 @@ func TestNativeAuthenticate(t *testing.T) {
},

"Deny authentication if max attempts reached": {
tape: "max_attempts",
tape: "max_attempts",
tapeSettings: []tapeSetting{{vhsHeight, 700}},
},
"Deny authentication if user does not exist": {
tape: "unexistent_user",
Expand All @@ -167,7 +169,7 @@ func TestNativeAuthenticate(t *testing.T) {

"Prevent preset user from switching username": {
tape: "switch_preset_username",
tapeSettings: []tapeSetting{{vhsHeight, 700}},
tapeSettings: []tapeSetting{{vhsHeight, 800}},
clientOptions: clientOptions{PamUser: "user-integration-pam-preset"},
},

Expand Down Expand Up @@ -247,7 +249,7 @@ func TestNativeChangeAuthTok(t *testing.T) {
},
"Change passwd after MFA auth": {
tape: "passwd_mfa",
tapeSettings: []tapeSetting{{vhsHeight, 900}},
tapeSettings: []tapeSetting{{vhsHeight, 1100}},
},

"Retry if new password is rejected by broker": {
Expand All @@ -266,7 +268,8 @@ func TestNativeChangeAuthTok(t *testing.T) {
},

"Prevent change password if auth fails": {
tape: "passwd_auth_fail",
tape: "passwd_auth_fail",
tapeSettings: []tapeSetting{{vhsHeight, 700}},
},
"Prevent change password if user does not exist": {
tape: "passwd_unexistent_user",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,122 +3,169 @@ Username:
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker:
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
== Password Update (use 'r' to go back) ==
1 - Proceed with password update
2 - Skip
Select action:
>
== Password Update ==
1. Proceed with password update
2. Skip
Or enter 'r' to go back to choose the provider
Choose action:
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
== Password Update (use 'r' to go back) ==
1 - Proceed with password update
2 - Skip
Select action: 1
Insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
>
== Password Update ==
1. Proceed with password update
2. Skip
Or enter 'r' to go back to choose the provider
Choose action:
> 1
Enter your new password (3 days until mandatory) (or enter 'r' to go back to choose the provider
):
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
== Password Update (use 'r' to go back) ==
1 - Proceed with password update
2 - Skip
Select action: 1
Insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
Repeat the previously inserted password or insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
>
== Password Update ==
1. Proceed with password update
2. Skip
Or enter 'r' to go back to choose the provider
Choose action:
> 1
Enter your new password (3 days until mandatory) (or enter 'r' to go back to choose the provider
):
>
Confirm password (or enter 'r' to go back to choose the provider):
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
== Password Update (use 'r' to go back) ==
1 - Proceed with password update
2 - Skip
Select action: 1
Insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
Repeat the previously inserted password or insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
>
== Password Update ==
1. Proceed with password update
2. Skip
Or enter 'r' to go back to choose the provider
Choose action:
> 1
Enter your new password (3 days until mandatory) (or enter 'r' to go back to choose the provider
):
>
Confirm password (or enter 'r' to go back to choose the provider):
>
PAM Authenticate() for user "user-can-reset2" exited with success
PAM AcctMgmt() exited with success
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
== Password Update (use 'r' to go back) ==
1 - Proceed with password update
2 - Skip
Select action: 1
Insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
Repeat the previously inserted password or insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
>
== Password Update ==
1. Proceed with password update
2. Skip
Or enter 'r' to go back to choose the provider
Choose action:
> 1
Enter your new password (3 days until mandatory) (or enter 'r' to go back to choose the provider
):
>
Confirm password (or enter 'r' to go back to choose the provider):
>
PAM Authenticate() for user "user-can-reset2" exited with success
PAM AcctMgmt() exited with success
>
>
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-can-reset2
== Broker selection (use 'r' to go back) ==
1 - local
2 - ExampleBroker
Select broker: 2
Insert 'r' to cancel the request and go back
== Provider selection ==
1. local
2. ExampleBroker
Or enter 'r' to go back to user selection
Choose your provider:
> 2
== Password authentication ==
Enter 'r' to cancel the request and go back to select the authentication method
Gimme your password:
== Password Update (use 'r' to go back) ==
1 - Proceed with password update
2 - Skip
Select action: 1
Insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
Repeat the previously inserted password or insert 'r' to cancel the request and go back
Enter your new password (3 days until mandatory):
>
== Password Update ==
1. Proceed with password update
2. Skip
Or enter 'r' to go back to choose the provider
Choose action:
> 1
Enter your new password (3 days until mandatory) (or enter 'r' to go back to choose the provider
):
>
Confirm password (or enter 'r' to go back to choose the provider):
>
PAM Authenticate() for user "user-can-reset2" exited with success
PAM AcctMgmt() exited with success
>
Expand Down
Loading

0 comments on commit c91dd5b

Please sign in to comment.