From 754e799d35fd62d7a979452f44342934659908c7 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Fri, 17 Aug 2018 14:40:27 +0200 Subject: js: disallow bulk set data on key from outside -- * src/Key.js Key class is not exported anymore, as it should not be used directly anywhere. setKeyData is no more a method of the Key, (optional) data are now validated and set on Key creation and on updates, both from within this module, thus no longer exposing setKeyData to the outside. * createKey now gained an optional parameter which allows to set Key data at this point. --- lang/js/src/Helpers.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lang/js/src/Helpers.js') diff --git a/lang/js/src/Helpers.js b/lang/js/src/Helpers.js index 0fd14994..accc2af5 100644 --- a/lang/js/src/Helpers.js +++ b/lang/js/src/Helpers.js @@ -22,7 +22,6 @@ */ import { gpgme_error } from './Errors'; -import { GPGME_Key } from './Key'; /** * Tries to return an array of fingerprints, either from input fingerprints or @@ -50,7 +49,7 @@ export function toKeyIdArray(input){ } } else if (typeof(input[i]) === 'object'){ let fpr = ''; - if (input[i] instanceof GPGME_Key){ + if (input[i].hasOwnProperty('fingerprint')){ fpr = input[i].fingerprint; } else if (input[i].hasOwnProperty('primaryKey') && input[i].primaryKey.hasOwnProperty('getFingerprint')){ -- cgit v1.2.3