8000 VAULT-35628 Add group_by and secondary_rate to RLQ API by bosouza · Pull Request #30447 · hashicorp/vault · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

VAULT-35628 Add group_by and secondary_rate to RLQ API #30447

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

Merged
merged 7 commits into from
May 12, 2025
Merged

Conversation

bosouza
Copy link
Contributor
@bosouza bosouza commented Apr 29, 2025

Description

This PR adds the group_by and secondary_rate fields to the RLQ API. These won't provide any additional functionality in CE, as we maintain support only to the current behavior there, but now as an explicit "IP" grouping mode. On enterprise we'll add 3 additional grouping modes to support different use cases:

  • group_by: none groups all requests to which the RLQ applies together (i.e. collective rate limit);
  • group_by: entity_then_ip groups requests to which the RLQ applies by entity Id if available, otherwise by the client IP address (e.g. login or root token requests);
  • group_by: entity_then_none groups requests to which the RLQ applies by entity Id if available, and all entity-less requests together (e.g. login or root token requests)

To make things simpler most of the API and storage handling of the new fields will be present in both CE and ent codebases, it's only the evaluation of those fields that'll be moved to the ent codebase.

Jira: VAULT-35628
RFC: VLT-352: Identity-based and collective rate limit quotas
Ent PR: https://github.com/hashicorp/vault-enterprise/pull/7998

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Apr 29, 2025
Copy link
github-actions bot commented Apr 29, 2025

CI Results:
All Go tests succeeded! ✅

@bosouza bosouza force-pushed the bosouza/id-rlq-api branch from 16bfd56 to c49fe65 Compare May 6, 2025 16:17
@bosouza bosouza added this to the 1.20.0-rc milestone May 6, 2025
@bosouza bosouza requested review from VioletHynes and mpalmi May 6, 2025 16:29
@bosouza bosouza marked this pull request as ready for review May 6, 2025 16:29
@bosouza bosouza requested a review from a team as a code owner May 6, 2025 16:29
@@ -0,0 +1,3 @@
```release-note:improvement
core/quotas: Add new fields to the rate limit quota API to support different grouping modes on enterprise version.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
core/quotas: Add new fields to the rate limit quota API to support different grouping modes on enterprise version.
core/quotas (enterprise): Add new fields to the rate limit quota API to support different grouping modes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually: should this be added at this stage? It looks like this is not the full feature (which makes sense, it's good that we split them up), but we should only have one changelog that describes the full feature irrespective of how many PRs we have.

Copy link
Contributor

Choose a reason for hiding this comment

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

It also might want to be a feature changeog compared to improvement, but we can figure that out later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, I'll keep the changelog until the whole thing is in

Copy link
github-actions bot commented May 6, 2025

Build Results:
All builds succeeded! ✅

@bosouza bosouza requested a review from VioletHynes May 6, 2025 19:41
@bosouza
Copy link
Contributor Author
bosouza commented May 12, 2025

Will go ahead with the merge following this process. Running the diff command I see there's no difference between ent and CE PRs except the ent files: diff <(gh pr diff https://github.com/hashicorp/vault-enterprise/pull/7998) <(gh pr diff https://github.com/hashicorp/vault/pull/30447)

@bosouza bosouza merged commit 7d0be53 into main May 12, 2025
91 of 92 checks passed
@bosouza bosouza deleted the bosouza/id-rlq-api branch May 12, 2025 20:28
Monkeychip pushed a commit that referenced this pull request May 13, 2025
* Add group_by and secondary_rate to RLQ API

* fix CE test

* add more docs

* fix tests and linter error

* add changelog

* address feedback

* remove changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0