Skip to content

feat: rate-limit badges/mfa endpoints and complete OpenAPI docs - #1336

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
walexjnr:feat/rate-limit-and-openapi-badges-mfa
Aug 26, 2026
Merged

feat: rate-limit badges/mfa endpoints and complete OpenAPI docs#1336
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
walexjnr:feat/rate-limit-and-openapi-badges-mfa

Conversation

@walexjnr

Copy link
Copy Markdown
Contributor

Summary

This PR hardens two sensitive endpoint groups with rate limiting and completes OpenAPI documentation on two others.

  • Badges — applies CustomThrottleGuard + documented THROTTLE presets to the state-changing admin handlers (create, seed), returning 429 when exceeded. Read endpoints (badge browsing, leaderboards) stay unthrottled so normal usage is unaffected. ThrottlerModule is wired in GamificationModule, and BadgesController (previously unregistered) is now registered there.
  • MFA — throttles setup/verify/disable (strictest preset on the brute-forceable code paths) via CustomThrottleGuard, and wires ThrottlerModule in AuthModule. Exceeding a limit returns 429.
  • Assessment — fills in the missing 400/401/404 response annotations.
  • Tenancy — adds @ApiResponse (success + 404/400) to every handler, referencing the Tenant schema where applicable.

Limits come from the shared, documented THROTTLE presets rather than hardcoded magic numbers.

Testing

  • pnpm run typecheck
  • pnpm run lint:ci
  • pnpm run build

Issues

Closes #1329
Closes #1323
Closes #1316
Closes #1315

- badges: throttle state-changing admin handlers (create/seed) with
  CustomThrottleGuard + THROTTLE presets; wire ThrottlerModule and register
  BadgesController in GamificationModule. Reads stay unthrottled
- mfa: throttle setup/verify/disable (strictest on code verification) and
  wire ThrottlerModule in AuthModule; document 429
- assessment: add missing 400/401/404 response annotations
- tenancy: add @apiresponse (success + 404/400) to every handler
@walexjnr
walexjnr force-pushed the feat/rate-limit-and-openapi-badges-mfa branch from efe03cf to c8fee45 Compare August 26, 2026 13:12
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@walexjnr Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit dc9836b into rinafcode:main Aug 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants