Skip to content

test: Rate limit requestMethods is scoped to the configured HTTP methods#10520

Merged
mtrezza merged 1 commit into
parse-community:alphafrom
mtrezza:tests/GHSA-wj53-2vqh-m3gc-v9
Jun 20, 2026
Merged

test: Rate limit requestMethods is scoped to the configured HTTP methods#10520
mtrezza merged 1 commit into
parse-community:alphafrom
mtrezza:tests/GHSA-wj53-2vqh-m3gc-v9

Conversation

@mtrezza

@mtrezza mtrezza commented Jun 20, 2026

Copy link
Copy Markdown
Member

Issue

Rate limit requestMethods is scoped to the configured HTTP methods. The method is matched after any _method body override is resolved, so endpoints reachable via more than one HTTP method (for example /login, which is available via both GET and POST) are only fully covered when all relevant methods are listed (e.g. ['GET', 'POST'], as the built-in beforeLogin limiter does) or when requestMethods is omitted (the default applies to all methods).

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6320ab18-fdab-49d0-b034-933fd784fb78

📥 Commits

Reviewing files that changed from the base of the PR and between 37039b0 and 0925219.

📒 Files selected for processing (4)
  • spec/RateLimit.spec.js
  • src/Options/Definitions.js
  • src/Options/docs.js
  • src/Options/index.js

📝 Walkthrough

Walkthrough

The PR clarifies RateLimitOptions.requestMethods documentation across three option files to specify that HTTP method matching is evaluated after any _method body override is resolved. Four new tests are added covering direct GET, GET+POST, POST with _method: 'GET' override, and default (all methods) scenarios against the /login endpoint.

Changes

requestMethods _method override clarification

Layer / File(s) Summary
requestMethods documentation update
src/Options/Definitions.js, src/Options/docs.js, src/Options/index.js
Updates help text, JSDoc, and inline comment for RateLimitOptions.requestMethods to state that method matching is determined after any _method body override is resolved, with guidance on listing methods explicitly for multi-method endpoints.
requestMethods _method override test coverage
spec/RateLimit.spec.js
Adds four tests: POST-only limiter does not rate-limit direct GET; GET in requestMethods rate-limits direct GET; GET in requestMethods rate-limits POST with _method: 'GET'; omitting requestMethods rate-limits both POST and GET-via-override.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • parse-community/parse-server#10234: Introduced _method override and _batchOriginalMethod handling inside addRateLimit, which is the implementation behavior that the new tests and documentation in this PR explicitly describe and validate.
🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is missing entirely, with no information provided about the issue, approach, or completed tasks. Add a pull request description following the template, including the issue being addressed, the approach taken with the changes, and which tasks were completed.
Engage In Review Feedback ❓ Inconclusive Cannot assess review engagement without access to GitHub PR #10520 review comments; sandboxed environment lacks GitHub API access to verify if feedback exists and whether it was addressed. Need access to GitHub PR #10520 review comments and discussion thread to verify if the user engaged with feedback or addressed it through commits/discussion.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title correctly begins with 'test:' prefix and clearly summarizes the main changes to the test suite covering rate limit requestMethods scoping.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Security Check ✅ Passed PR adds comprehensive tests and documentation for rate limit security with HTTP method overrides. Tests verify that _method POST body parameter overrides are properly evaluated during rate limiting...

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 OpenGrep (1.22.0)

OpenGrep fatal error (exit code 2): [00.12][ERROR]: Error: exception Unix_error: No such file or directory stat spec/RateLimit.spec.js
Raised by primitive operation at UTmp.replace_named_pipe_by_regular_file_if_needed in file "libs/commons/UTmp.ml", line 145, characters 8-27
Called from Scan_CLI.replace_target_roots_by_regular_files_where_needed.(fun) in file "src/osemgrep/cli_scan/Scan_CLI.ml", lines 1086-1087, characters 19-65
Called from List_.fast_map in file "libs/commons/List_.ml", line 81, characters 17-20
Called from Scan_


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (816078f) to head (0925219).
⚠️ Report is 1 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10520   +/-   ##
=======================================
  Coverage   92.65%   92.66%           
=======================================
  Files         193      193           
  Lines       16971    16971           
  Branches      248      248           
=======================================
+ Hits        15725    15726    +1     
+ Misses       1225     1224    -1     
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtrezza mtrezza merged commit 4d3465c into parse-community:alpha Jun 20, 2026
23 of 24 checks passed
@mtrezza mtrezza deleted the tests/GHSA-wj53-2vqh-m3gc-v9 branch June 20, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant