Setting a new password with a reset link and confirming an e-mail change are rate limited like Forgot password #288

Merged
claude merged 2 commits from feature/285-token-endpoint-rate-limit into develop 2026-11-05 05:51:11 -05:00
Owner

POST /api/auth/reset-password and POST /api/auth/confirm-email-change now use the existing password-reset rate-limit policy, the one Forgot password already uses. Over the limit they answer 429 with Retry-After.

  • The policy is a fixed window per client IP (/64 for IPv6), limited by AdminLoginRateLimitOptions to 5 requests per 5 minutes by default. It counts separately from sign-in, so finishing a reset does not use up sign-in attempts.
  • Forgot password, reset and confirm share one count. A normal flow uses one or two requests. Several users resetting at once behind one NAT address could reach the limit; operators can raise it with the existing settings.
  • No new option and no API document change. README, policy summary and Program.cs comment updated.

Tests:

  • AnonymousTokenEndpointRateLimitTests (2, on a second host with the limiter on and a limit of 2): the third request answers 429 with Retry-After. The shared host keeps the limiter off, so other tests cannot hit it.
  • Both tests were red before the change.
  • Whole Ninlil.Web.Tests 2065, twice.
  • The verifier passed the change and re-ran the red check. Its wrap nits are fixed in the last commit.

Closes #285

🤖 Generated with Claude Code

https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK

`POST /api/auth/reset-password` and `POST /api/auth/confirm-email-change` now use the existing `password-reset` rate-limit policy, the one Forgot password already uses. Over the limit they answer 429 with `Retry-After`. - The policy is a fixed window per client IP (/64 for IPv6), limited by `AdminLoginRateLimitOptions` to 5 requests per 5 minutes by default. It counts separately from sign-in, so finishing a reset does not use up sign-in attempts. - Forgot password, reset and confirm share one count. A normal flow uses one or two requests. Several users resetting at once behind one NAT address could reach the limit; operators can raise it with the existing settings. - No new option and no API document change. README, policy summary and `Program.cs` comment updated. Tests: - `AnonymousTokenEndpointRateLimitTests` (2, on a second host with the limiter on and a limit of 2): the third request answers 429 with `Retry-After`. The shared host keeps the limiter off, so other tests cannot hit it. - Both tests were red before the change. - Whole `Ninlil.Web.Tests` 2065, twice. - The verifier passed the change and re-ran the red check. Its wrap nits are fixed in the last commit. Closes #285 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
Closes #285

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
The rate limit texts in the README and code comments are wrapped like their neighbours
Some checks failed
Build / Pack and Push NuGet Packages (dns-core) (push) Has been skipped
Build / Pack and Push NuGet Packages (dns-server) (push) Has been skipped
Build / Build Binary (linux-amd64) (push) Has been skipped
Build / Build Binary (macos-amd64) (push) Has been skipped
Build / Build Binary (macos-arm64) (push) Has been skipped
Build / Build Binary (linux-arm64) (push) Has been skipped
Build / Build Binary (windows-amd64) (push) Has been skipped
Build / Build Arch Linux Packages (push) Has been skipped
Build / Build and Push Image (push) Has been skipped
Build / Smoke Test the Windows Binary (push) Has been skipped
Build / Build and Test Deb and RPM Packages (push) Has been skipped
Build / Publish Release (push) Has been skipped
Build / Pipeline (push) Failing after 0s
Build / Test .NET (pull_request) Successful in 10m45s
Build / Stage Draft Release (pull_request) Successful in 4s
Build / Pack and Push NuGet Packages (common) (pull_request) Successful in -2m18s
Build / Pack and Push NuGet Packages (dhcp) (pull_request) Successful in -1m45s
Build / Pack and Push NuGet Packages (dns-core) (pull_request) Successful in 1m41s
Build / Pack and Push NuGet Packages (dns-server) (pull_request) Successful in 2m5s
Build / Build Binary (linux-arm64) (pull_request) Successful in 52s
Build / Build Binary (macos-amd64) (pull_request) Successful in 1m52s
Build / Build Binary (macos-arm64) (pull_request) Successful in 1m52s
Build / Build Binary (linux-amd64) (pull_request) Successful in 6m29s
Build / Build Binary (windows-amd64) (pull_request) Successful in 6m53s
Build / Smoke Test the Windows Binary (pull_request) Successful in 17s
Build / Build and Push Image (pull_request) Successful in 15s
Build / Build Arch Linux Packages (pull_request) Successful in 50s
Build / Build and Test Deb and RPM Packages (pull_request) Successful in 1m40s
Build / Publish Release (pull_request) Successful in 2s
Build / Pipeline (pull_request) Successful in 0s
7e7b4e341c
Refs #285

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK
claude merged commit c20fd76c2e into develop 2026-11-05 05:51:11 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lantea-one/ninlil!288
No description provided.