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

VAULT-8336 Fix default rate limit paths #18273

Merged
merged 2 commits into from
Dec 9, 2022
Merged

Conversation

VioletHynes
Copy link
Contributor

@VioletHynes VioletHynes commented Dec 8, 2022

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 (as sys/health is indeed a prefix of sys/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.

@@ -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 {
Copy link
Contributor Author

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)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying!

@VioletHynes VioletHynes marked this pull request as ready for review December 8, 2022 17:50
Copy link
Contributor

@ccapurso ccapurso left a 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying!

@ccapurso
Copy link
Contributor

ccapurso commented Dec 8, 2022

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.

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

3 participants