-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update crypto HOF to Crypto class (#36)
* feat: add util/crypto.ts for helper methods used by new Crypto class * feat: rewrite crypto.ts functions as Crypto class and use in init * feat: update thrown error name in JSDoc of Webhook.authenticate * test(Crypto): update tests to use new class based instantiation * refactor(Crypto): change constructor to optional `publicSigningKey` Instead of `publicKey`, `publicSigningKey` makes it more obvious of what the use of the key is for. Making constructor optional also allows users of the library to encrypt and decrypt without having to provide a public signing key if they do not want to and still be able to decrypt content without verified fields. Note that the default package initialisation still instantiates the library with a fallback key. * refactor: allow optional constructor params * test(Crypto): add tests for 100% coverage * refactor: update import order * test: remove misleading comment
- Loading branch information
Showing
6 changed files
with
306 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.