-
Notifications
You must be signed in to change notification settings - Fork 94
Make LockService an interface and replace usages of ThreadContext.stashContext #714
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
Make LockService an interface and replace usages of ThreadContext.stashContext #714
Conversation
…tashContext Signed-off-by: Craig Perkins <[email protected]>
Codecov Report❌ Patch coverage is ❌ Your project status has failed because the head coverage (70.48%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #714 +/- ##
==========================================
+ Coverage 69.99% 70.48% +0.48%
==========================================
Files 38 41 +3
Lines 1733 2053 +320
Branches 156 165 +9
==========================================
+ Hits 1213 1447 +234
- Misses 430 495 +65
- Partials 90 111 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Craig Perkins <[email protected]>
spi/src/main/java/org/opensearch/jobscheduler/spi/utils/LockService.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
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.This PR also updates the sample plugin to enable testing with Security.
You can test with security in the sample plugin using a command like this:
Related Issues
Resolves opensearch-project/opensearch-plugins#238
Check List
--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.