option to remember challenge-response codes

This commit is contained in:
antelle 2020-05-31 10:15:27 +02:00
parent d9258745d0
commit a08e3c7d27
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
5 changed files with 16 additions and 1 deletions

View File

@ -41,6 +41,7 @@ const DefaultAppSettings = {
yubiKeyAutoOpen: false, // auto-load one-time codes when there are open files
yubiKeyMatchEntries: true, // show matching one-time codes in entries
yubiKeyShowChalResp: true, // show YubiKey challenge-response option
yubiKeyRememberChalResp: false, // remember YubiKey challenge-response codes while the app is open
yubiKeyStuckWorkaround: false, // enable the workaround for stuck YubiKeys
canOpen: true, // can select and open new files

View File

@ -609,6 +609,7 @@
"setDevicesYubiKeyChalRespDesc": "It's also possible to use a YubiKey in challenge-response mode, so that a piece of private key used to encrypt files resides on a YubiKey.",
"setDevicesYubiKeyChalRespShow": "Show the option to use a YubiKey when opening files",
"setDevicesYubiKeyStuckWorkaround": "Reconnect the YubiKey if it seems to be stuck during loading",
"setDevicesYubiKeyRememberChalResp": "Remember challenge-response while the app is open",
"setAboutTitle": "About",
"setAboutBuilt": "This app is built with these awesome tools",

View File

@ -5,6 +5,7 @@ import { Events } from 'framework/events';
import { GroupCollection } from 'collections/group-collection';
import { KdbxToHtml } from 'comp/format/kdbx-to-html';
import { GroupModel } from 'models/group-model';
import { AppSettingsModel } from 'models/app-settings-model';
import { IconUrlFormat } from 'util/formatting/icon-url-format';
import { Logger } from 'util/logger';
import { mapObject } from 'util/fn';
@ -346,7 +347,7 @@ class FileModel extends Model {
keyFileChanged: false,
syncing: false
});
if (this.chalResp) {
if (this.chalResp && !AppSettingsModel.yubiKeyRememberChalResp) {
ChalRespCalculator.clearCache(this.chalResp);
}
}

View File

@ -15,6 +15,7 @@ class SettingsDevicesView extends View {
'change .settings__yubikey-auto-open': 'changeYubiKeyAutoOpen',
'change .settings__yubikey-match-entries': 'changeYubiKeyMatchEntries',
'change .settings__yubikey-chalresp-show': 'changeYubiKeyShowChalResp',
'change .settings__yubikey-remember-chalresp': 'changeYubiKeyRememberChalResp',
'change .settings__yubikey-stuck-workaround': 'changeYubiKeyStuckWorkaround'
};
@ -38,6 +39,7 @@ class SettingsDevicesView extends View {
yubiKeyAutoOpen: AppSettingsModel.yubiKeyAutoOpen,
yubiKeyMatchEntries: AppSettingsModel.yubiKeyMatchEntries,
yubiKeyShowChalResp: AppSettingsModel.yubiKeyShowChalResp,
yubiKeyRememberChalResp: AppSettingsModel.yubiKeyRememberChalResp,
yubiKeyStuckWorkaround: AppSettingsModel.yubiKeyStuckWorkaround,
yubiKeyManualLink: Links.YubiKeyManual,
ykmanInstallLink: Links.YubiKeyManagerInstall
@ -70,6 +72,11 @@ class SettingsDevicesView extends View {
this.render();
}
changeYubiKeyRememberChalResp(e) {
AppSettingsModel.yubiKeyRememberChalResp = e.target.checked;
this.render();
}
changeYubiKeyStuckWorkaround(e) {
AppSettingsModel.yubiKeyStuckWorkaround = e.target.checked;
this.render();

View File

@ -47,5 +47,10 @@
{{#if yubiKeyShowChalResp}}checked{{/if}} />
<label for="settings__yubikey-chalresp-show">{{res 'setDevicesYubiKeyChalRespShow'}}</label>
</div>
<div>
<input type="checkbox" class="settings__input input-base settings__yubikey-remember-chalresp" id="settings__yubikey-remember-chalresp"
{{#if yubiKeyRememberChalResp}}checked{{/if}} />
<label for="settings__yubikey-remember-chalresp">{{res 'setDevicesYubiKeyRememberChalResp'}}</label>
</div>
{{/if}}
</div>