@fastify/cookie 11.0.1 → 11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/dependabot.yml +41 -1
- package/.github/workflows/ci.yml +12 -2
- package/.github/workflows/lock-threads.yml +19 -0
- package/LICENSE +1 -1
- package/README.md +36 -33
- package/benchmark/cookie-multi.js +1 -1
- package/benchmark/cookie.js +1 -1
- package/eslint.config.js +6 -0
- package/{plugin.js → index.js} +2 -2
- package/package.json +38 -24
- package/signer.js +1 -1
- package/test/cookie.test.js +504 -536
- package/test/signer.test.js +51 -64
- package/types/{plugin.d.ts → index.d.ts} +21 -26
- package/types/index.tst.ts +290 -0
- package/.github/stale.yml +0 -21
- package/.taprc +0 -2
- package/types/plugin.test-d.ts +0 -249
package/.github/dependabot.yml
CHANGED
|
@@ -2,12 +2,52 @@ version: 2
|
|
|
2
2
|
updates:
|
|
3
3
|
- package-ecosystem: "github-actions"
|
|
4
4
|
directory: "/"
|
|
5
|
+
commit-message:
|
|
6
|
+
# Prefix all commit messages with "chore: "
|
|
7
|
+
prefix: "chore"
|
|
5
8
|
schedule:
|
|
6
|
-
interval: "
|
|
9
|
+
interval: "weekly"
|
|
10
|
+
cooldown:
|
|
11
|
+
default-days: 7
|
|
12
|
+
allow:
|
|
13
|
+
- dependency-name: "*"
|
|
14
|
+
update-types:
|
|
15
|
+
- "version-update:semver-major"
|
|
7
16
|
open-pull-requests-limit: 10
|
|
8
17
|
|
|
9
18
|
- package-ecosystem: "npm"
|
|
10
19
|
directory: "/"
|
|
20
|
+
commit-message:
|
|
21
|
+
# Prefix all commit messages with "chore: "
|
|
22
|
+
prefix: "chore"
|
|
11
23
|
schedule:
|
|
12
24
|
interval: "weekly"
|
|
25
|
+
cooldown:
|
|
26
|
+
default-days: 7
|
|
27
|
+
versioning-strategy: "increase-if-necessary"
|
|
28
|
+
allow:
|
|
29
|
+
- dependency-name: "*"
|
|
30
|
+
update-types:
|
|
31
|
+
- "version-update:semver-major"
|
|
32
|
+
ignore:
|
|
33
|
+
# TODO: remove ignore until neostandard support ESLint 10
|
|
34
|
+
- dependency-name: "eslint"
|
|
35
|
+
- dependency-name: "neostandard"
|
|
36
|
+
- dependency-name: "@stylistic/*"
|
|
13
37
|
open-pull-requests-limit: 10
|
|
38
|
+
groups:
|
|
39
|
+
# Production dependencies with breaking changes
|
|
40
|
+
dependencies:
|
|
41
|
+
dependency-type: "production"
|
|
42
|
+
# ESLint related dependencies
|
|
43
|
+
dev-dependencies-eslint:
|
|
44
|
+
patterns:
|
|
45
|
+
- "eslint"
|
|
46
|
+
- "neostandard"
|
|
47
|
+
- "@stylistic/*"
|
|
48
|
+
# TypeScript related dependencies
|
|
49
|
+
dev-dependencies-typescript:
|
|
50
|
+
patterns:
|
|
51
|
+
- "@types/*"
|
|
52
|
+
- "tstyche"
|
|
53
|
+
- "typescript"
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -4,7 +4,6 @@ on:
|
|
|
4
4
|
push:
|
|
5
5
|
branches:
|
|
6
6
|
- main
|
|
7
|
-
- master
|
|
8
7
|
- next
|
|
9
8
|
- 'v*'
|
|
10
9
|
paths-ignore:
|
|
@@ -15,9 +14,20 @@ on:
|
|
|
15
14
|
- 'docs/**'
|
|
16
15
|
- '*.md'
|
|
17
16
|
|
|
17
|
+
# This allows a subsequently queued workflow run to interrupt previous runs
|
|
18
|
+
concurrency:
|
|
19
|
+
group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
|
|
20
|
+
cancel-in-progress: true
|
|
21
|
+
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
|
|
18
25
|
jobs:
|
|
19
26
|
test:
|
|
20
|
-
|
|
27
|
+
permissions:
|
|
28
|
+
contents: write
|
|
29
|
+
pull-requests: write
|
|
30
|
+
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v6
|
|
21
31
|
with:
|
|
22
32
|
license-check: true
|
|
23
33
|
lint: true
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
name: Lock Threads
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: '0 0 1 * *'
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: lock
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
lock-threads:
|
|
16
|
+
permissions:
|
|
17
|
+
issues: write
|
|
18
|
+
pull-requests: write
|
|
19
|
+
uses: fastify/workflows/.github/workflows/lock-threads.yml@v6
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) Fastify
|
|
3
|
+
Copyright (c) 2017-present The Fastify team <https://github.com/fastify/fastify#team>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
# @fastify/cookie
|
|
2
2
|
|
|
3
|
-
](https://github.com/fastify/fastify-cookie/actions/workflows/ci.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/@fastify/cookie)
|
|
5
|
-
[](https://github.com/neostandard/neostandard)
|
|
6
6
|
|
|
7
|
-
A plugin for [Fastify](
|
|
7
|
+
A plugin for [Fastify](https://fastify.dev/) that adds support for reading and
|
|
8
8
|
setting cookies.
|
|
9
9
|
|
|
10
10
|
This plugin's cookie parsing works via Fastify's `onRequest` hook. Therefore,
|
|
11
|
-
you should register it
|
|
11
|
+
you should register it before any other `onRequest` hooks that will depend
|
|
12
12
|
upon this plugin's actions.
|
|
13
13
|
|
|
14
14
|
It is also possible to [import the low-level cookie parsing and serialization functions](#importing-serialize-and-parse).
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
supports both Fastify@1 and Fastify@2.
|
|
18
|
-
`@fastify/cookie` v3 only supports Fastify@2.
|
|
19
|
-
|
|
20
|
-
## Installation
|
|
16
|
+
## Install
|
|
21
17
|
```sh
|
|
22
18
|
npm i @fastify/cookie
|
|
23
19
|
```
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
### Compatibility
|
|
22
|
+
| Plugin version | Fastify version |
|
|
23
|
+
| ---------------|-----------------|
|
|
24
|
+
| `>=10.x` | `^5.x` |
|
|
25
|
+
| `>=7.x <10.x` | `^4.x` |
|
|
26
|
+
| `>=4.x <7.x` | `^3.x` |
|
|
27
|
+
| `>=2.x <4.x` | `^2.x` |
|
|
28
|
+
| `^1.x` | `^1.x` |
|
|
26
29
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
Please note that if a Fastify version is out of support, then so are the corresponding versions of this plugin
|
|
31
|
+
in the table above.
|
|
32
|
+
See [Fastify's LTS policy](https://github.com/fastify/fastify/blob/main/docs/Reference/LTS.md) for more details.
|
|
30
33
|
|
|
31
34
|
## Example
|
|
32
35
|
|
|
@@ -92,7 +95,7 @@ fastify.get('/', (req, reply) => {
|
|
|
92
95
|
## Options
|
|
93
96
|
|
|
94
97
|
- `secret` (`String` | `Array` | `Buffer` | `Object`):
|
|
95
|
-
- A `String` or `Buffer` can be passed to use as secret to sign the cookie using [`cookie-signature`](
|
|
98
|
+
- A `String` or `Buffer` can be passed to use as secret to sign the cookie using [`cookie-signature`](https://www.npmjs.com/package/cookie-signature).
|
|
96
99
|
- An `Array` can be passed if key rotation is desired. Read more about it in [Rotating signing secret](#rotating-secret).
|
|
97
100
|
- More sophisticated cookie signing mechanisms can be implemented by supplying an `Object`. Read more about it in [Custom cookie signer](#custom-cookie-signer).
|
|
98
101
|
|
|
@@ -115,7 +118,7 @@ domain is set, and most clients will consider the cookie to apply to only the cu
|
|
|
115
118
|
|
|
116
119
|
##### encode
|
|
117
120
|
|
|
118
|
-
Specifies a function that will be used to encode a cookie's value. Since value of a cookie
|
|
121
|
+
Specifies a function that will be used to encode a cookie's value. Since the value of a cookie
|
|
119
122
|
has a limited character set (and must be a simple string), this function can be used to encode
|
|
120
123
|
a value into a string suited for a cookie's value.
|
|
121
124
|
|
|
@@ -129,13 +132,13 @@ By default, no expiration is set, and most clients will consider this a "non-per
|
|
|
129
132
|
will delete it on a condition like exiting a web browser application.
|
|
130
133
|
|
|
131
134
|
**Note:** the [cookie storage model specification](https://datatracker.ietf.org/doc/html/rfc6265#section-5.3) states that if both `expires` and
|
|
132
|
-
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients
|
|
135
|
+
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients obey this,
|
|
133
136
|
so if both are set, they should point to the same date and time.
|
|
134
137
|
|
|
135
138
|
##### httpOnly
|
|
136
139
|
|
|
137
140
|
Specifies the `boolean` value for the [`HttpOnly` `Set-Cookie` attribute](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2.6). When truthy,
|
|
138
|
-
the `HttpOnly` attribute is set, otherwise it is not. By default, the `HttpOnly` attribute is not set.
|
|
141
|
+
the `HttpOnly` attribute is set, otherwise, it is not. By default, the `HttpOnly` attribute is not set.
|
|
139
142
|
|
|
140
143
|
**Note:** be careful when setting this to `true`, as compliant clients will not allow client-side
|
|
141
144
|
JavaScript to see the cookie in `document.cookie`.
|
|
@@ -146,7 +149,7 @@ Specifies the `number` (in seconds) to be the value for the [`Max-Age` `Set-Cook
|
|
|
146
149
|
The given number will be converted to an integer by rounding down. By default, no maximum age is set.
|
|
147
150
|
|
|
148
151
|
**Note:** the [cookie storage model specification](https://datatracker.ietf.org/doc/html/rfc6265#section-5.3) states that if both `expires` and
|
|
149
|
-
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients
|
|
152
|
+
`maxAge` are set, then `maxAge` takes precedence, but it is possible not all clients obey this,
|
|
150
153
|
so if both are set, they should point to the same date and time.
|
|
151
154
|
|
|
152
155
|
##### partitioned
|
|
@@ -157,19 +160,19 @@ attribute. When truthy, the `Partitioned` attribute is set, otherwise it is not.
|
|
|
157
160
|
|
|
158
161
|
⚠️ **Warning:** [This is an attribute that has not yet been fully standardized](https://github.com/fastify/fastify-cookie/pull/261#issuecomment-1803234334), and may change in the future without reflecting the semver versioning. This also means many clients may ignore the attribute until they understand it.
|
|
159
162
|
|
|
160
|
-
More information about can be found in [the proposal](https://github.com/privacycg/CHIPS).
|
|
163
|
+
More information about this can be found in [the proposal](https://github.com/privacycg/CHIPS).
|
|
161
164
|
|
|
162
165
|
|
|
163
166
|
##### priority
|
|
164
167
|
|
|
165
|
-
Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute](https://
|
|
168
|
+
Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute](https://datatracker.ietf.org/doc/html/draft-west-cookie-priority-00#section-4.1).
|
|
166
169
|
|
|
167
170
|
- `'low'` will set the `Priority` attribute to `Low`.
|
|
168
171
|
- `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
|
|
169
172
|
- `'high'` will set the `Priority` attribute to `High`.
|
|
170
173
|
|
|
171
174
|
More information about the different priority levels can be found in
|
|
172
|
-
[the specification](https://
|
|
175
|
+
[the specification](https://datatracker.ietf.org/doc/html/draft-west-cookie-priority-00#section-4.1).
|
|
173
176
|
|
|
174
177
|
⚠️ **Warning:** This is an attribute that has not yet been fully standardized, and may change in the future without reflecting the semver versioning. This also means many clients may ignore the attribute until they understand it.
|
|
175
178
|
|
|
@@ -197,7 +200,7 @@ This also means many clients may ignore this attribute until they understand it.
|
|
|
197
200
|
##### secure
|
|
198
201
|
|
|
199
202
|
Specifies the `boolean` value for the [`Secure` `Set-Cookie` attribute](https://datatracker.ietf.org/doc/html/rfc6265#section-5.2.5). When truthy,
|
|
200
|
-
the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set.
|
|
203
|
+
the `Secure` attribute is set, otherwise, it is not. By default, the `Secure` attribute is not set.
|
|
201
204
|
|
|
202
205
|
**Note:** be careful when setting this to `true`, as compliant clients will not send the cookie back to
|
|
203
206
|
the server in the future if the browser does not have an HTTPS connection.
|
|
@@ -231,9 +234,9 @@ with a value of `'foo'` on the cookie path `/`.
|
|
|
231
234
|
Following are _some_ of the precautions that should be taken to ensure the integrity of an application:
|
|
232
235
|
|
|
233
236
|
- It's important to use `options.httpOnly` cookies to prevent attacks like XSS.
|
|
234
|
-
- Use signed cookies (`options.signed`) to ensure they are not getting tampered
|
|
235
|
-
- Use `__Host-` [Cookie Prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie#
|
|
236
|
-
-
|
|
237
|
+
- Use signed cookies (`options.signed`) to ensure they are not getting tampered wit client-side by an attacker.
|
|
238
|
+
- Use `__Host-` [Cookie Prefix](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie#attributes) to avoid Cookie Tossing attacks.
|
|
239
|
+
- It is important to [use HTTPS for your website/app](https://letsencrypt.org/) to avoid a bunch of other potential security issues like [MITM](https://en.wikipedia.org/wiki/Man-in-the-middle_attack) etc.
|
|
237
240
|
|
|
238
241
|
### Clearing
|
|
239
242
|
|
|
@@ -244,7 +247,7 @@ on the cookie path `/`.
|
|
|
244
247
|
|
|
245
248
|
+ `name`: a string name for the cookie to be cleared
|
|
246
249
|
+ `options`: an options object as described in the [cookie serialize][cs]
|
|
247
|
-
documentation.
|
|
250
|
+
documentation. It is optional to pass an `options` object
|
|
248
251
|
|
|
249
252
|
### Manual cookie parsing
|
|
250
253
|
|
|
@@ -279,7 +282,7 @@ fastify.get('/', (req, reply) => {
|
|
|
279
282
|
const result = reply.unsignCookie(req.cookies.myCookie)
|
|
280
283
|
|
|
281
284
|
if (result.valid && result.renew) {
|
|
282
|
-
// Setting the same cookie again, this time plugin will sign it with a new key
|
|
285
|
+
// Setting the same cookie again, this time the plugin will sign it with a new key
|
|
283
286
|
reply.setCookie('myCookie', result.value, {
|
|
284
287
|
domain: 'example.com', // same options as before
|
|
285
288
|
path: '/',
|
|
@@ -317,8 +320,8 @@ fastify.register(require('@fastify/cookie'), {
|
|
|
317
320
|
### Manual cookie unsigning
|
|
318
321
|
|
|
319
322
|
The method `unsignCookie(value)` is added to the `fastify` instance, to the `request` and the `reply` object
|
|
320
|
-
via the Fastify `decorate`, `decorateRequest
|
|
321
|
-
Using it on a signed cookie will call the
|
|
323
|
+
via the Fastify `decorate`, `decorateRequest`, and `decorateReply` APIs, if a secret was provided as an option.
|
|
324
|
+
Using it on a signed cookie will call the provided signer's (or the default signer if no custom implementation is provided) `unsign` method on the cookie.
|
|
322
325
|
|
|
323
326
|
**Example:**
|
|
324
327
|
|
|
@@ -358,9 +361,9 @@ test('Request requires signed cookie', async () => {
|
|
|
358
361
|
});
|
|
359
362
|
```
|
|
360
363
|
|
|
361
|
-
### Manual signing/unsigning with low
|
|
364
|
+
### Manual signing/unsigning with low-level utilities
|
|
362
365
|
|
|
363
|
-
|
|
366
|
+
With Signer:
|
|
364
367
|
|
|
365
368
|
```js
|
|
366
369
|
const { Signer } = require('@fastify/cookie');
|
|
@@ -370,7 +373,7 @@ const signedValue = signer.sign('test');
|
|
|
370
373
|
const {valid, renew, value } = signer.unsign(signedValue);
|
|
371
374
|
```
|
|
372
375
|
|
|
373
|
-
|
|
376
|
+
With sign/unsign utilities:
|
|
374
377
|
|
|
375
378
|
```js
|
|
376
379
|
const { fastifyCookie } = require('@fastify/cookie');
|
|
@@ -382,4 +385,4 @@ const unsignedvalue = fastifyCookie.unsign(signedValue, 'secret');
|
|
|
382
385
|
|
|
383
386
|
## License
|
|
384
387
|
|
|
385
|
-
[MIT
|
|
388
|
+
Licensed under [MIT](./LICENSE).
|
package/benchmark/cookie.js
CHANGED
package/eslint.config.js
ADDED
package/{plugin.js → index.js}
RENAMED
|
@@ -59,7 +59,7 @@ function parseCookies (fastify, request, reply) {
|
|
|
59
59
|
|
|
60
60
|
function onReqHandlerWrapper (fastify, hook) {
|
|
61
61
|
return hook === 'preParsing'
|
|
62
|
-
? function fastifyCookieHandler (fastifyReq, fastifyRes,
|
|
62
|
+
? function fastifyCookieHandler (fastifyReq, fastifyRes, _payload, done) {
|
|
63
63
|
parseCookies(fastify, fastifyReq, fastifyRes)
|
|
64
64
|
done()
|
|
65
65
|
}
|
|
@@ -98,7 +98,7 @@ function setCookies (reply) {
|
|
|
98
98
|
reply[kReplySetCookies].clear()
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
function fastifyCookieOnSendHandler (
|
|
101
|
+
function fastifyCookieOnSendHandler (_fastifyReq, fastifyRes, _payload, done) {
|
|
102
102
|
if (!fastifyRes[kReplySetCookies]) {
|
|
103
103
|
done()
|
|
104
104
|
return
|
package/package.json
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fastify/cookie",
|
|
3
|
-
"version": "11.0
|
|
3
|
+
"version": "11.1.0",
|
|
4
4
|
"description": "Plugin for fastify to add support for cookies",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
|
-
"types": "types/
|
|
7
|
+
"types": "types/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"coverage": "npm run test:unit -- --coverage-report=html",
|
|
10
|
-
"lint": "
|
|
11
|
-
"lint:
|
|
12
|
-
"lint:fix": "standard --fix",
|
|
10
|
+
"lint": "eslint",
|
|
11
|
+
"lint:fix": "eslint --fix",
|
|
13
12
|
"test": "npm run test:unit && npm run test:typescript",
|
|
14
|
-
"test:typescript": "
|
|
15
|
-
"test:unit": "
|
|
13
|
+
"test:typescript": "tstyche",
|
|
14
|
+
"test:unit": "c8 --100 node --test",
|
|
16
15
|
"test:unit:verbose": "npm run test:unit -- -Rspec"
|
|
17
16
|
},
|
|
18
|
-
"precommit": [
|
|
19
|
-
"lint",
|
|
20
|
-
"test"
|
|
21
|
-
],
|
|
22
17
|
"repository": {
|
|
23
18
|
"type": "git",
|
|
24
|
-
"url": "git+
|
|
19
|
+
"url": "git+https://github.com/fastify/fastify-cookie.git"
|
|
25
20
|
},
|
|
26
21
|
"keywords": [
|
|
27
22
|
"fastify",
|
|
@@ -32,6 +27,19 @@
|
|
|
32
27
|
{
|
|
33
28
|
"name": "Salman Mitha",
|
|
34
29
|
"email": "SalmanMitha@gmail.com"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"name": "Matteo Collina",
|
|
33
|
+
"email": "hello@matteocollina.com"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "Manuel Spigolon",
|
|
37
|
+
"email": "behemoth89@gmail.com"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "Frazer Smith",
|
|
41
|
+
"email": "frazer.dev@icloud.com",
|
|
42
|
+
"url": "https://github.com/fdawgs"
|
|
35
43
|
}
|
|
36
44
|
],
|
|
37
45
|
"license": "MIT",
|
|
@@ -39,23 +47,29 @@
|
|
|
39
47
|
"url": "https://github.com/fastify/fastify-cookie/issues"
|
|
40
48
|
},
|
|
41
49
|
"homepage": "https://github.com/fastify/fastify-cookie#readme",
|
|
50
|
+
"funding": [
|
|
51
|
+
{
|
|
52
|
+
"type": "github",
|
|
53
|
+
"url": "https://github.com/sponsors/fastify"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"type": "opencollective",
|
|
57
|
+
"url": "https://opencollective.com/fastify"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
42
60
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@types/node": "^22.0.0",
|
|
61
|
+
"@types/node": "^26.0.1",
|
|
45
62
|
"benchmark": "^2.1.4",
|
|
63
|
+
"c8": "^11.0.0",
|
|
64
|
+
"eslint": "^9.17.0",
|
|
46
65
|
"fastify": "^5.0.0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"tap": "^18.6.1",
|
|
51
|
-
"tsd": "^0.31.1"
|
|
66
|
+
"neostandard": "^0.13.0",
|
|
67
|
+
"sinon": "^22.0.0",
|
|
68
|
+
"tstyche": "^7.0.0"
|
|
52
69
|
},
|
|
53
70
|
"dependencies": {
|
|
54
71
|
"cookie": "^1.0.0",
|
|
55
|
-
"fastify-plugin": "^
|
|
56
|
-
},
|
|
57
|
-
"tsd": {
|
|
58
|
-
"directory": "test"
|
|
72
|
+
"fastify-plugin": "^6.0.0"
|
|
59
73
|
},
|
|
60
74
|
"publishConfig": {
|
|
61
75
|
"access": "public"
|
package/signer.js
CHANGED
|
@@ -36,7 +36,7 @@ function validateAlgorithm (algorithm) {
|
|
|
36
36
|
// validate that the algorithm is supported by the node runtime
|
|
37
37
|
try {
|
|
38
38
|
crypto.createHmac(algorithm, crypto.randomBytes(16))
|
|
39
|
-
} catch
|
|
39
|
+
} catch {
|
|
40
40
|
throw new TypeError(`Algorithm ${algorithm} not supported.`)
|
|
41
41
|
}
|
|
42
42
|
}
|