-
Notifications
You must be signed in to change notification settings - Fork 345
Inject user custom attributes #5560
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
Inject user custom attributes #5560
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5560 +/- ##
==========================================
+ Coverage 73.07% 73.09% +0.01%
==========================================
Files 408 408
Lines 25259 25262 +3
Branches 3842 3843 +1
==========================================
+ Hits 18459 18466 +7
+ Misses 4933 4926 -7
- Partials 1867 1870 +3
🚀 New features to boost your workflow:
|
4e2cf2e to
b862081
Compare
src/main/java/org/opensearch/security/privileges/PrivilegesEvaluator.java
Show resolved
Hide resolved
src/main/java/org/opensearch/security/privileges/dlsfls/DocumentPrivileges.java
Outdated
Show resolved
Hide resolved
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.
Thank you for this PR @markdboyd! The changes LGTM. Left one suggestion on strengthening the logic to identify if attribute substitution for a query string is incomplete, but otherwise the changes look good. Thank you for all the contributions to solve this difficult bug in the alerting plugin!
68b84da to
5b5c8fe
Compare
… as a hashmap for improved compatibility with other plugins Signed-off-by: Mark Boyd <[email protected]>
…jectUserAndRoles Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
…d context Signed-off-by: Mark Boyd <[email protected]>
…and throw exception if not Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
… attribute substitution fails for DLS Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
…ments Signed-off-by: Mark Boyd <[email protected]>
…t the search results are filtered correclty Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
…ering with DLS works correctly Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
…or code to use it Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
5b5c8fe to
1a7c87d
Compare
src/integrationTest/java/org/opensearch/security/privileges/dlsfls/DocumentPrivilegesTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/privileges/UserAttributesUnitTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/privileges/UserAttributesUnitTest.java
Outdated
Show resolved
Hide resolved
cwperks
left a comment
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.
Thank you @markdboyd! The changes LGTM. left a few minor comments, but nothing major.
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
Signed-off-by: Mark Boyd <[email protected]>
DarshitChanpura
left a comment
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.
thanks @markdboyd ! The PR looks good to me. left one clarifying question
Description
These changes are a follow-up to #5491. They are part of ongoing work to address opensearch-project/alerting#1829. These changes specifically inject user custom attributes to the security plugin context so that DLS/FLS replacement on queries will work properly.
These changes work in concert with these changes in other plugins:
opensearch-project/common-utils#827
opensearch-project/alerting#1917
Issues Resolved
Addresses #5491
Testing
I have been doing manual testing in Docker by compiling the jar files and mounting the jar files into the containers.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.