From 7a73d88aba106d571f121dc3230864c81a76e5db Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Fri, 25 May 2018 19:02:18 +0200 Subject: 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 --- lang/js/src/permittedOperations.js | 95 +++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'lang/js/src/permittedOperations.js') 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': , - // 'isRevoked': , - // 'isExpired': , - // 'armored': , // armored public Key block - // 'timestamp': , // - // 'expires': , - // 'pubkey_algo': TBD // TBD (optional?), - // 'userIds': Array, - // 'subkeys': Array 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 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:[] + } + } } -- cgit v1.2.3