mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
smartcardManager: Add way to detect if user logged using token
If a user uses a token at login time and they have there system configured to lock on smartcard removal we need to make sure they continue to use the token at unlock time. As a prerequisite for addressing that problem we need to know up front if a user logged in with a token at all. This commit adds the necessary api to detect that case.
This commit is contained in:
parent
bd816834c2
commit
c3737f9546
1 changed files with 15 additions and 0 deletions
|
|
@ -5,6 +5,9 @@ import * as Signals from './signals.js';
|
|||
|
||||
import * as ObjectManager from './objectManager.js';
|
||||
|
||||
const SMARTCARD_SETTINGS_SCHEMA = 'org.gnome.settings-daemon.peripherals.smartcard';
|
||||
const SMARTCARD_REMOVAL_ACTION = 'removal-action';
|
||||
|
||||
const SmartcardTokenIface = `
|
||||
<node>
|
||||
<interface name="org.gnome.SettingsDaemon.Smartcard.Token">
|
||||
|
|
@ -38,6 +41,7 @@ class SmartcardManager extends Signals.EventEmitter {
|
|||
knownInterfaces: [SmartcardTokenIface],
|
||||
onLoaded: this._onLoaded.bind(this),
|
||||
});
|
||||
this._settings = new Gio.Settings({schema_id: SMARTCARD_SETTINGS_SCHEMA});
|
||||
this._insertedTokens = {};
|
||||
this._loginToken = null;
|
||||
}
|
||||
|
|
@ -117,5 +121,16 @@ class SmartcardManager extends Signals.EventEmitter {
|
|||
return false;
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
loggedInWithToken() {
|
||||
if (this._loginToken)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
lockOnRemoval() {
|
||||
return this._settings.get_string(SMARTCARD_REMOVAL_ACTION) === 'lock-screen';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue