1
0

Compare commits

..

8 Commits

Author SHA1 Message Date
14a9631b8b Added LICENSE 2021-02-08 16:37:41 +01:00
c247675832 Updated license 2021-02-05 13:52:41 +01:00
0d3c7d621a Bump version to test github action 2021-02-04 17:49:09 +01:00
62479197f5 Added workflow to publish package 2021-02-04 17:48:13 +01:00
0a3a9b58d1 Updated readme 2021-02-04 12:42:47 +01:00
959a7c9490 Updated readme 2021-02-04 12:42:33 +01:00
e7be1ed840 Bumped version 2021-02-04 12:20:45 +01:00
f2adb27218 Updated readme 2021-02-04 12:19:52 +01:00
4 changed files with 71 additions and 6 deletions

30
.github/workflows/npm-publish.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Publish NPM Package
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-gpr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Tobias Schneider
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -29,34 +29,48 @@ const payload = jwt.decode(token)
Signs a payload and returns the token.
#### Parameters
`payload`
Can be an object, buffer or a string.
The payload object.
`secret`
A string which is used to sign the payload.
`algorithm` (optional, default: `HS256`)
The algorithm used to sign the payload, possible values: `HS256`(default) or `HS512`
The algorithm used to sign the payload, possible values: `HS256` or `HS512`
### `jwt.verify(token, secret, [algorithm])`
Verifies the integrity of the token and returns a boolean value.
`token`
The token string generated by `jwt.sign()`.
`secret`
A string which is used to sign the payload.
`algorithm` (optional, default: `HS256`)
The algorithm used to sign the payload, possible values: `HS256`(default) or `HS512`
The algorithm used to sign the payload, possible values: `HS256` or `HS512`
### `jwt.decode(token)`
Returns the payload without verifying the integrity of the token.
`token`
The token string generated by `jwt.sign()`.

View File

@@ -1,6 +1,6 @@
{
"name": "@tsndr/cloudflare-worker-jwt",
"version": "1.0.0",
"version": "1.0.5",
"description": "A lightweight JWT implementation with ZERO dependencies for Cloudflare Worker",
"main": "index.js",
"scripts": {
@@ -18,7 +18,7 @@
"cloudflare-worker"
],
"author": "Tobias Schneider",
"license": "ISC",
"license": "MIT",
"bugs": {
"url": "https://github.com/tsndr/cloudflare-worker-jwt/issues"
},