aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js (follow)
Commit message (Collapse)AuthorAgeFilesLines
* js: changed verify signature result infosjavascript-bindingMaximilian Krambach2018-08-222-21/+28
| | | | | | | -- * the resulting information of verify now are as documented, and the same as in a decrypt callback
* js: throw errors in sync functionsMaximilian Krambach2018-08-226-61/+76
| | | | | | | | | | | | | | | | -- * synchronous functions should throw errors if something goes wrong, Promises should reject. This commit changes some error cases that returned Error objects instead of throwing them - src/Key.js: createKey() and sync Key.get() throw errors - src/Error.js: Exporting the list of errors to be able to test and compare against these strings - src/Keyring.js: Setting a null value in pattern is not useful, and now caused an error with the new changes. - src/Message.js: createMessage and Message.setParameter now throw errors
* js: update decrypt/verify resultsMaximilian Krambach2018-08-214-12/+49
| | | | | | | | | | -- * src/gpgmejs.js: Decrypt now parses additional optional dec_info information, as well as any verify information, if present * src/permittedOperations: Now decrypt also expect the new return object dec_inf (containing info such as is_mime and file_name)
* js: remove outdated checklistsMaximilian Krambach2018-08-213-36/+0
| | | | | | -- * They are heavily outdated and offer no more useful information
* js: Fix library name mentioned in js MakefilesAndre Heinecke2018-08-214-15/+15
| | | | --
* js: Update extra_dist filesAndre Heinecke2018-08-212-2/+4
| | | | | * lang/js/BrowserTestExtension/Makefile.am, lang/js/Makefile.am (EXTRA_DIST): Update.
* js: Improve READMEAndre Heinecke2018-08-211-9/+36
| | | | * lang/js/README: Clarify structure at the beginning.
* js: set expiry of generatedKey to seconds from nowMaximilian Krambach2018-08-211-6/+4
| | | | | | | | -- * src/Keyring.js: Changed key ecpiration from Date to seconds from creation, as in gpgme. The Date parameter used before was due to a misunderstanding in documentation and requests from potential users.
* js: add option "subkey-algo" to generateKeyMaximilian Krambach2018-08-202-2/+14
| | | | | | | -- * The option was recently added to gpgme-json; this reflects this on javascript side
* js: set expiry date on generateKeyMaximilian Krambach2018-08-201-1/+2
| | | | | | | -- * on the javascript side a Date is expected, gpggme-json expects seconds from 'now'
* js: add and apply eslint rulesMaximilian Krambach2018-08-2025-397/+421
| | | | | | -- * mainly spacing, see .eslintrc.json for details
* js: revert changes to class read/write restrictionMaximilian Krambach2018-08-209-1255/+1164
| | | | | | | | | | | | | | -- * undoes 94ee0988d4eaac27785de6efb7c19ca9976e1e9c and e16a87e83910ebb6bfdc4148369165f121f0997e. I do not fully understand why my approach was bad, but I am not in a position to argue. This revert was requested to me after a review, and I'm doing it in the assumption that more experienced people know better than me. * unittests: Also changed some outdated tests that stopped working since 754e799d35fd62d7a979452f44342934659908c7 (as GPGME_Key is not exported, one cannot check for instanceof in the tests anymore)
* js: decode arriving gpg message stringsMaximilian Krambach2018-08-174-4/+76
| | | | | | | | | -- * Arriving strings (i.e. user id names, error messages) are not always in javascript encoding. This is an attempt to go through the whole gpgme answer (with the exception of payload data) and to fix the encoding of these
* js: correct decrypt result info (2)Maximilian Krambach2018-08-171-3/+3
| | | | | | | -- * the permittedOperation from last commit ended up in the wrong place. sign does not return an additional 'info' object.
* js: expect additional 'info' to arrive on decrypt, tooMaximilian Krambach2018-08-171-1/+2
| | | | | | | -- * src/permittedOperations.js: if decrypt includes a verification, this info needs to pass, too.
* js: decrypt callback is_mime fixMaximilian Krambach2018-08-171-1/+3
| | | | | | | | -- * src/gpgmejs: is_mime should report its' counterpart. Also, file_name is not optional in specification. We'll send null if there is no file_name
* js: don't expire new keys if no date is setMaximilian Krambach2018-08-171-0/+2
| | | | | | | | -- * src/Keyring.js A new Key without expiration is documented as 'never expire' here, and should behave accordingly. This requires sending '0' here.
* js: small documentation fixMaximilian Krambach2018-08-171-6/+7
| | | | --
* js: removed Key.armor property in synchronous useMaximilian Krambach2018-08-174-93/+145
| | | | | | | | | | | | | | -- * src/Key.js The synchronous mode for a Key does not offer an armor/ armored property anymore. This frees up a lot of performance issues, also the armored expoort is expected to change quite often, so a cached version is not advisable. * hasSecret/getHasSecret is now refactored, to reflect their uses. With get('hasSecret') there is a method that fetches the result. * src/Key.js also some refactoring
* js: disallow bulk set data on key from outsideMaximilian Krambach2018-08-173-67/+89
| | | | | | | | | | | | -- * 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.
* js: importKey feedback refactorMaximilian Krambach2018-08-162-33/+32
| | | | | | | -- * src/Keyring.js: An empty result should no longer cause an error, the import feedback summary has been refactored slightly * Browsertests to reflect import feedback change
* js: fix import feedbackMaximilian Krambach2018-08-161-1/+9
| | | | | | -- * src/Keyring.js For Key imports without prepare_sync the import feedback was lacking the summary
* js: avoid async gettersMaximilian Krambach2018-08-161-10/+5
| | | | | | | -- * src/Key.js get armored was returning a promise on async keys. As getters should not do that, it returns an error in this case.
* js: wrong object assumed in recent commitMaximilian Krambach2018-08-161-2/+5
| | | | | | | | -- * src/Keyring.js I wrongly assumed an object to be a GPGME_Key, it was the raw answer from nativeMessaging instead. Now it returns a GPGME_Key again.
* js: get default key fixesMaximilian Krambach2018-08-161-7/+15
| | | | | | | | | | -- * src/Keyring.js: The answer was not parsed correctly, so a config was being ignored. * If no config is set, we return the first non-invalid key with a secret, instead of the first key (which may be e.g. an expired one)
* js: simplify getDefaultKeyMaximilian Krambach2018-08-161-11/+7
| | | | | | | | -- * src/Keyring.js: In case no default Key is set in configuration, only Keys reported as having a secret part should be considered for default Keys, avoiding some extra requests.
* js: consistently return uppercase fingerprintMaximilian Krambach2018-08-164-2/+51
| | | | | | | | | -- * src/Key.js: the fingerprint returned by a Key is now always upper case hex, even if the constructor had lower case input. This is to be more consistent with gpgme and to be more readable and reliable in comparisions.
* js: make init export immutableMaximilian Krambach2018-08-014-4/+102
| | | | | | | | | | -- * src/index.js: The export now uses a freezed Object, which does not allow for simply overwriting the init method by e.g. a third-party library. * BrowsertestExtension: Added some tests trying if decryption of bad data properly fails
* js: fix confusion about loop in last commitMaximilian Krambach2018-07-311-2/+1
| | | | | | | | | -- * The aim is to iterate through the results of the first request (all keys), and then add the propert 'hasSecret' to those that are in the second request (secret Keysring) as well. I messed this up in a recent change, and it escaped testing.
* js: Fix Key.hasSecret answerMaximilian Krambach2018-07-312-5/+7
| | | | | | | -- * The comparision result between Keyring and Keyring with secrets was set to the wrong Object which was not returned at all.
* js: Making objects inmutableMaximilian Krambach2018-07-309-24/+47
| | | | | | | | | | | -- * An Object.freeze should stop any malicious third party from changing objects' methods once the objects are instantiated (see unittest for an approach that would have worked before) - An initialized gpgmejs- object doesn't have a '_Keyring' property anymore (it still has its 'Keyring') - The internal expect='base64' needed to be turned into a method.
* js: fix indentaionMaximilian Krambach2018-07-276-1138/+1150
| | | | | | | -- * doing the indentation changes that became neccesary in the last commit.
* js: change the write access for js class methodsMaximilian Krambach2018-07-2711-394/+403
| | | | | | | | | | | | | | | | | | -- * src/ [Connection, Error, Key, Keyring, MEssage, Signature, gpgmejs]: Functions and values that are not meant to be overwritten are now moved into their constructors, thus eliminating the possibility of overwrites after initialization. * Key: The mode of use (synchronous cached, or async promises) ivs now determined at initialization of that Key. The property Key.isAsync reflects this state. * unittests: fixed old Key syntax for testing. * Message.js isComplete is now a method and not a getter anymore. * Added some startup tests.
* js: clean up test extensionMaximilian Krambach2018-07-277-453/+417
| | | | | | | | | | | -- Tests will now run with one instance of gpgmejs each block, which reduces overhead. Readability is (hopefully) improved), some negative tests are added. There is still a performance problem in base64 encoding/decoding, which causes some tests to fail due to time out.
* js: include armored Key in import callbackMaximilian Krambach2018-07-242-3/+32
| | | | | | | | | -- * The import answer now also directly contains the armored Key as Key property, without need to refresh the Key object created in the answer. This allows for direct comparision of input and output. * BrowserTestExtension: added test for that import callback
* js: Fix wrong encoding in received error messagesMaximilian Krambach2018-07-241-1/+2
| | | | | | | | -- * The libgpg error strings arrive in the browser in a different encoding than used by browsers. Escaping and then decoding it should cover most languages in the supported browsers.
* js: repair BrowserTextExtension testMaximilian Krambach2018-07-201-8/+8
| | | | | | -- * the signed message to verify was signed by a wrong test key
* js: typo in commentMaximilian Krambach2018-07-181-1/+1
| | | | | | -- * Documentation typo that caused jsdoc to exit with an error
* js: fix getkeys with locate optionMaximilian Krambach2018-07-171-2/+4
| | | | | | | | -- * src/Keyring.js: As locate will not work with the "secret" option, the first message cannot be reused, thus a new one must be created here
* js: allow optional Key retrieve pattern to be nullMaximilian Krambach2018-07-121-2/+2
| | | | | | | | | -- * src/Keyring.js: If the optional "pattern" parameter is not to be used, but another, following parameter is, null is more of a convention in javascript, thus both null and undefined are interpreted as "this parameter is not meant to be set".
* js: add with-sec-fprs to getKeysArmoredMaximilian Krambach2018-07-123-15/+60
| | | | | | | | | | | | | | -- * Reflects the changes made to gpgme-json in commit 6cc842c9aa76d19448141e5117ac59452d7a1ff3. - getKeysArmored now returns an object with property 'armored' being the exported armored block, and an (optional) array of fingerprint strings for those keys that can be used in sign/encrypt operations as property 'secret_fprs'. With this, extensions such as mailvelope will be able to bulk fetch all necessary key information in one request.
* js: documentationMaximilian Krambach2018-07-1011-234/+456
| | | | | | | | | | | | | | | | | | -- * Fixed errors: - src/Message.js post(): Set chunksize to defined default value instead of hardcoded - src/Keys.js: added getHasSecret() to refreshKey operation. * Reviewed and updated the documentation * non-documentation changes which do not affect functionality: - src/Errors: disabled a console.warn that is only useful for debugging - helpers.js: renamed "string" to "value" in isFingerprint and isLongId to avoid confusion - src/Keyring: prepare_sync, search are both explicitly set to false by default
* js: fix verify result reportingMaximilian Krambach2018-07-093-2/+88
| | | | | | | | -- * src/Signature.js: searching for overall validity in the "summary" property * BrowsertestExtension: Added two verify tests
* js: reduce request spam at getKeys()Maximilian Krambach2018-07-093-25/+46
| | | | | | | | | | | | | | | | | | -- * Don't make a secret-Key request for each Key retrieved, use one request for all of them instead, and assemble the info later. This should reduce the traffic with large Keyrings. The bulk retrieval for the public armored Keys for each of these Keys is still up to discussion * unittests: disabled assertion for the armored key (as it currently doesn't work) * encryptTest: clarified the mechanism/reason of rejection for Messages >64 MB. This is still a TODO, as this error comes from a different place (the browser itself) and behaves different from the other errors.
* js: properly reject pgp message without signatureMaximilian Krambach2018-07-041-1/+1
| | | | | | | | | -- * A verify at gpgme-json does not fail if there is a valid pgp message that does not include a signature. Instead, the answer will be devoid of signatures. In javascript, the SIG_NO_SIG error should be reported here, but wasn't.
* js: Add jsdoc, update webpack-cli dependencyMaximilian Krambach2018-07-048-78/+123
| | | | | | | | | | | | | | | -- * package.json: - the old webpack-cli version depended on two packages with vulnerabilities, set to minimum version 3.0.8 to fix this (nodesecurity.io/advisories/157, nodesecurity.io/advisories/612) - added License identifier * README: Updated documentation * jsdoc.conf: Added a configuration file for jsdoc * some minor documentation changes, indentations
* js: add Key lookupMaximilian Krambach2018-07-044-4/+33
| | | | | | | | | | | | -- * src/Keyring.js: getKeys() now has the option "search", which will trigger a remote lookup (as configured in gpg) for the string given as pattern. * src/permittedOperations: make use of the new 'locate' option in keylist * DemoExtension: Add a button for lookup, to demonstrate the functionality
* js: fixing Key import/export testMaximilian Krambach2018-07-033-13/+87
| | | | | | | | | | | | | | -- * BrowserTestExtension: - The KeyImport/Export test had some errors, which have now been fixed - The secret key used for the test examples is now placed more prominently, and a clarification added that decrypt tests will not work if this key is not imported. * permittedOperations.js: typo Thanks to [email protected] for the fixes
* js: Demoextension updateMaximilian Krambach2018-06-205-40/+99
| | | | | | | | | -- * src/Signature: typo * src/gpgmejs.js: fixed wrong scope in verification * right now verify does not succeed in the DemoExtension. This is probably a problem in conversion or line ending.
* Prepare build system for gpgme-js and dist itAndre Heinecke2018-06-194-0/+133
| | | | | | | | | | | | | | * configure.ac: Add js as language. * lang/Makefile.am: Add js as dist language. * lang/js/BrowserTestExtension/Makefile.am, lang/js/DemoExtension/Makefile.am, lang/js/Makefile.am, lang/js/src/Makefile.am: Populate EXTRA_DIST variables. -- There is no actual build done yet as there seems to be no way to build it with debian stable tools. This needs clarification.