diff options
author | Maximilian Krambach <[email protected]> | 2018-05-25 17:02:18 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-05-25 17:02:18 +0000 |
commit | 7a73d88aba106d571f121dc3230864c81a76e5db (patch) | |
tree | 171dafc5a054a725dafe317fcca7b9d0521637e1 /lang/js/src/permittedOperations.js | |
parent | js: use version operation for connection checks (diff) | |
download | gpgme-7a73d88aba106d571f121dc3230864c81a76e5db.tar.gz gpgme-7a73d88aba106d571f121dc3230864c81a76e5db.zip |
js: implement Key handling (1)
--
* Keys can now be queried for information. Onne version queries gnug
directly (asynchronous Promise in javascript terms), the cached
version refreshes on demand.
* Small fixes:
src/Connection.js joins answers that stay json properly now
Diffstat (limited to 'lang/js/src/permittedOperations.js')
-rw-r--r-- | lang/js/src/permittedOperations.js | 95 |
1 files changed, 57 insertions, 38 deletions
diff --git a/lang/js/src/permittedOperations.js b/lang/js/src/permittedOperations.js index aa02a8bc..42213ec3 100644 --- a/lang/js/src/permittedOperations.js +++ b/lang/js/src/permittedOperations.js @@ -172,49 +172,57 @@ export const permittedOperations = { } }, - - /** TBD: querying the Key's information (keyinfo) - TBD name: { - required: { - 'fingerprint': { - allowed: ['string'] - }, - }, - answer: { - type: ['TBD'], - data: [], - params: ['hasSecret','isRevoked','isExpired','armored', - 'timestamp','expires','pubkey_algo'], - infos: ['subkeys', 'userIds'] - // {'hasSecret': <Boolean>, - // 'isRevoked': <Boolean>, - // 'isExpired': <Boolean>, - // 'armored': <String>, // armored public Key block - // 'timestamp': <Number>, // - // 'expires': <Number>, - // 'pubkey_algo': TBD // TBD (optional?), - // 'userIds': Array<String>, - // 'subkeys': Array<String> Fingerprints of Subkeys - // } - }*/ - - /** - listkeys:{ - required: {}; + keylist:{ + required: {}, optional: { - 'with-secret':{ + 'protocol': { + allowed: ['string'], + allowed_data: ['cms', 'openpgp'] + }, + 'chunksize': { + allowed: ['number'], + }, + // note: For the meaning of the flags, refer to + // https://www.gnupg.org/documentation/manuals/gpgme/Key-Listing-Mode.html + 'secret': { allowed: ['boolean'] - },{ - 'pattern': { - allowed: ['string'] + }, + 'extern': { + allowed: ['boolean'] + }, + 'local':{ + allowed: ['boolean'] + }, + 'sigs':{ + allowed: ['boolean'] + }, + 'notations':{ + allowed: ['boolean'] + }, + 'tofu': { + allowed: ['boolean'] + }, + 'ephemeral': { + allowed: ['boolean'] + }, + 'validate': { + allowed: ['boolean'] + }, + // 'pattern': { TODO + // allowed: ['string'] + // }, + 'keys': { + allowed: ['string'], + array_allowed: true } }, - answer: { - type: ['TBD'], - infos: ['TBD'] - // keys: Array<String> Fingerprints representing the results + answer: { + type: [], + data: [], + params: [], + infos: ['keys'] + } }, - */ /** importkey: { @@ -256,4 +264,15 @@ export const permittedOperations = { * TBD key modification? * encryptsign: TBD */ + + version: { + required: {}, + optional: {}, + answer: { + type: [''], + data: ['gpgme'], + infos: ['info'], + params:[] + } + } } |