-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
VAULT-8336 Fix default rate limit paths #18273
Conversation
@@ -724,15 +724,6 @@ func (m *Manager) RateLimitResponseHeadersEnabled() bool { | |||
return m.config.EnableRateLimitResponseHeaders | |||
} | |||
|
|||
// RateLimitExemptPaths returns the list of exempt paths from all rate limit | |||
// resource quotas from the Manager's configuration. | |||
func (m *Manager) RateLimitExemptPaths() []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function was never called (in OSS or Ent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, looks good to me!
@@ -724,15 +724,6 @@ func (m *Manager) RateLimitResponseHeadersEnabled() bool { | |||
return m.config.EnableRateLimitResponseHeaders | |||
} | |||
|
|||
// RateLimitExemptPaths returns the list of exempt paths from all rate limit | |||
// resource quotas from the Manager's configuration. | |||
func (m *Manager) RateLimitExemptPaths() []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarifying!
Oh just realized something, if you're planning to backport this then you might want to move the docs to a separate PR so they aren't deployed upon merge of the backport PR. |
* VAULT-8336 Fix default rate limit paths * VAULT-8336 changelog
It seems like this never really worked, unfortunately. We check the request path against the default exempt list to see if the request path is a prefix of any, but since the request path was
sys/health
, it wasn't a prefix of/v1/sys/health
. After this change, everything seems to work as expected (assys/health
is indeed a prefix ofsys/health
).The test I added will fail if this is broken again in the future, and all tests pass after this change (both OSS and Ent).
I updated the docs to make it clearer for users wanting to customize their set of defaults.