auth: add Visage face authentication module#1010
Open
SomeCodecat wants to merge 1 commit into
Open
Conversation
|
|
||
| void CVisage::init() { | ||
| m_sPrompt = m_sReadyMessage; | ||
| m_thread = std::thread([this] { workerLoop(); }); |
Collaborator
There was a problem hiding this comment.
The fingerprint auth implementation doesn't need it's own thread, because it uses async method calls.
Is there a reason visage needs a thread?
I would prefer if visage would also handle it like that.
But for this to work, we need to pull out the dbus connection object from fingerprint (add g_dbus) so that we can reuse the same connection here and only need one connection.
Collaborator
There was a problem hiding this comment.
Let me know if you would be up to pull out the dbus connection from fingerprint. If not I can do it and you can rebase your branch on top of it.
Author
|
Force-pushed
Tested locally end-to-end (happy path, nudge-on-Enter, visaged stop/start, suspend/resume). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a parallel face-auth backend that talks directly to Visage's system D-Bus interface (
org.freedesktop.Visage1) instead of going throughpam_visage.so. This mirrors the approach taken for fingerprint in #514: PAM modules are evaluated as soon aspam_authenticatestarts, which means the face check fires the instant the lock appears and unlocks immediately if a face is in front of the camera. Direct D-Bus integration lets us add a smallstart_delayafter lock and gate retries on a condvar so submitting input nudges a fresh attempt.A worker thread polls
Verify(username)and on a match callsg_pAuth->enqueueUnlock(). PAM continues to run in parallel as before, so password unlock works unchanged.Disabled by default. Enable with
auth.visage.enabled = 1. Other knobs areready_message,retry_delay(default 500 ms), andstart_delay(default 2000 ms).Verify calls are bounded with
withTimeout(30s)so a hung daemon can't deadlockterminate(). On D-Bus errors the worker backs off exponentially up to 5 s and never permanently gives up — visaged commonly takes 30–90 s to come back after a hibernate resume on Surface devices, and the user may also be waiting onvisage-resume.serviceto restart it. If visaged isn't running at hyprlock start, the worker retries the connection every 2 s.I did not add a
PrepareForSleephandler like fingerprint has. The retry loop recovers organically once visaged is reachable again, so it didn't seem worth the extra dbus connection. Happy to add it if you'd rather mirror the fingerprint structure exactly.