6#include <PhosphorServicePolkit/phosphorservicepolkit_export.h>
27class AuthenticationSession;
52class PHOSPHORSERVICEPOLKIT_EXPORT
PolkitAgent :
public QObject
80 PolkitAgent(QString sessionId, QString objectPath, QObject* parent =
nullptr);
101 [[nodiscard]]
bool busy() const;
112 Q_INVOKABLE
void respond(const QString& response);
153 void onSessionCompleted(
bool gainedAuthorization);
154 void beginRequest(const QString& actionId, const QString& message, const QString& iconName,
155 const QVariantMap& details, const QString& cookie, const QStringList& identities,
156 std::function<
detail::AuthenticationSession*(
int, QObject*)> sessionFactory,
157 std::function<
void()> completeResult);
158 void settleActive(
Phase outcome);
159 void stopSession(
bool cancel);
161 void restartIdentity();
164 std::unique_ptr<Private> d;
One active PolicyKit authentication request, decoded from polkit's initiateAuthentication callback.
Definition AuthRequest.h:33
friend class ListenerImpl
Definition PolkitAgent.h:148
void selectIdentity(int index)
Restart the same request as another offered identity.
AuthRequest * activeRequest() const
The authentication request polkit is currently waiting on, or null.
void activeRequestChanged()
void respond(const QString &response)
Answer the active PAM prompt.
void authenticationCancelled()
The active request ended with none remaining (declined here, or withdrawn by polkit).
static QString defaultObjectPath()
The default D-Bus object path the agent exports at.
friend class PolkitAgentTest
Definition PolkitAgent.h:149
void promptRequested(const QString &prompt, bool echo)
PAM is asking for input: answer it with respond().
void authenticationInfo(const QString &text)
PAM reported an informational message to show the user.
void authenticationError(const QString &text)
PAM reported an error (e.g. "Authentication failure") to show the user.
Phase
Definition PolkitAgent.h:63
void retry()
Retry an unavailable conversation, within the request's attempt limit.
void cancel()
Decline the active request: it completes without authorization and clears (aborting any running PAM c...
void authenticationRequested(PhosphorServicePolkit::AuthRequest *request)
A new authentication request arrived (also reflected in activeRequest).
bool registered() const
True once this process is the registered authentication agent for its session.
PolkitAgent(QObject *parent=nullptr)
Agent for the current session, at the default object path.
void authenticate()
Begin authenticating the active request as its selectedIdentity: starts the PAM conversation,...
bool registerAgent()
Register with polkitd as the session's authentication agent.
void authenticationCompleted(bool gainedAuthorization)
The PAM conversation finished; gainedAuthorization is true when the user authenticated successfully.
Definition PolkitAgent.h:26
Definition AuthRequest.h:13