Add a task to clean up expired JWT failure rate limits #380
Merged
jclapis merged 4 commits intomisc-reaudit-fixesfrom Sep 30, 2025
Merged
Add a task to clean up expired JWT failure rate limits #380jclapis merged 4 commits intomisc-reaudit-fixesfrom
jclapis merged 4 commits intomisc-reaudit-fixesfrom
Conversation
Comment on lines
+91
to
+92
| /// limit has been reached. This also defines the interval at which failed | ||
| /// attempts are regularly checked and expired ones are cleaned up. |
Collaborator
There was a problem hiding this comment.
Should we also add this note to config.example.toml?
crates/signer/src/service.rs
Outdated
| .route(STATUS_PATH, get(handle_status)); | ||
|
|
||
| // Run the JWT cleaning task | ||
| //let state = state.clone(); |
Collaborator
There was a problem hiding this comment.
I think this is missed here
Co-authored-by: Manuel Iñaki Bilbao <manuel.bilbao@lambdaclass.com>
ManuelBilbao
approved these changes
Sep 22, 2025
ltitanb
approved these changes
Sep 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a small task that runs in parallel with the Signer server and periodically cleans up the JWT auth failure map, removing any rate limiting entries that have expired. Previously the only way they got removed was if the timed out client tried to request again after the timeout period, so if lots of clients never re-requested then they'd just fill up the map for no reason.
Note that the attempt count isn't timed, so if a client fails 2/3 attempts, then waits 10 minutes, then fails a 3rd attempt, they'll trigger the lockout.