diff options
author | Maximilian Krambach <[email protected]> | 2018-04-25 13:59:36 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-04-25 13:59:36 +0000 |
commit | 1fb310cabe578625f96fce5d84ff6f0092c08d24 (patch) | |
tree | 7d86ba979e8a4c39fd75ea2f727cce8c169d4e08 /lang/js/src/Keyring.js | |
parent | js: reactivate timeout on connection (diff) | |
download | gpgme-1fb310cabe578625f96fce5d84ff6f0092c08d24.tar.gz gpgme-1fb310cabe578625f96fce5d84ff6f0092c08d24.zip |
js: Configuration and Error handling
--
* gpgmejs_openpgpjs
- unsuported values with no negative consequences can now reject,
warn or be ignored, according to config.unconsidered_params
- cleanup of unsupported/supported parameters and TODOS
* A src/index.js init() now accepts a configuration object
* Errors will now be derived from Error, offering more info and a
stacktrace.
* Fixed Connection.post() timeout triggering on wrong cases
* Added comments in permittedOperations.js, which gpgme interactions
are still unimplemented and should be added next
Diffstat (limited to '')
-rw-r--r-- | lang/js/src/Keyring.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lang/js/src/Keyring.js b/lang/js/src/Keyring.js index ef8028ff..e1f0a50f 100644 --- a/lang/js/src/Keyring.js +++ b/lang/js/src/Keyring.js @@ -21,6 +21,7 @@ import {GPGME_Message} from './Message' import {GPGME_Key} from './Key' import { isFingerprint, isLongId } from './Helpers'; +import { gpgme_error } from './Errors'; export class GPGME_Keyring { constructor(connection){ @@ -37,9 +38,9 @@ export class GPGME_Keyring { if (this._connection.isConnected){ return this._connection; } - return undefined; //TODO: connection was lost! + return gpgme_error('CONN_DISCONNECTED'); } - return undefined; //TODO: no connection there + return gpgme_error('CONN_NO_CONNECT'); } /** @@ -81,9 +82,7 @@ export class GPGME_Keyring { * filters described below. True will filter on the condition, False will * reverse the filter, if not present or undefined, the filter will not be * considered. Please note that some combination may not make sense - * @param {Boolean} flags.defaultKey Only Keys marked as Default Keys * @param {Boolean} flags.secret Only Keys containing a secret part. - * @param {Boolean} flags.valid Valid Keys only * @param {Boolean} flags.revoked revoked Keys only * @param {Boolean} flags.expired Expired Keys only * @param {String} (optional) pattern A pattern to search for, in userIds or KeyIds @@ -108,16 +107,20 @@ export class GPGME_Keyring { } else if (secretflag === false){ anticonditions.push('hasSecret'); } + /** if (flags.defaultKey === true){ conditions.push('isDefault'); } else if (flags.defaultKey === false){ anticonditions.push('isDefault'); } - if (flags.valid === true){ + */ + /** + * if (flags.valid === true){ anticonditions.push('isInvalid'); } else if (flags.valid === false){ conditions.push('isInvalid'); } + */ if (flags.revoked === true){ conditions.push('isRevoked'); } else if (flags.revoked === false){ |