Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ratelimits: Provide verbose user-facing rate limit errors #7653

Merged
merged 7 commits into from
Aug 12, 2024

Conversation

beautifulentropy
Copy link
Member

@beautifulentropy beautifulentropy commented Aug 9, 2024

  • Instruct callers to call *Decision.Result() to check the result of rate limit transactions
  • Preserve the Transaction within the resulting *Decision
  • Generate consistently formatted verbose errors using the metadata found in the *Decision
  • Fix broken key-value rate limits integration test in TestDuplicateFQDNRateLimit

Fixes #7577

@beautifulentropy beautifulentropy force-pushed the ratelimits-verbose-errors branch 2 times, most recently from df0c14e to 851b812 Compare August 9, 2024 16:29
@beautifulentropy beautifulentropy marked this pull request as ready for review August 9, 2024 17:04
@beautifulentropy beautifulentropy requested a review from a team as a code owner August 9, 2024 17:04
Copy link
Contributor

github-actions bot commented Aug 9, 2024

@beautifulentropy, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values.

ratelimits/limiter.go Outdated Show resolved Hide resolved
ratelimits/limiter.go Outdated Show resolved Hide resolved
ratelimits/limiter.go Outdated Show resolved Hide resolved
ratelimits/limiter.go Outdated Show resolved Hide resolved
ratelimits/limiter.go Outdated Show resolved Hide resolved
test/integration/ratelimit_test.go Show resolved Hide resolved
ratelimits/gcra.go Outdated Show resolved Hide resolved
@beautifulentropy beautifulentropy merged commit 6a3e9d7 into main Aug 12, 2024
13 checks passed
@beautifulentropy beautifulentropy deleted the ratelimits-verbose-errors branch August 12, 2024 20:14
beautifulentropy added a commit that referenced this pull request Aug 15, 2024
…rictive (#7667)

Fix a bug added in #7653 which sometimes attributed an "Allowed"
`Transaction` to the amalgamated "Denied" `*Decision`. Instead, always
return the most restrictive `*Decision` in the batch.

Remove a debug `fmt.Printf()` call added in #7653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants