Skip to content
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

feat(pam/nativemodel): Do not render qrcode but show uri only in pkexec #405

Merged
merged 3 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pam/integration-tests/native_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func TestNativeAuthenticate(t *testing.T) {
termEnv string
sessionEnv string
pamUser string
pamServiceName string
}{
"Authenticate user successfully": {tape: "simple_auth"},
"Authenticate user successfully with preset user": {tape: "simple_auth_with_preset_user"},
Expand All @@ -42,6 +43,7 @@ func TestNativeAuthenticate(t *testing.T) {
"Authenticate user with qr code in a TTY": {tape: "qr_code", pamUser: "user-integration-qr-code-tty", termEnv: "linux"},
"Authenticate user with qr code in a TTY session": {tape: "qr_code", pamUser: "user-integration-qr-code-tty-session", termEnv: "xterm-256color", sessionEnv: "tty"},
"Authenticate user with qr code in screen": {tape: "qr_code", pamUser: "user-integration-qr-code-screen", termEnv: "screen"},
"Authenticate user with qr code in polkit": {tape: "qr_code", pamUser: "user-integration-qr-code-screen", pamServiceName: "polkit-1"},
"Authenticate user and reset password while enforcing policy": {tape: "mandatory_password_reset"},
"Authenticate user and offer password reset": {tape: "optional_password_reset_skip"},
"Authenticate user and accept password reset": {tape: "optional_password_reset_accept"},
Expand Down Expand Up @@ -102,6 +104,9 @@ func TestNativeAuthenticate(t *testing.T) {
if tc.pamUser != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("AUTHD_PAM_CLI_USER=%s", tc.pamUser))
}
if tc.pamServiceName != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("AUTHD_PAM_CLI_SERVICE=%s", tc.pamServiceName))
}
if tc.termEnv != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("AUTHD_PAM_CLI_TERM=%s", tc.termEnv))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -2506,7 +2507,6 @@ Select action:






────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -2606,6 +2606,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -2663,7 +2664,6 @@ Select authentication mode:






────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -2763,6 +2763,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -2820,7 +2821,6 @@ Select action:






────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -2920,6 +2920,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -2977,7 +2978,6 @@ Select authentication mode:






────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -3077,6 +3077,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -3136,7 +3137,6 @@ Select authentication mode:




────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-integration-switch-mode
Expand Down Expand Up @@ -3234,6 +3234,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -3293,7 +3294,6 @@ Select authentication mode:




────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-integration-switch-mode
Expand Down Expand Up @@ -3391,6 +3391,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -3450,7 +3451,6 @@ Enter your pin code:




────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-integration-switch-mode
Expand Down Expand Up @@ -3548,6 +3548,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -3607,7 +3608,6 @@ PAM AcctMgmt() exited with success
>



────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK} force_native_client=true
Username: user-integration-switch-mode
Expand Down Expand Up @@ -3705,6 +3705,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -3764,5 +3765,4 @@ PAM AcctMgmt() exited with success
>



────────────────────────────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -421,7 +422,6 @@ Select action:






────────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -461,6 +461,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand All @@ -485,6 +486,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -526,8 +528,6 @@ Select action:








Expand Down Expand Up @@ -568,6 +568,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand All @@ -592,6 +593,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -633,8 +635,6 @@ Select action: 1








Expand Down Expand Up @@ -675,6 +675,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand All @@ -699,6 +700,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -740,8 +742,6 @@ PAM AcctMgmt() exited with success








Expand Down Expand Up @@ -782,6 +782,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand All @@ -806,6 +807,7 @@ Scan the qrcode or enter the code in the login page
████▄▄▄▄▄▄▄█▄█▄█▄█▄████▄▄▄▄▄▄████
█████████████████████████████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
https://ubuntu.com
1337

== Qr Code authentication (use 'r' to go back) ==
Expand Down Expand Up @@ -847,8 +849,6 @@ PAM AcctMgmt() exited with success








Expand Down
Loading
Loading