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

API Refactor: fix rate limiter warning when handler not invoked #1791

Merged
merged 2 commits into from
Aug 13, 2020

Conversation

azdagron
Copy link
Member

The rate limiter is supposed to warn if the handler did not invoke the limiter (suggesting a bug in the handler implementation), except when the handler returns InvalidArgument.

The conditional in the rate limiter middleware was incorrect causing the warning to be issued even when the handler was never invoked.

This change:

  • fixes the rate limiter
  • moves the authorization middleware above the rate limiting middleware as a precaution.
  • provides a small tweak to the order of checks in the authorization middleware to provide better diagnostics when an X509-SVID is not presented.

The rate limiter is supposed to warn if the handler did not invoke the
limiter (suggesting a bug in the handler implementation), except when
the handler returns InvalidArgument.

The conditional in the rate limiter middleware was incorrect causing the
warning to be issued even when the handler was never invoked.

This change fixes the rate limiter.

It also moves the authorization middleware above the rate limiting
middleware as a precaution.

Signed-off-by: Andrew Harding <andrew.harding@hpe.com>
@azdagron azdagron merged commit ea040f7 into spiffe:master Aug 13, 2020
@azdagron azdagron deleted the fix-rate-limiter-warning branch August 13, 2020 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants