Skip to content
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

[Backport 2.x] Implement new extension points in IdentityPlugin and add ContextProvidingPluginSubject #5028

Merged
merged 8 commits into from
Jan 16, 2025

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jan 15, 2025

Description

Backport #4896 to 2.x and target the new style authorization code path. A separate PR will be raised to implement this with the legacy authorization code path.

Also backports #4802 to resolve issues with codecov not reporting lines covered by tests in the integrationTest sourceSet.

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

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.

…dingPluginSubject (opensearch-project#4896)

Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 1924e41)
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 82.71605% with 14 lines in your changes missing coverage. Please review.

Project coverage is 68.10%. Comparing base (4af1d07) to head (1ba3332).
Report is 1 commits behind head on 2.x.

Files with missing lines Patch % Lines
...ensearch/security/privileges/ActionPrivileges.java 59.09% 5 Missing and 4 partials ⚠️
.../opensearch/security/OpenSearchSecurityPlugin.java 83.33% 1 Missing ⚠️
.../org/opensearch/security/auth/UserSubjectImpl.java 90.00% 1 Missing ⚠️
...org/opensearch/security/filter/SecurityFilter.java 66.66% 0 Missing and 1 partial ⚠️
...ecurity/privileges/SystemIndexAccessEvaluator.java 92.85% 0 Missing and 1 partial ⚠️
...c/main/java/org/opensearch/security/user/User.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x    #5028      +/-   ##
==========================================
+ Coverage   64.44%   68.10%   +3.65%     
==========================================
  Files         344      346       +2     
  Lines       24433    24503      +70     
  Branches     4052     4061       +9     
==========================================
+ Hits        15747    16688     +941     
+ Misses       6749     5894     -855     
+ Partials     1937     1921      -16     
Files with missing lines Coverage Δ
.../org/opensearch/security/auth/BackendRegistry.java 78.39% <100.00%> (+17.58%) ⬆️
...curity/identity/ContextProvidingPluginSubject.java 100.00% <100.00%> (ø)
...h/security/privileges/PrivilegesEvaluatorImpl.java 74.04% <100.00%> (+0.90%) ⬆️
...g/opensearch/security/support/ConfigConstants.java 95.23% <ø> (ø)
.../opensearch/security/OpenSearchSecurityPlugin.java 85.03% <83.33%> (+0.34%) ⬆️
.../org/opensearch/security/auth/UserSubjectImpl.java 90.00% <90.00%> (ø)
...org/opensearch/security/filter/SecurityFilter.java 66.50% <66.66%> (+0.15%) ⬆️
...ecurity/privileges/SystemIndexAccessEvaluator.java 76.92% <92.85%> (+5.60%) ⬆️
...c/main/java/org/opensearch/security/user/User.java 69.41% <0.00%> (+0.36%) ⬆️
...ensearch/security/privileges/ActionPrivileges.java 95.14% <59.09%> (+7.42%) ⬆️

... and 77 files with indirect coverage changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks
Copy link
Member Author

cwperks commented Jan 16, 2025

codecov is not picking up on lines hit through the integration tests for this change.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks
Copy link
Member Author

cwperks commented Jan 16, 2025

Pushed a commit to backport #4802 in this PR as well.

willyborankin
willyborankin previously approved these changes Jan 16, 2025
Signed-off-by: Craig Perkins <cwperx@amazon.com>
@DarshitChanpura DarshitChanpura merged commit a7d2c57 into opensearch-project:2.x Jan 16, 2025
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants