JS: Recognize @fastify/rate-limit as a rate limiter#22222
Open
cysp wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for the current scoped Fastify rate-limiter package while preserving legacy compatibility.
Changes:
- Recognizes both Fastify rate-limit package names.
- Adds regression coverage for registration ordering and per-route configuration.
- Documents the analysis improvement.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
MissingRateLimiting.qll |
Adds scoped package recognition. |
tst.js |
Adds independent scoped-package tests. |
MissingRateLimiting.expected |
Updates expected alerts. |
2026-07-22-fastify-rate-limit.md |
Adds the change note. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
js/missing-rate-limitingquery reports Fastify routes protected by@fastify/rate-limitas unprotected.The Fastify rate-limiter model recognizes only the legacy
fastify-rate-limitpackage name. This change adds the current scoped package name while retaining support for the legacy package.Test coverage
The regression test uses independent Fastify applications to verify that:
fastify-rate-limitregistration remains recognized.@fastify/rate-limitregistration protects routes declared after registration.The red/green behavior was verified directly: before the model change, the focused test failed because the query reported the route following
@fastify/rate-limitregistration. After the change, the test passes and only the intentionally unprotected route is reported.Validation
MissingRateLimitquery test: passedgit diff --check: passedDeveloped and validated with assistance from OpenAI Codex.