@tsndr/cloudflare-worker-jwt
Advanced tools
Comparing version 2.5.3 to 2.5.4
@@ -1,2 +0,1 @@ | ||
/// <reference types="@cloudflare/workers-types" /> | ||
/** | ||
@@ -109,3 +108,3 @@ * @typedef JwtAlgorithm | ||
*/ | ||
export declare function sign<Payload = {}, Header = {}>(payload: JwtPayload<Payload>, secret: string | JsonWebKey, options?: JwtSignOptions<Header> | JwtAlgorithm): Promise<string>; | ||
export declare function sign<Payload = {}, Header = {}>(payload: JwtPayload<Payload>, secret: string | JsonWebKey | CryptoKey, options?: JwtSignOptions<Header> | JwtAlgorithm): Promise<string>; | ||
/** | ||
@@ -112,0 +111,0 @@ * Verifies the integrity of the token and returns a boolean value. |
{ | ||
"name": "@tsndr/cloudflare-worker-jwt", | ||
"version": "2.5.3", | ||
"version": "2.5.4", | ||
"description": "A lightweight JWT implementation with ZERO dependencies for Cloudflare Worker", | ||
@@ -33,7 +33,8 @@ "type": "module", | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^4.20240208.0", | ||
"@edge-runtime/vm": "^3.2.0", | ||
"typescript": "^5.3.3", | ||
"vitest": "^1.3.1" | ||
"@cloudflare/workers-types": "^4.20240925.0", | ||
"@edge-runtime/vm": "^4.0.3", | ||
"esbuild": "^0.24.0", | ||
"typescript": "^5.6.2", | ||
"vitest": "^2.1.1" | ||
} | ||
} |
@@ -89,7 +89,7 @@ # Cloudflare Worker JWT | ||
------------------------ | ------------------ | -------- | ----------- | ----------- | ||
`payload` | `object` | required | - | The payload object. To use `nbf` (Not Before) and/or `exp` (Expiration Time) add `nbf` and/or `exp` to the payload. | ||
`secret` | `string` | required | - | A string which is used to sign the payload. | ||
`options` | `string`, `object` | optional | `HS256` | Either the `algorithm` string or an object. | ||
`options.algorithm` | `string` | optional | `HS256` | See [Available Algorithms](#available-algorithms) | ||
`options.keyid` | `string` | optional | `undefined` | The `keyid` or `kid` to be set in the header of the resulting JWT. | ||
`payload` | `object` | required | - | The payload object. To use `nbf` (Not Before) and/or `exp` (Expiration Time) add `nbf` and/or `exp` to the payload. | ||
`secret` | `string`, `JsonWebKey`, `CryptoKey` | required | - | A string which is used to sign the payload. | ||
`options` | `string`, `object` | optional | `HS256` | Either the `algorithm` string or an object. | ||
`options.algorithm` | `string` | optional | `HS256` | See [Available Algorithms](#available-algorithms) | ||
`options.keyid` | `string` | optional | `undefined` | The `keyid` or `kid` to be set in the header of the resulting JWT. | ||
@@ -108,8 +108,8 @@ #### `return` | ||
------------------------ | ------------------ | -------- | ------- | ----------- | ||
`token` | `string` | required | - | The token string generated by `jwt.sign()`. | ||
`secret` | `string` | required | - | The string which was used to sign the payload. | ||
`options` | `string`, `object` | optional | `HS256` | Either the `algorithm` string or an object. | ||
`options.algorithm` | `string` | optional | `HS256` | See [Available Algorithms](#available-algorithms) | ||
`options.clockTolerance` | `number` | optional | `0` | Clock tolerance in seconds, to help with slighly out of sync systems. | ||
`options.throwError` | `boolean` | optional | `false` | By default this we will only throw implementation errors, only set this to `true` if you want verification errors to be thrown as well. | ||
`token` | `string` | required | - | The token string generated by `jwt.sign()`. | ||
`secret` | `string`, `JsonWebKey`, `CryptoKey` | required | - | The string which was used to sign the payload. | ||
`options` | `string`, `object` | optional | `HS256` | Either the `algorithm` string or an object. | ||
`options.algorithm` | `string` | optional | `HS256` | See [Available Algorithms](#available-algorithms) | ||
`options.clockTolerance` | `number` | optional | `0` | Clock tolerance in seconds, to help with slighly out of sync systems. | ||
`options.throwError` | `boolean` | optional | `false` | By default this we will only throw implementation errors, only set this to `true` if you want verification errors to be thrown as well. | ||
@@ -116,0 +116,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17667
5
291