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
Authorize rest requests #2753
Authorize rest requests #2753
Changes from 46 commits
a8a1660
0fedc03
1793a5b
32d8763
a5a44b8
99bfd94
f62f590
7596b7e
1fb5316
25fda77
aea8ede
15eb6b9
f2cba87
77700e5
d1d9ed1
ccab6ce
174a142
2042a60
0c70700
9837378
a34c3a4
f5afd62
918ab51
98791a2
b639544
4288235
93a2c66
6e9e83d
5ee7b12
34092f9
c41023b
d746435
d68c76e
2814283
3b41475
d5392e4
425c22b
b1ed481
1e3efe2
590f55a
6918a80
427460c
f3c4a77
8557fce
d66294d
4a33b33
6a1c25a
8503358
afc8c81
14fe152
5bae5e8
24be564
2edd319
3c397e2
e7d10c7
54cfcd9
8bfeb25
ccd3d2d
c68083c
dc0c1e2
39314d7
ebc5486
a78582f
a325d8e
0e905a0
25a41b6
1b1f519
ffdd927
9b05d44
a21c4c0
6c5ee8e
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.
If I am reading this correctly, we are always going to be evaluating both on the REST and trasnport layer correct? The only case where things would happen only in the REST layer would be if the request were unauthorized?
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.
Yes.
I'm not quite sure I understand this. Can you elaborate a little?
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 meant to clarify that the only time a request would end in the REST layer would be if it were unauthorized by the REST layer auth checker. Otherwise, it will always hit the transport layer checks.
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.
Units like this should have tests with them. I've seen code similar to this in core, can this be extracted to a library?
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.
Test file already exists. Check it out https://github.com/opensearch-project/security/blob/9b05d44a6ba15bca521e1ccbd6e33124facddcc0/src/test/java/org/opensearch/security/filter/RestPathMatchesTest.java
It's only used at 2 places and I don't think it will be used at other places in future. I think keeping it here is fine.