Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorServicePolkit::AuthRequest Class Reference

One active PolicyKit authentication request, decoded from polkit's initiateAuthentication callback. More...

#include <PhosphorServicePolkit/AuthRequest.h>

Inheritance diagram for PhosphorServicePolkit::AuthRequest:
[legend]

Signals

void selectedIdentityChanged ()
void promptChanged ()
void echoChanged ()

Public Member Functions

QString actionId () const
QString message () const
QString iconName () const
QVariantMap details () const
QString cookie () const
 The opaque polkit cookie that ties this request to its authentication.
QStringList identities () const
 Display strings for the identities the user may authenticate as.
int selectedIdentity () const
 Index into identities of the identity the user will authenticate as (default 0).
void setSelectedIdentity (int index)
 Out-of-range indices are ignored (the current selection is kept).
QString prompt () const
 The current PAM prompt to show the user (e.g.
bool echo () const
 Whether the response to prompt should be echoed (false for passwords).

Detailed Description

One active PolicyKit authentication request, decoded from polkit's initiateAuthentication callback.

Owned by PolkitAgent (its parent). polkit serialises authentication, so at most one of these is active at a time. The descriptive fields are fixed for the life of the request (CONSTANT); only selectedIdentity is writable, so a dialog can offer a chooser when the user may authenticate as more than one identity (usually just themselves, sometimes root).

The request's description and identities are decoded here; the live PAM prompt / echo are updated on this object by the agent as the conversation progresses, and the response goes back through PolkitAgent::respond().

Member Function Documentation

◆ actionId()

QString PhosphorServicePolkit::AuthRequest::actionId ( ) const
inlinenodiscard

◆ cookie()

QString PhosphorServicePolkit::AuthRequest::cookie ( ) const
inlinenodiscard

The opaque polkit cookie that ties this request to its authentication.

◆ details()

QVariantMap PhosphorServicePolkit::AuthRequest::details ( ) const
inlinenodiscard

◆ echo()

bool PhosphorServicePolkit::AuthRequest::echo ( ) const
inlinenodiscard

Whether the response to prompt should be echoed (false for passwords).

◆ echoChanged

void PhosphorServicePolkit::AuthRequest::echoChanged ( )
signal

◆ iconName()

QString PhosphorServicePolkit::AuthRequest::iconName ( ) const
inlinenodiscard

◆ identities()

QStringList PhosphorServicePolkit::AuthRequest::identities ( ) const
inlinenodiscard

Display strings for the identities the user may authenticate as.

◆ message()

QString PhosphorServicePolkit::AuthRequest::message ( ) const
inlinenodiscard

◆ prompt()

QString PhosphorServicePolkit::AuthRequest::prompt ( ) const
inlinenodiscard

The current PAM prompt to show the user (e.g.

"Password: "), updated by the agent as the conversation progresses. Empty until authentication starts.

◆ promptChanged

void PhosphorServicePolkit::AuthRequest::promptChanged ( )
signal

◆ selectedIdentity()

int PhosphorServicePolkit::AuthRequest::selectedIdentity ( ) const
inlinenodiscard

Index into identities of the identity the user will authenticate as (default 0).

authenticate() uses it to build the PAM session.

◆ selectedIdentityChanged

void PhosphorServicePolkit::AuthRequest::selectedIdentityChanged ( )
signal

◆ setSelectedIdentity()

void PhosphorServicePolkit::AuthRequest::setSelectedIdentity ( int index)

Out-of-range indices are ignored (the current selection is kept).


The documentation for this class was generated from the following file:
  • phosphor-service-polkit/include/PhosphorServicePolkit/AuthRequest.h