Skip to content

Commit

Permalink
pam/integration-tests: Do not use utf-8 ellipses in broker messages
Browse files Browse the repository at this point in the history
These are not supported by some SSH clients, so better to be reliable
and support characters that are visible the same ways in all the
known cases
  • Loading branch information
3v1n0 committed Nov 13, 2024
1 parent 531a9c5 commit 0a12040
Show file tree
Hide file tree
Showing 41 changed files with 1,378 additions and 1,379 deletions.
41 changes: 20 additions & 21 deletions examplebroker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,18 @@ type userInfoBroker struct {
var (
exampleUsersMu = sync.RWMutex{}
exampleUsers = map[string]userInfoBroker{
"user1": {Password: "goodpass"},
"user2": {Password: "goodpass"},
"user3": {Password: "goodpass"},
"user-mfa": {Password: "goodpass"},
"user-mfa-with-reset": {Password: "goodpass"},
"user-needs-reset": {Password: "goodpass"},
"user-needs-reset2": {Password: "goodpass"},
"user-can-reset": {Password: "goodpass"},
"user-can-reset2": {Password: "goodpass"},
"user-local-groups": {Password: "goodpass"},
"user-pre-check": {Password: "goodpass"},
"user-sudo": {Password: "goodpass"},
"user-mismatching-name": {Password: "goodpass"},
"user1": {Password: "goodpass"},
"user2": {Password: "goodpass"},
"user3": {Password: "goodpass"},
"user-mfa": {Password: "goodpass"},
"user-mfa-with-reset": {Password: "goodpass"},
"user-needs-reset": {Password: "goodpass"},
"user-needs-reset2": {Password: "goodpass"},
"user-can-reset": {Password: "goodpass"},
"user-can-reset2": {Password: "goodpass"},
"user-local-groups": {Password: "goodpass"},
"user-pre-check": {Password: "goodpass"},
"user-sudo": {Password: "goodpass"},
}
)

Expand Down Expand Up @@ -342,7 +341,7 @@ func getSupportedModes(sessionInfo sessionInfo, supportedUILayouts []map[string]
if layout["button"] == "optional" {
allModes["totp_with_button"] = map[string]string{
"selection_label": "Authentication code",
"phone": "+33",
"phone": "+33...",
"wantedCode": "temporary pass",
"ui": mapToJSON(map[string]string{
"type": "form",
Expand All @@ -354,7 +353,7 @@ func getSupportedModes(sessionInfo sessionInfo, supportedUILayouts []map[string]
} else {
allModes["totp"] = map[string]string{
"selection_label": "Authentication code",
"phone": "+33",
"phone": "+33...",
"wantedCode": "temporary pass",
"ui": mapToJSON(map[string]string{
"type": "form",
Expand All @@ -365,21 +364,21 @@ func getSupportedModes(sessionInfo sessionInfo, supportedUILayouts []map[string]
}

allModes["phoneack1"] = map[string]string{
"selection_label": "Use your phone +33",
"phone": "+33",
"selection_label": "Use your phone +33...",
"phone": "+33...",
"ui": mapToJSON(map[string]string{
"type": "form",
"label": "Unlock your phone +33 or accept request on web interface:",
"label": "Unlock your phone +33... or accept request on web interface:",
"wait": "true",
}),
}

allModes["phoneack2"] = map[string]string{
"selection_label": "Use your phone +1",
"phone": "+1",
"selection_label": "Use your phone +1...",
"phone": "+1...",
"ui": mapToJSON(map[string]string{
"type": "form",
"label": "Unlock your phone +1 or accept request on web interface",
"label": "Unlock your phone +1... or accept request on web interface",
"wait": "true",
}),
}
Expand Down
2 changes: 1 addition & 1 deletion pam/integration-tests/gdm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ var testFidoDeviceUILayout = authd.UILayout{

var testPhoneAckUILayout = authd.UILayout{
Type: "form",
Label: ptrValue("Unlock your phone +33 or accept request on web interface:"),
Label: ptrValue("Unlock your phone +33... or accept request on web interface:"),
Content: ptrValue(""),
Wait: ptrValue("true"),
Button: ptrValue(""),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand All @@ -35,8 +35,8 @@ Click on the link received at [email protected] or enter th
1. Password authentication
> 2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand All @@ -49,8 +49,8 @@ Plug your fido device and press with your thumb
1. Password authentication
2. Send URL to [email protected]
> 3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand All @@ -40,23 +40,23 @@ Plug your fido device and press with your thumb
Select your authentication method

> 1. Use your fido device foo
2. Use your phone +33
2. Use your phone +33...
3. Authentication code
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK}
Plug your fido device and press with your thumb
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK}
Unlock your phone +33 or accept request on web interface:
Unlock your phone +33... or accept request on web interface:
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK}
Select your authentication method

> 1. Use your phone +33
> 1. Use your phone +33...
2. Authentication code
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK}
Unlock your phone +33 or accept request on web interface:
Unlock your phone +33... or accept request on web interface:
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd login socket=${AUTHD_TESTS_CLI_AUTHENTICATE_TESTS_SOCK}
PAM Authenticate() for user "user-mfa" exited with success
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Username: user-integration-remember-mode
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Gimme your password
> 1. Password authentication
2. Send URL to [email protected]
3. Use your fido device foo
4. Use your phone +33
5. Use your phone +1
4. Use your phone +33...
5. Use your phone +1...
6. Use a QR code
7. Authentication code
────────────────────────────────────────────────────────────────────────────────
Expand All @@ -40,23 +40,23 @@ Plug your fido device and press with your thumb
Select your authentication method

> 1. Use your fido device foo
2. Use your phone +33
2. Use your phone +33...
3. Authentication code
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK}
Plug your fido device and press with your thumb
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK}
Unlock your phone +33 or accept request on web interface:
Unlock your phone +33... or accept request on web interface:
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK}
Select your authentication method

> 1. Use your phone +33
> 1. Use your phone +33...
2. Authentication code
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK}
Unlock your phone +33 or accept request on web interface:
Unlock your phone +33... or accept request on web interface:
────────────────────────────────────────────────────────────────────────────────
> ./pam_authd passwd socket=${AUTHD_TESTS_CLI_AUTHTOK_TESTS_SOCK}
Enter your new password
Expand Down
Loading

0 comments on commit 0a12040

Please sign in to comment.