(port)
| 26 | |
| 27 | export default class AppController extends SubController { |
| 28 | constructor(port) { |
| 29 | super(port); |
| 30 | // register event handlers |
| 31 | this.on('get-prefs', () => prefs.prefs); |
| 32 | this.on('set-prefs', this.updatePreferences); |
| 33 | this.on('get-session-pref', ({key}) => prefs.getSessionPref(key)); |
| 34 | this.on('set-session-pref', ({key, value}) => prefs.setSessionPref(key, value)); |
| 35 | this.on('decrypt-file', this.decryptFile); |
| 36 | this.on('decrypt-message', this.decryptMessage); |
| 37 | this.on('decrypt-message-init', this.initDecryptMessage); |
| 38 | this.on('decrypt-message-popup', this.openPopupDecryptMessage); |
| 39 | this.on('encrypt-message', this.encryptMessage); |
| 40 | this.on('encrypt-file', this.encryptFile); |
| 41 | this.on('getWatchList', prefs.getWatchList); |
| 42 | this.on('getKeys', async ({keyringId}) => (await keyringById(keyringId)).getKeys()); |
| 43 | this.on('removeKey', this.removeKey); |
| 44 | this.on('revokeKey', this.revokeKey); |
| 45 | this.on('get-keyserver-sync', this.getKeyServerSync); |
| 46 | this.on('sync-keyserver', this.syncKeyServer); |
| 47 | this.on('remove-user', this.removeUser); |
| 48 | this.on('revoke-user', this.revokeUser); |
| 49 | this.on('add-user', this.addUser); |
| 50 | this.on('set-key-expiry-date', this.setKeyExDate); |
| 51 | this.on('set-key-password', this.setKeyPwd); |
| 52 | this.on('validate-key-password', this.validateKeyPassword); |
| 53 | this.on('getArmoredKeys', this.getArmoredKeys); |
| 54 | this.on('getKeyDetails', this.getKeyDetails); |
| 55 | this.on('generateKey', this.generateKey); |
| 56 | this.on('importKeys', this.importKeys); |
| 57 | this.on('set-watch-list', this.setWatchList); |
| 58 | this.on('get-all-keyring-attr', getAllKeyringAttr); |
| 59 | this.on('set-keyring-attr', ({keyringId, keyringAttr}) => setKeyringAttr(keyringId, keyringAttr)); |
| 60 | this.on('get-active-keyring', getActiveKeyringId); |
| 61 | this.on('set-active-keyring', ({keyringId}) => setActiveKeyringId(keyringId)); |
| 62 | this.on('delete-keyring', this.deleteKeyring); |
| 63 | this.on('get-ui-log', ({securityLogLength}) => uiLog.getLatest(securityLogLength)); |
| 64 | this.on('get-version', getVersion); |
| 65 | this.on('get-all-key-data', () => getKeyData({allUsers: false})); |
| 66 | this.on('open-tab', ({url}) => mvelo.tabs.create(url)); |
| 67 | this.on('get-app-data-slot', ({slotId}) => getAppDataSlot(slotId)); |
| 68 | this.on('get-gnupg-status', () => Boolean(gpgme)); |
| 69 | this.on('reload-keystore', this.reloadKeystore); |
| 70 | this.on('read-amored-keys', this.readArmoredKeys); |
| 71 | this.on('key-lookup', this.keyLookup); |
| 72 | this.on('keyreg-source-labels', options => keyRegistry.getSourceLabels(options)); |
| 73 | this.on('get-default-key-fpr', ({keyringId}) => getDefaultKeyFpr(keyringId)); |
| 74 | this.on('has-usable-private-key', ({keyringId}) => hasUsablePrivateKey(keyringId)); |
| 75 | this.on('get-signing-keys', async ({keyringId}) => (await keyringById(keyringId)).getValidSigningKeys()); |
| 76 | this.on('get-oauth-tokens', this.getOAuthTokens); |
| 77 | this.on('remove-oauth-token', this.removeOAuthToken); |
| 78 | this.on('authorize-gmail', this.authorizeGmail); |
| 79 | this.on('cancel-authorize-gmail', this.cancelAuthorizeGmail); |
| 80 | this.on('check-license', this.checkLicense); |
| 81 | this.on('grant-consent', ({campaignId}) => this.grantCampaignConsent(campaignId)); |
| 82 | this.on('deny-consent', ({campaignId}) => denyCampaign(campaignId)); |
| 83 | this.on('get-consent', ({campaignId}) => isCampaignCurrentlyGranted(campaignId)); |
| 84 | } |
| 85 |
nothing calls this directly
no test coverage detected