44688453d7c66feeb2e6cde63624ffe3701bf42b
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
80af76fb15 |
Password dialog rebuilt: a separate polkit agent, one state machine, explicit errors
CI / test (push) Canceled after 21m14s
The first version ran polkit registration, polkit-agent-helper-1, the PAM conversation and the drawing inside the compositor's frame loop, with overlapping state in two layers. A helper that quit before asking was taken for a wrong password and restarted in a loop that wiped the field (typing seemed dead), a refused registration quietly started a third-party agent, and the dialog and the Face unlock window each grabbed the keyboard. Now: - chandra-polkit-agent (compositor/authagent, /usr/local/lib/chandra) does polkit and PAM. Each request runs one state machine (polkit/machine.mbt: starting, asking, checking, failed, done). A check that quits or can't start is Failed with the reason and waits for Try again; only a wrong password starts the next check by itself. It logs each step to stderr (the session log), never the typed text. - The compositor starts it on a socket pair and only draws what it says (host/auth.mbt, auth_draw.mbt; line protocol in polkit/wire.mbt). One input owner (grab_input): the dialog, else the Face unlock window. - No silent fallback: if the agent can't run, polkit refuses it, polkit doesn't answer in 10 s, or it dies, a notice on screen says why (a crash after it ran restarts it, up to 3 times, and says so). The third-party agent runs only when the Settings switch is off. - chandra-ctl auth-demo [password|face|face-ok|die|slow|users] shows the real dialog with a pretend check (password "demo"), no root needed; chandra-ctl auth-status says whether the agent is registered. - just install builds and installs the agent (just auth-agent). Tests: polkit_test (link, machine, view, helper Gone) and auth_test end to end through handle_input: the agent loop in-process against a mock polkit on a private dbus-daemon plus a mock helper, and the real agent program spawned by the compositor (demo, and registered with the mock polkit). Typing on a real xkb keymap, wrong password, cancel, withdrawal, helper quitting early or missing, polkit refusing, agent not starting or crashing, demo modes, Face unlock Apply. 170/170 host and 20/20 polkit tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hgkRPrAzXECBUGmNEE |
||
|
|
2c2ce3f913 |
Face unlock window steps aside while Apply asks for the password
CI / test (push) Canceled after 3m23s
After Apply the window kept the keyboard and the pointer and its dimmed card covered the screen, so a password dialog that isn't Chandra's own (another polkit agent's window) couldn't be reached. While Apply waits, the window now shows only a note at the top and takes no input. A refused or cancelled password brings it back with the snaps and marks kept (chandra-face camera restarts the camera instead of exiting) and says so. Test: snaps, Enter, the password dialog gets typing (Space no longer snaps underneath) and the Authenticate click, then the root step finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf |
||
|
|
fa634956cc |
auth dialog: keep typed text when the polkit helper ends before asking
CI / test (push) Successful in 2m1s
If polkit-agent-helper-1 exited (or the socket service refused) before sending a PAM prompt, the dialog counted it as a wrong password, wiped the field and restarted the helper immediately, in a tight loop, so typing seemed to do nothing. Now such an early end keeps what was typed, shows why, and retries after 1s/2s/4s (then on Enter). Every helper event and route is logged as "chandra: polkit helper ..." (never the typed text). Adds an end-to-end test that types through handle_input with a real xkbcommon keymap, including Shift, across a helper that dies at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hgkRPrAzXECBUGmNEE |
||
|
|
932fca627e |
Face unlock: a Howdy-style PAM module, shown in the password dialog and set up in Settings
CI / test (push) Successful in 2m6s
- face/pam_chandra_face.so (`-auth sufficient`): runs `chandra-face compare` as root with a clean
environment, forwards what it says as PAM_TEXT_INFO / PAM_ERROR_MSG, and maps its exit status
to success / auth error / unavailable, so the password always still works. Skips remote
sessions (PAM_RHOST, SSH_CONNECTION), a closed lid and users without faces; refuses a helper
that isn't root's; kills one that hangs (timeout + 6 s).
- face/chandra-face (Python + OpenCV): YuNet finds the face, SFace embeds it, cosine similarity
against the enrolled embeddings (threshold 0.42, two matching frames, dark IR warm-up frames
skipped, optional require_ir). enroll / list / remove / clear / test / status / pam
enable|disable / fetch-models (sha256-pinned opencv_zoo models). Embeddings only, in
/var/lib/chandra-face/USER/faces.json (root, 0600); labels in faces.list (0644). Store, config
and models must be root's and not writable by others. Root commands re-run through run0 (or
pkexec), so polkit asks first. Settings in /etc/chandra/face.conf.
- `just install-face [--pam]`, `just uninstall-face [--purge]` (face/install.py; uninstall takes
the module out of every PAM service first). `pam enable` inserts before the first auth or
@include line (Debian's sudo has only @include common-auth), keeping a .bak.
- Password dialog: a face row ("Looking for your face…" with a sweeping ring, "Face
recognized", or why not, "Type your password instead"); typing and Enter during the scan go in
when PAM asks for the password. Howdy's pam_howdy.so messages are understood too.
- Settings > Session > Face unlock: "Use my face for passwords" (polkit-1 + sudo), the enrolled
faces (Remove takes a second click), "Add a face…", and the tool's progress. New `face-unlock`
capability: tables 24 (status) and 25 (faces), request 44, in the wasmer/wasmtime stub, the Rust
host, the MoonBit wasmhost and chandra:host/plasmoids. compositor/shell/face.mbt runs the tool
on a socket so the compositor never waits.
- Tests: face/test_face.py (fake camera of PGM frames + fake recognizer; --pam builds the module
and runs it through pamtester), dialog states and message parsing (polkit_test), the dialog via
a mock helper (auth_test, shots 14/15), Settings against a fake chandra-face (face_test).
scripts/test.sh runs them (compositor/polkit was missing from its native list), CI installs
libpam0g-dev + pamtester. Also regenerated two stale desktop-module bindings (doc comments).
- docs/face-unlock.md, including the limits of 2D face recognition.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hhiJfJNAYqWzQiuKMf
|
||
|
|
0feea23a06 |
Password dialog: Chandra is its own polkit agent, drawn in the shell layer
CI / test (push) Failing after 18s
run0, pkexec and other polkit prompts used whatever third-party agent was
installed: a plain toolkit window saying "start transient unit
'run-p15802-i1990.service'". The compositor now registers as the session's
polkit authentication agent and asks in its own dialog:
- a centered card over a dimmed screen, above all windows and client menus,
themed (dark/light follow the Dark mode switch), keyboard-first: Enter,
Esc, Tab order, Alt+R show/hide, Alt+D details, Ctrl+U clear
- for run0 it shows the command it will run ("gparted /dev/sda", as root)
from run0's command line (pid from polkit's details or the unit name),
pkexec's command from its details, polkit's message otherwise; Details
lists the requester, target user, unit and action id
- account picker when several admins can answer (group members expanded)
- the PAM conversation through polkit-agent-helper-1: polkit 126's socket
first, else the setuid helper on a socket pair (new sys spawn-socket on the
native, Rust and MoonBit hosts); password, echo-on prompts, info (fingerprint)
and errors (faillock) shown as they come; wrong password shakes and retries;
spinner while PAM checks; Caps Lock warning
- typing through the clients' xkb keymap (groups, Shift, AltGr, Caps Lock),
US layout when there is none
- no client has keyboard focus or input while it is up; the password is
wiped after sending and never logged
Settings > Session > "Chandra password dialog" (state.edn :auth-agent
:system when off) switches back to the third-party agent, which
chandra-session now finds and the compositor starts (also when polkit
refuses our agent). Tests: polkit_test (keymaps, helper protocol, run0
parsing, dialog states, the socket-pair route) and auth_test (mock polkit
Authority on a private dbus-daemon, mock helper; CHANDRA_AUTH_SHOTS writes
a PNG per state). Docs: docs/auth-dialog.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hgkRPrAzXECBUGmNEE
|