Skip to content

Commit 07037f0

Browse files
committed
chore: add inline comment about dos
1 parent dfff279 commit 07037f0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ const fp = require('fastify-plugin')
44
const verifyBearerAuthFactory = require('./lib/verify-bearer-auth-factory')
55
const { FST_BEARER_AUTH_INVALID_HOOK, FST_BEARER_AUTH_INVALID_LOG_LEVEL } = require('./lib/errors')
66

7+
/**
8+
* Hook type limited to 'onRequest' and 'preParsing' to protect against DoS attacks.
9+
* @see {@link https://github.com/fastify/fastify-auth?tab=readme-ov-file#hook-selection | fastify-auth hook selection}
10+
*/
711
const validHooks = new Set(['onRequest', 'preParsing'])
812

913
function fastifyBearerAuth (fastify, options, done) {

0 commit comments

Comments
 (0)