Skip to content

Rate limiting middleware #29

Description

@MrImmortal09

Context

Every write endpoint needs rate limits to prevent abuse. Use Upstash Ratelimit or a simple in-memory + Redis fallback.

Acceptance criteria

  • lib/ratelimit.ts exports a limit(key, config) helper
  • Applied to: magic link requests, sign-up, recovery requests, contact form, job posting, report submission, avatar upload
  • Returns 429 with Retry-After header on breach
  • Logged to AuditLog when a user consistently hits limits

Depends on #1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendServer / database / API workhardinfraCI, hosting, deployment, storagesecuritySecurity hardening

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions