Themia 0.5.4 — RateLimitException → 429 + Retry-After (coord #0001)#107
Merged
Conversation
…rSeconds (coord #1) ProblemDetailsMiddleware maps RateLimitException to HTTP 429, emits the Retry-After header and a retryAfterSeconds problem extension. retryAfterSeconds is a domain value, so the exception stays HTTP-agnostic (middleware owns the type->status map). Unblocks the ezy-assets Phase-1 middleware swap (OTP-resend cooldown). Version 0.5.4.
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.
Unblocks ezy-assets Phase-1 middleware swap.
What
Themia.AspNetCore.Exceptions.RateLimitException(message, int retryAfterSeconds, errorCode?, metadata?).ProblemDetailsMiddlewaremaps it to HTTP 429 +Retry-Afterheader +retryAfterSecondsproblem extension.RetryAfterSecondsis a domain value → exception stays HTTP-agnostic (middleware owns the type→status map), consistent with the existing typed exceptions.Why
ezy-assets returns 429 + Retry-After on OTP-resend cooldown; 0.5.3 middleware mapped every ValidationException → 400, regressing those endpoints. coord #1.
Not doing
FluentValidation/ArgumentException → 400 mapping — would couple Themia.AspNetCore to FluentValidation. Consumers throw Themia
ValidationExceptioninstead.Test plan
ProblemDetailsMiddlewareTests: 429 +Retry-After: 30header +retryAfterSeconds: 30+ errorCode. 24/24 net8+net10 green; full solution 0/0.