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

[2.x] Implement new extension points in IdentityPlugin and add ContextProvidingPluginSubject - legacy authz code path #5037

Open
wants to merge 19 commits into
base: 2.x
Choose a base branch
from

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jan 17, 2025

Description

This PR implements the legacy authz code path for #4665

Companion PR in core: opensearch-project/OpenSearch#14630

This PR by itself does not add additional functionality, it simply implements the new extension points in core and introduces a new class called ContextProvidingPluginSubject which populates a header in the ThreadContext with the canonical class name of the plugin that is executing code using pluginSystemSubject.runAs(() -> { ... }). See ./gradlew integrationTest --tests SystemIndexTests for an example that verifies that a block of code run with pluginSystemSubject.runAs(() -> { ... }) has contextual info in the thread context.

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Enhancement

Issues Resolved

Related to #4439

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.

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 94.11765% with 3 lines in your changes missing coverage. Please review.

Project coverage is 68.13%. Comparing base (376fd16) to head (49dc4c0).
Report is 1 commits behind head on 2.x.

Files with missing lines Patch % Lines
...search/security/transport/SecurityInterceptor.java 60.00% 1 Missing and 1 partial ⚠️
.../privileges/legacy/SystemIndexAccessEvaluator.java 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x    #5037      +/-   ##
==========================================
+ Coverage   68.06%   68.13%   +0.07%     
==========================================
  Files         346      347       +1     
  Lines       24504    24544      +40     
  Branches     4062     4068       +6     
==========================================
+ Hits        16678    16723      +45     
+ Misses       5905     5898       -7     
- Partials     1921     1923       +2     
Files with missing lines Coverage Δ
...ecurity/privileges/SystemIndexAccessEvaluator.java 76.92% <100.00%> (ø)
...ity/privileges/legacy/PrivilegesEvaluatorImpl.java 62.73% <100.00%> (+1.31%) ⬆️
...pensearch/security/securityconf/ConfigModelV7.java 67.92% <100.00%> (+0.37%) ⬆️
...security/securityconf/InMemorySecurityRolesV7.java 100.00% <100.00%> (ø)
...rch/security/transport/SecurityRequestHandler.java 55.03% <100.00%> (ø)
.../privileges/legacy/SystemIndexAccessEvaluator.java 72.85% <92.85%> (+2.22%) ⬆️
...search/security/transport/SecurityInterceptor.java 80.00% <60.00%> (-0.69%) ⬇️

... and 7 files with indirect coverage changes

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.

1 participant