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

Use pluginSubject for system index interaction and remove usages of stashContext #714

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jan 15, 2025

Description

This PR removes direct usages of ThreadContext.stashContext and implements a new extension point in core (IdentityAwarePlugin) which assigns this plugin a subject to use for the purposes of executing transport actions outside of the authenticated user context.

With this subject, job-scheduler is permitted to access its own system indices without having to use ThreadContext.stashContext explicitly.

Related Issues

Resolves opensearch-project/opensearch-plugins#238

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

…tashContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@cwperks cwperks closed this Jan 15, 2025
Copy link

codecov bot commented Jan 15, 2025

Codecov Report

Attention: Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.

Project coverage is 36.63%. Comparing base (f1ad865) to head (d69e965).

Files with missing lines Patch % Lines
...rch/jobscheduler/transport/RunAsSubjectClient.java 0.00% 19 Missing ⚠️
...rg/opensearch/jobscheduler/JobSchedulerPlugin.java 0.00% 5 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #714      +/-   ##
============================================
- Coverage     37.67%   36.63%   -1.05%     
+ Complexity      135      133       -2     
============================================
  Files            22       23       +1     
  Lines          1189     1212      +23     
  Branches        109      109              
============================================
- Hits            448      444       -4     
- Misses          704      731      +27     
  Partials         37       37              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[META] Remove usages of ThreadContext.stashContext and adopt new mechanism for System Index access
1 participant