Skip to content

Conversation

@jclapis
Copy link
Collaborator

@jclapis jclapis commented May 28, 2025

This adds a customizable setup to the signer module for rate limiting requests after repeated JWT authorization failures from a client. The implementation is simple: if a client fails JWT authorization X times, they are added to a cooldown and any subsequent requests will be denied until the cooldown completes.

The failure limit is controlled in the [signer] config with jwt_auth_fail_limit, or with the SIGNER_JWT_AUTH_FAIL_LIMIT_ENV environment variable.

The cooldown timeout (in seconds) is controlled in the [signer] config with jwt_auth_fail_timeout_seconds, or with the SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS_ENV environment variable.

As a side-effect, this also adds a unit testing setup for the Signer module since one wasn't in place yet. A test for this rate limiting behavior is included.

ltitanb and others added 28 commits May 13, 2025 17:17
@jclapis jclapis self-assigned this May 28, 2025
@jclapis jclapis added the signer Signer module label May 28, 2025
@jclapis jclapis changed the title Implement rate limiting for JWT auth failures CBST2-06: Implement rate limiting for JWT auth failures Jun 3, 2025
@jclapis jclapis marked this pull request as ready for review June 9, 2025 21:15
@ltitanb ltitanb merged commit a78f57c into main Jul 7, 2025
2 of 3 checks passed
@ltitanb ltitanb deleted the rate-limit-jwt branch July 7, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

signer Signer module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants