Skip to content

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jul 2, 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.

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>
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>
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>
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>
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>
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>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Craig Perkins <cwperx@amazon.com>
cwperks added 4 commits July 1, 2025 21:17
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>
@cwperks cwperks marked this pull request as draft August 13, 2025 15:04
Copy link

codecov bot commented Aug 13, 2025

Codecov Report

❌ Patch coverage is 70.35775% with 174 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.08%. Comparing base (aeb2d9c) to head (7390f92).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
.../action/explain/TransportExplainTransformAction.kt 64.70% 21 Missing and 3 partials ⚠️
...lup/action/explain/TransportExplainRollupAction.kt 55.55% 20 Missing ⚠️
...transport/action/explain/TransportExplainAction.kt 67.39% 13 Missing and 2 partials ⚠️
.../rollup/action/start/TransportStartRollupAction.kt 58.62% 9 Missing and 3 partials ⚠️
...ransform/action/get/TransportGetTransformAction.kt 57.14% 10 Missing and 2 partials ⚠️
...ent/rollup/action/get/TransportGetRollupsAction.kt 50.00% 8 Missing and 2 partials ⚠️
...nt/rollup/action/stop/TransportStopRollupAction.kt 61.53% 8 Missing and 2 partials ⚠️
...form/action/start/TransportStartTransformAction.kt 68.96% 7 Missing and 2 partials ⚠️
...ment/rollup/action/get/TransportGetRollupAction.kt 63.63% 6 Missing and 2 partials ⚠️
.../notification/filter/NotificationActionListener.kt 50.00% 7 Missing ⚠️
... and 14 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1438      +/-   ##
==========================================
- Coverage   76.31%   76.08%   -0.23%     
==========================================
  Files         375      376       +1     
  Lines       18772    18763       -9     
  Branches     2366     2365       -1     
==========================================
- Hits        14326    14276      -50     
- Misses       3212     3253      +41     
  Partials     1234     1234              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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>
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>
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.

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