gdm/util: Emit "service-request" signal on every request

GDM doesn't provide any sort of "ack" when a users input
has been acknowledged by the underlying PAM conversation.

We know when a bit of input has been processed when the next
bit of input or output gets requested (or authentication succeeds).

This commit emits a signal any time there is such a request so it
can be connected to (which will later be used to know when to close
a dialog used for Web Login)
This commit is contained in:
Ray Strode 2024-02-06 14:15:12 -05:00
parent 8340638df2
commit a9fe6d1f75

View file

@ -911,6 +911,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
}
_onChoiceListQuery(client, serviceName, promptMessage, list) {
this.emit(`service-request::${serviceName}`);
if (!this.serviceIsForeground(serviceName))
return;
@ -1043,6 +1045,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
}
_onInfo(client, serviceName, info) {
this.emit(`service-request::${serviceName}`);
if (this.serviceIsForeground(serviceName)) {
this._queueMessage(serviceName, info, MessageType.INFO);
} else if (this.serviceIsFingerprint(serviceName)) {
@ -1064,6 +1068,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
}
_onProblem(client, serviceName, problem) {
this.emit(`service-request::${serviceName}`);
const isFingerprint = this.serviceIsFingerprint(serviceName);
if (!this.serviceIsForeground(serviceName) && !isFingerprint)
@ -1100,6 +1106,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
}
_onInfoQuery(client, serviceName, question) {
this.emit(`service-request::${serviceName}`);
if (!this.serviceIsForeground(serviceName))
return;
@ -1107,6 +1115,8 @@ export class ShellUserVerifier extends Signals.EventEmitter {
}
_onSecretInfoQuery(client, serviceName, secretQuestion) {
this.emit(`service-request::${serviceName}`);
if (!this.serviceIsForeground(serviceName))
return;