2.9 KiB
2.9 KiB
Testing the AuthForge GUI
Automated gate
cargo build -p authforge-gui
cargo clippy -p authforge-gui --all-targets -- -D warnings
cargo test -p authforge-gui # 4 error-classifier tests
CI runs all three on every push (libgtk-4-dev / libadwaita-1-dev are installed in the workflow image).
The GUI requires libadwaita 1.5 (Ubuntu 24.04+) for adw::AlertDialog and
the v1_5 feature gate enabled in gui/Cargo.toml. Older distros need the
plan's MessageDialog fallback (not implemented in v1).
Manual smoke
Requires a USB FIDO2 device (Yubikey 5, Solo, etc.) and a built daemon.
# Terminal 1 — daemon (permissive polkit so you don't get prompted).
AUTHFORGE_POLKIT_BYPASS=1 \
AUTHFORGE_POLICY_DIR=/tmp/af/policy.d \
AUTHFORGE_PENDING_DIR=/tmp/af/pending \
AUTHFORGE_USERDB=/tmp/af/users.db \
target/release/authforged
# Terminal 2 — GUI.
target/release/authforge
Walk-through:
- Window opens, Keys tab visible. Empty list with hint text "No keys enrolled yet."
- Click "Enroll a new key" → modal opens with spinner + "Touch your security key now". Touch the device.
- Modal closes, the list re-renders with one row showing the key's short id.
- Click the trash icon on the row → row vanishes immediately.
- Pull the security key, click Enroll → modal opens, swaps to error text ("authenticator: no FIDO2 device found") with a Close button.
- Kill the daemon (
pkill authforged), click Enroll → toast appears with the disconnected message; Retry on the page reconnects after restart.
Policy tab smoke
- Daemon running (same setup as Keys tab smoke).
- Open the GUI → Policy tab. Three rows: gdm-password, sudo, sshd. All start at "Disabled" on a clean system.
- Set sudo to "Required" → Apply. With no enrolled keys you'll see an inline banner "Would lock users out — sudo: : no fido2 enrolled" and a "Force apply" button.
- Click "Force apply" → toast "Policy applied".
- Switch to Keys tab → enroll a Yubikey → switch back. Apply again with sudo=Required → toast "Policy applied" without the banner.
- In another terminal:
authforgectl policy showshould reflect the change. - Run
authforgectl policy set sshd disabled --methods fido2externally → Policy tab refreshes within ~1s (PolicyChanged signal). - Expand "Advanced" — any non-master stack the daemon discovered shows here with the same Disabled/Optional/Required combo.
Recovery tab smoke
- Open Recovery tab. Empty list with hint text.
- Type "alice" in the username row, click "Generate code". Modal opens showing the 8-digit code with a Copy button. Click Copy → paste somewhere to verify clipboard worked.
- Close the modal. List now shows alice with "expires in 7 day(s)".
- Click "Revoke" on alice's row → row vanishes, toast confirms.
- Generate again, then run
authforgectl recovery listexternally — should show alice with the same expiry.