aboutsummaryrefslogtreecommitdiffstats
path: root/lang/js/src/index.js (unfollow)
Commit message (Collapse)AuthorFilesLines
2018-08-20js: add and apply eslint rulesMaximilian Krambach1-5/+5
-- * mainly spacing, see .eslintrc.json for details
2018-08-20js: revert changes to class read/write restrictionMaximilian Krambach1-3/+3
-- * 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)
2018-08-01js: make init export immutableMaximilian Krambach1-4/+3
-- * 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
2018-07-30js: Making objects inmutableMaximilian Krambach1-2/+2
-- * 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.
2018-07-10js: documentationMaximilian Krambach1-2/+2
-- * 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
2018-06-11js: removed configMaximilian Krambach1-40/+6
-- * There is no use for a configuration at the moment, and it seems improbable that this use will arise.
2018-06-06js: code cleanup (eslint)Maximilian Krambach1-10/+15
-- * trying to stick to eslint from now on for readability * As some attribution was lost in previous git confusions, I added my name into some of the licence headers
2018-05-28js: Treat a connection as a gpgme ContextMaximilian Krambach1-1/+1
-- * After an operation a connection should be disconnected again. The "end of operation" is now assumed to be either an error as answer, or a message not including a "more" * GPGME, GPGME_Key, GPGME_Keyring don't require a connection anymore * Message.js: The Message.post() method will open a connection as required
2018-05-25js: use version operation for connection checksMaximilian Krambach1-13/+9
-- * src/Connection.js: isConnected was renamed to checkConnection, that returns a promise with either version information or Boolean * Connection checks have been adapted to reflect that checkConnection returns a Promise * BrowsertestExtension: tests/signTest.js was missing from my last commit
2018-05-23js: remove openpgp modeMaximilian Krambach1-6/+1
-- * After discussion, that mode is not required, and can result in being quite misleading and a maintenance hassle later on.
2018-05-03js: changed Key class stubMaximilian Krambach1-2/+5
-- * src/Key.js: A Key object cannot offer more than basic functionality outside a connection, so it now requires a connection to be present.
2018-04-27js: more testingMaximilian Krambach1-9/+14
-- * Tests: initialization of the two modes, encryption * gpgme.js: reintroduced message check before calling Connection.post() * gpgmejs_openpgp.js: Fixed openpgp mode not passing keys * index.js: fixed some confusion in parseconfig() * Inserted some TODO stubs for missing error handling
2018-04-26js: created TestExtension and smaller fixesMaximilian Krambach1-23/+47
-- * Extensions: - Moved testapplication to Demoextension - Created BrowserTestExtension. Includes mocha and chai. For running tests that cannot be run outside a WebExtension Both Extensions can be found zipped in build/extensions after running build_extensions.sh * Code changes: - src/Config: Place for the configuration - small fixes raised during testing in Keyring.js, Message.js, - src/gpgmejs_openpgpjs.js don't offer direct GpgME object to the outside, as it only causes confusion - index.js init() now checks the config for validity * Tests: - Reordered tests in test/. - Input values are now in a separate file which may be of use for bulk testing * moved the build directory from dist to build
2018-04-25js: Configuration and Error handlingMaximilian Krambach1-4/+5
-- * 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
2018-04-25js: change in Error behaviourMaximilian Krambach1-1/+2
-- * Error objects will now return the error code if defined as error type in src/Errors.js, or do a console.log if it is a warning. Errors from the native gpgme-json will be marked as GNUPG_ERROR.
2018-04-24js: Key object adjustments after discussionMaximilian Krambach1-2/+2
-- * src/aKey.js changed fingerprint to setter (to avoid overwrites) * src/gpgmejs_openpgpjs.js - Added a class GPGME_Key_openpgpmode, which allows for renaming and deviation from GPGME. - renamed classes *_openPGPCompatibility to *_openpgpmode. They are not fully compatible, but only offer a subset of properties. Also, the name seems less clunky
2018-04-24js: change in initialization ancd connection handlingMaximilian Krambach1-3/+37
-- * The Connection will now be started before an object is created, to better account for failures. * index.js: now exposes an init(), which returns a Promise of configurable <GpgME | gpgmeGpgME_openPGPCompatibility> with an established connection. * TODO: There is currently no way to recover from a "connection lost" * Connection.js offers Connection.isConnected, which toggles on port closing.
2018-04-20js: encrypt improvement and decrypt methodMaximilian Krambach1-12/+21
* Compatibility class gpgme_openpgpjs offers an API that should accept openpgpjs syntax, throwing errors if a parameter is unexpected/not implemented * tried to be more generic in methods * waiting for multiple answers if 'more' is in the answer * more consistency checking on sending and receiving * updated the example extension --
2018-04-10js: Initial commit for JavaScript Native Messaging API[email protected]1-0/+14
-- Note this code misses all the legal boilerplate; please add this as soon as possible and provide a DCO so we can merge it into master. I also removed the dist/ directory because that was not source code.