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.
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
A new search API for API keys - core search function #75335
A new search API for API keys - core search function #75335
Changes from 10 commits
aaa8324
6cf8bf2
db31169
697d25e
21aa8e6
bf95613
d7a6d72
fb053ad
67a14cb
3133622
e9fd594
704cd54
fd7c2db
42d3daa
2893098
c84ec00
dee3b89
e8007e5
07676e0
7bdf43e
c4e84e3
84d4709
65116fa
b2a317f
e435073
ec509e0
30e0bd0
a9356f1
57aa649
4f0b4e9
a5d2317
c420119
e0bc584
974884d
fe079d4
c91f08a
6a6cd14
284dd74
38f6db9
f2ad596
20b14c6
023b2b6
69e3e77
a54dee0
41a0dc7
89818e3
33433ac
3a1c1e7
132f333
fdb8a97
324330c
ed9699f
f6a339e
5bb47e1
63894ca
a5acac6
3612581
64930e3
d956307
3634f42
3f7be4d
a68a960
1e2c933
05a486e
3b1efd1
6475bf2
6181a6d
1e459fd
4ef5157
a378d41
d4b8c30
5a26aea
aa427ab
8449ebb
22609fc
8f3e4c0
d6fb1c1
1213572
3a2e081
28765d0
06d227a
f95d7f4
2076cb6
572cfb7
7c97e70
468a7e4
5718d49
5979731
249dd02
b5bb1db
1d96037
f18bdb0
3ccc8e3
4e44793
76a4eb3
10526ad
eeb1e16
b67eded
8940f97
86f3f55
f5e7c51
c707eed
4ca2113
4d868f5
ea5e7da
c9fe937
b3034c1
760edcd
82c0a51
4f82c21
96cd1c8
585ddf4
4daa6fc
fb6e850
24b95c7
3d8a80c
f756bc4
1c93138
5e5666f
965f80b
b87d8ea
7c544e5
ed1f47f
868ce3e
8621a18
fb7f209
cdd2183
1fa2b30
be14569
6337ed2
d6727cb
edc293a
f9c8e70
f972d71
8a024fe
93cfe87
d1d92b6
8f255a0
656b7af
d3a9d7d
4b818e5
43e691e
793e4ae
95d344d
f59c50b
57f786f
88440e1
b803b8f
5592757
1d15402
0e8ae9e
839ed48
bccca8b
db5af7d
026a7ef
5be6f6d
2c98ba0
328f5c6
8d9d552
f95e171
d1e107e
f082ebc
bb163a4
19c801d
657d476
f018dc1
61acc54
5499267
0c43ff9
ae9bd01
76897cd
8a014da
968233f
1d68b8f
6bac600
4c37c47
f4e2b1f
681ead0
0e08be9
f3ae991
81ad470
1776cec
10d361e
9fedd01
dead681
ed7b27b
d036ed0
bbf4c94
8dd1deb
43229bf
a8d63ad
4af8008
cab9797
810d8ef
598d4f8
786daad
8be55cb
6bf40fa
072e02e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
As discussed, this is the simple way of applying calling user's security context. It works but is probably not a long term solution. I am open to alternatives.
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.
My preference would be to do this in an interceptor, but I don't think that's very easy to do.
Logically, it would be a case of checking whether the Role has unconditional access to some action, but that's not actually easy to do with an artibrary Authz Engine, and what action would you use?
We could take an approach like we do with the
create_doc
index privilege and have different logical action names for the unrestricted query vs the restricted query.That is,
And then have special case code somewhere like:
I don't have a great suggestion, but this approach really bothers me and I don't want to set a precedent that gets reused for other actions. This is definitely not how we want to make this work in general.
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.
I assume your example is about the interceptor approach. We don't have such an interceptor for cluster actions, but I assume it would work similarly to the interceptors for index requests. The interface is
Are you concerning about that, inside this method, we need to only rely on the fact that both
AuthorizationEngine
andAuthorizationInfo
are interfaces and we need do it in a way that does not makeRBACEngine
and ourRole
special for at least in this method? It's challenging even with the "separate action name" approach. None of the existing methods fit this purpose really well. We can sorta fit it intoAuthorizationEngine#authorizeClusterAction
. But it would be better if we can add a new method toAuthorizationEngine
. I think we'll need high bandwidth conversation on this.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.
I came up with a new approach inspired by your comment. The idea is to authorize the action a second time if it fails for the first time and it is the QueryApiKey action. I think this approach is promising because:
AuthorizationService
AuthorizationEngine
andAuthorizationInfo
manage_own_api_key
privilege.It has the overhead of a second authorization for the QueryApiKey action. But I think it is acceptable because it authorizing on name is pretty fast and it does not affect any other actions.