Skip to content

Introduce PluginSubject and replace usages of stashContext in TransportGetAlertsAction#1916

Draft
cwperks wants to merge 1 commit intoopensearch-project:mainfrom
cwperks:remove-stash-context
Draft

Introduce PluginSubject and replace usages of stashContext in TransportGetAlertsAction#1916
cwperks wants to merge 1 commit intoopensearch-project:mainfrom
cwperks:remove-stash-context

Conversation

@cwperks
Copy link
Member

@cwperks cwperks commented Aug 13, 2025

Description

This PR replaces usages of ThreadContext.stashContext with a replacement that enforces strong ownership over system indices. The reporting plugin can access the system indices it declares with SystemIndexPlugin.getSystemIndexDescriptors, but otherwise needs to declare additional perms like this: https://github.com/opensearch-project/geospatial/blob/main/src/main/resources/plugin-additional-permissions.yml

The replacement restricts what plugins can do inside a privileged context, but permits access to their own system indices.

This PR also attempts to replace usages of scope.launch and client.suspendUntil with async code prevent blocking operations.

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.

…rtGetAlertsAction

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

cwperks commented Aug 13, 2025

Checks will fail until this repo is version bumped to 3.3

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