Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServiceLock::IAuthenticator Class Referenceabstract

The credential-verification surface a lock UI (and the lock state machine) drives. More...

#include <PhosphorServiceLock/IAuthenticator.h>

Inheritance diagram for PhosphorServiceLock::IAuthenticator:
[legend]

Signals

void succeeded ()
 The credentials were accepted.
void failed (const QString &reason)
 The credentials were rejected (or the attempt could not complete); reason is a human-readable, non-sensitive explanation.

Public Member Functions

 IAuthenticator (QObject *parent=nullptr)
 ~IAuthenticator () override
virtual void authenticate (const QString &username, const QString &password)=0
 Asynchronously verify password for username.

Detailed Description

The credential-verification surface a lock UI (and the lock state machine) drives.

Verifies a password for a user and reports the outcome asynchronously. The production implementation is PamAuthenticator; tests and the state machine can substitute a fake, so the lock policy is exercisable without a real PAM stack or valid credentials.

Constructor & Destructor Documentation

◆ IAuthenticator()

PhosphorServiceLock::IAuthenticator::IAuthenticator ( QObject * parent = nullptr)
inlineexplicit

◆ ~IAuthenticator()

PhosphorServiceLock::IAuthenticator::~IAuthenticator ( )
override

Member Function Documentation

◆ authenticate()

virtual void PhosphorServiceLock::IAuthenticator::authenticate ( const QString & username,
const QString & password )
pure virtual

Asynchronously verify password for username.

Contract: every authenticate() MUST eventually emit exactly one succeeded or failed. The check runs off the GUI thread so a slow authentication stack never blocks the event loop, and the result signal is delivered on the GUI thread. Implementations should reject (as a failed) a call made while a previous one is still outstanding rather than run two transactions concurrently.

Implemented in PhosphorServiceLock::PamAuthenticator.

◆ failed

void PhosphorServiceLock::IAuthenticator::failed ( const QString & reason)
signal

The credentials were rejected (or the attempt could not complete); reason is a human-readable, non-sensitive explanation.

◆ succeeded

void PhosphorServiceLock::IAuthenticator::succeeded ( )
signal

The credentials were accepted.


The documentation for this class was generated from the following file: