-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
[Failure Store] Has Privileges API #125329
Merged
elasticsearchmachine
merged 30 commits into
elastic:main
from
n1v0lg:failure-store-has-privileges
Mar 26, 2025
+810
−51
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
bd13e85
WIP has privileges
n1v0lg 43716fa
Ugly but works maybe
n1v0lg b0eef69
Clean up
n1v0lg ccc1643
More
n1v0lg b4c7c88
WIP tests
n1v0lg 922d516
Merge branch 'main' into failure-store-has-privileges
n1v0lg ec1f294
More
n1v0lg dc28b4e
More
n1v0lg c150281
Clean up
n1v0lg 6570ba0
Comments
n1v0lg d543195
Merge branch 'main' into failure-store-has-privileges
n1v0lg d953911
API key coverage
n1v0lg 4e2bf8b
More tests
n1v0lg 8294e8b
More
n1v0lg 978e99d
WIP test restricted indices
n1v0lg 79aa787
Merge branch 'main' into failure-store-has-privileges
n1v0lg edb45b9
More tests
n1v0lg e63fdac
Naming
n1v0lg c841004
Merge branch 'main' into failure-store-has-privileges
n1v0lg f30473a
Validation
n1v0lg 575098b
Nit
n1v0lg 00989f9
API key tests
n1v0lg 6c6445d
Merge branch 'main' into failure-store-has-privileges
n1v0lg 16f5e91
Merge branch 'main' into failure-store-has-privileges
n1v0lg 8455641
run-as test and ff
n1v0lg 96b4a24
Merge branch 'failure-store-has-privileges' of github.com:n1v0lg/elas…
n1v0lg ca6f255
Merge branch 'main' into failure-store-has-privileges
n1v0lg 08b1a5a
Merge branch 'main' into failure-store-has-privileges
n1v0lg 143f0a7
Unit test
n1v0lg 3988252
Merge branch 'main' into failure-store-has-privileges
n1v0lg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
one optimization to consider: we could wrap
getIndexPrivilegesAutomaton
calls intoCachedSupplier
and makeallowedPrivilegesAutomatonForFailuresSelector
andallowedPrivilegesAutomatonForDataSelector
be computed lazily whencheckWithDataSelector
orcheckWithFailuresSelector
is true - respectivelyThere 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.
I was thinking about this too but
CachedSupplier
involves asynchronized
block and might be a little too heavy for the context here (since we don't need synchronization here, I don't think) -- at least I can't immediately say if it would provide an actual gain or not. My thinking here is:containsPrivilegesForFailuresSelector
. We could do the same for data selectors but that's another pass over the privileges with another set of Map look-ups, or something slightly more complicatedLet me know if you have a stronger intuition here. I'd love to benchmark this and get some real performance numbers but would not want to block on that.
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.
Good point - we don't want synchronization here. FWIW We could implement a non-blocking version of cached supplier, but I don't feel this is something we should block on. My intuition is the same, we would be mostly checking data selectors and the optimization you already have could be sufficient.