RateLimitingDotNET8: target net10.0, fix rejection status and auth partitioner - #2111
Closed
vladimir-pecanac-main wants to merge 1 commit into
Closed
Conversation
…rtitioner - Retarget app and test projects to net10.0; refresh NuGet package versions. - Set RejectionStatusCode to 429 on the fixed window registration so the documented limiters return 429 on their own instead of the framework default 503. - Replace the blocking GetTokenAsync().Result call in the authorization partitioner with a synchronous read of the authenticated user identity.
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.
Modernizes the
aspnetcore-webapi/RateLimitingDotNET8sample and fixes two defects.net10.0and refresh NuGet package versions.RejectionStatusCodeto 429 on the fixed window registration so the documented fixed/sliding/token/concurrency limiters return 429 on their own, instead of relying on the authorization limiter's global setting (they otherwise fall back to the framework default 503).GetTokenAsync("access_token").Resultcall in the authorization partitioner with a synchronous read ofhttpContext.User.Identity?.Name, avoiding sync-over-async on a per-request delegate and keying partitions on a stable user identity.Build and all 14 tests pass on net10.0.