-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: create basic test scaffolding * chore: add runtypes * chore: update eslint rules for spread * feat: add create-signature * docs: insert script type information * refactor: use nicer hex digest encoding for keys * feat: introduce signed headers * docs: update create-signature docs * feat: only allow 64 chars long secret * feat: add request verification * docs: document is-verified-request * chore: expose is-verified-request * test: check that verification fails with different secrets * refactor: get rid of signed headers and use alphabetical order * feat: do not verify old requests * fix: include timestamp in signed headers * docs: improve documentation * docs: improve documentation with categories * test: add ts-ignore for js code testing * refactor: contentful signing header -> contentful header * fix: replace contentful headers with new ones and let validator do the rest This includes: * fix typings to always expect signed headers * streamline test mocks * feat: export also signed headers from sign method * docs: add explanatory comment * feat: handle headers sorted lower than x-contentful * refactor: is verified -> verify
- Loading branch information
Showing
17 changed files
with
996 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
module.exports = { | ||
parser: "@typescript-eslint/parser", | ||
parser: '@typescript-eslint/parser', | ||
env: { | ||
node: true, | ||
mocha: true | ||
mocha: true, | ||
}, | ||
plugins: [ | ||
"@typescript-eslint", | ||
"prettier" | ||
], | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:prettier/recommended", | ||
] | ||
} | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
extends: ['eslint:recommended', 'plugin:prettier/recommended'], | ||
rules: { | ||
'no-unused-vars': ['error', { ignoreRestSiblings: true }], | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"kinds":{"64":"Function"},"rows":[{"id":0,"kind":64,"name":"getManagementToken","url":"globals.html#getmanagementtoken","classes":"tsd-kind-function"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,2.877]],["parent/0",[]]],"invertedIndex":[["getmanagementtoken",{"_index":0,"name":{"0":{}},"parent":{}}]],"pipeline":[]}} | ||
{"kinds":{"64":"Function"},"rows":[{"id":0,"kind":64,"name":"getManagementToken","url":"globals.html#getmanagementtoken","classes":"tsd-kind-function"},{"id":1,"kind":64,"name":"signRequest","url":"globals.html#signrequest","classes":"tsd-kind-function"},{"id":2,"kind":64,"name":"verifyRequest","url":"globals.html#verifyrequest","classes":"tsd-kind-function"}],"index":{"version":"2.3.9","fields":["name","parent"],"fieldVectors":[["name/0",[0,9.808]],["parent/0",[]],["name/1",[1,9.808]],["parent/1",[]],["name/2",[2,9.808]],["parent/2",[]]],"invertedIndex":[["getmanagementtoken",{"_index":0,"name":{"0":{}},"parent":{}}],["signrequest",{"_index":1,"name":{"1":{}},"parent":{}}],["verifyrequest",{"_index":2,"name":{"2":{}},"parent":{}}]],"pipeline":[]}} |
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
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.