Skip to content

Implement Rate Limiting#3

Merged
dotStart merged 18 commits intodevfrom
feature/rate_limit
Apr 12, 2026
Merged

Implement Rate Limiting#3
dotStart merged 18 commits intodevfrom
feature/rate_limit

Conversation

@dotStart
Copy link
Copy Markdown
Owner

@dotStart dotStart commented Apr 11, 2026

Adds support for rate limiting on especially vulnerable endpoints.

Behavior

When a client exceeds the maximum permitted amount of requests for a given endpoint, a 429 Too Many Requests will be returned. Additionally a set of headers is added to responses for affected endpoints:

Header Type Description
X-RateLimit-Limit u32 Total number of permitted requests in a given window
X-RateLimit-Remaining u32 Remaining number of permitted requests in current window
X-RateLimit-NearLimit bool Set if 25% or less of total permitted requests remain
X-RateLimit-RetryAfter u64 Time (in seconds) until requests are permitted again

A new permission called BypassRateLimit is added which allows certain users to exceed the new limitations. By default, this permission is set on the initial user created within the internal user authentication system. When no authentication system is in used, all requests are limited.

Affected Endpoints

  • POST v1/auth/login - 8 request burst, regains 1 per 10 minutes by default
  • POST v1/document - 10 per hour
  • GET v1/document/:id - 30 per hour

@dotStart dotStart added the enhancement New feature or request label Apr 11, 2026
@dotStart dotStart marked this pull request as ready for review April 12, 2026 00:14
@dotStart dotStart merged commit 6eb77a4 into dev Apr 12, 2026
4 checks passed
@dotStart dotStart deleted the feature/rate_limit branch April 12, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant