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

Add runAs to Subject interface and introduce IdentityAwarePlugin extension point #14630

Merged
merged 87 commits into from
Aug 28, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jul 2, 2024

Description

Companion Security PR: opensearch-project/security#4665

This PR adds new method to the Subject interface called runAs and introduces a new extension point called IdentityAwarePlugin. This new method can be utilized to run a callable block of code in the context of the subject.

This PR also introduces the notion of an IdentityAwarePlugin which contains a single method to initialize the plugin. The IdentityPlugin will get to define which subject is passed to IdentityAwarePlugins on initialization. Practically, the Security Plugin is the IdentityPlugin and the subject passed to IdentityAwarePlugins is a special pluginSystemSubject which can be utilized to perform transport actions in the plugin system context and outside of the authenticated user context.

Subject.runAs() is intended to be an abstraction and replacement on the current pattern of System index interaction in which plugins will utilize the ThreadContext class and stash the context before performing transport actions on system indices.

With the changes in this PR, the NoopIdentityPlugin will assign a NoopPluginSubject to IdentityAwarePlugins. When using NoopPluginSubject.runAs(() -> { ... }) it runs the Callable within a block where the ThreadContext is stashed which is the same behavior plugins use today so its a direct replacement to try (ThreadContext.StoredContext ctx = threadContext.stashContext()) { ... }.

By itself, this PR is not very interesting, but with the changes in this PR it enables the Security plugin (the IdentityPlugin) to define an implementation for PluginSubject. If you look at the companion PR, the Security implementation of PluginSubject injects a pluginUser into the ThreadContext so that we can start using the existing security authz mechanisms to gate way plugins can do within the runAs block.

Related Issues

Related to: opensearch-project/security#4439

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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
Contributor

github-actions bot commented Jul 2, 2024

❌ Gradle check result for 444fde7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
…nsion point (opensearch-project#14630)

* Create ExecutionContext and show example with ActionPluginProxy

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Only allow core to set the ExecutionContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware thread context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Plugin Aware API Handling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test to verify that ExecutionContext is being populated during RestHandling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Clear context in a finally block

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create switchContext method in ThreadContext and make pluginExecutionStack a stack

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware stash context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create class called PluginAwareNodeClient that provides a method called switchContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove ExecutionContext class

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Change createComponents to take in PluginAwareNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update all instances of createComponents

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Initialize clients

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove casting

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on notion of ContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make stashContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make markAsSystemContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc on param

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Merge with main

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Cleanup

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemIndexFilter

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add notion of Forbidden Headers to the ThreadContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add method to initialize plugins

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create concept of pluginNodeClient that can be used for executing transport actions as the plugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test for setPluginNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove newline

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Subject.runAs and introduce PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Do nothing when runAs is called for ShiroSubject and NoopSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove extraneous changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Test all methods in PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Pass a Callable to runAs

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Simplify PR, make NoopPluginSubject and introduce IdentityAwarePlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add final

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove server dependency

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove AbstractSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove unnecessary changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc to NoopPluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to assignSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add experimental label

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add getPluginSubject(plugin) to IdentityPlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make runAs generic

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* package-private constructor

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move IdentityAwarePlugin initialization

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create separate PluginSubject interface

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authenticate method

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Separate UserSubject and PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Terminate TestThreadPool

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* mock ThreadPool in RestSendToExtensionActionTests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix Thread leak

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to getCurrentSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add type check

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to pluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add runAs to ActionRequest and surround doExecute in AbstractClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Return this

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Switch back to void

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert change to ActionRequest

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 16, 2024
…nsion point (opensearch-project#14630)

* Create ExecutionContext and show example with ActionPluginProxy

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Only allow core to set the ExecutionContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware thread context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Plugin Aware API Handling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test to verify that ExecutionContext is being populated during RestHandling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Clear context in a finally block

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create switchContext method in ThreadContext and make pluginExecutionStack a stack

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware stash context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create class called PluginAwareNodeClient that provides a method called switchContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove ExecutionContext class

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Change createComponents to take in PluginAwareNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update all instances of createComponents

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Initialize clients

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove casting

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on notion of ContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make stashContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make markAsSystemContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc on param

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Merge with main

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Cleanup

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemIndexFilter

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add notion of Forbidden Headers to the ThreadContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add method to initialize plugins

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create concept of pluginNodeClient that can be used for executing transport actions as the plugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test for setPluginNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove newline

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Subject.runAs and introduce PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Do nothing when runAs is called for ShiroSubject and NoopSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove extraneous changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Test all methods in PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Pass a Callable to runAs

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Simplify PR, make NoopPluginSubject and introduce IdentityAwarePlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add final

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove server dependency

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove AbstractSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove unnecessary changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc to NoopPluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to assignSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add experimental label

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add getPluginSubject(plugin) to IdentityPlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make runAs generic

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* package-private constructor

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move IdentityAwarePlugin initialization

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create separate PluginSubject interface

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authenticate method

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Separate UserSubject and PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Terminate TestThreadPool

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* mock ThreadPool in RestSendToExtensionActionTests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix Thread leak

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to getCurrentSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add type check

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to pluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add runAs to ActionRequest and surround doExecute in AbstractClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Return this

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Switch back to void

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert change to ActionRequest

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 17, 2024
…nsion point (opensearch-project#14630)

* Create ExecutionContext and show example with ActionPluginProxy

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Only allow core to set the ExecutionContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware thread context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Plugin Aware API Handling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test to verify that ExecutionContext is being populated during RestHandling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Clear context in a finally block

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create switchContext method in ThreadContext and make pluginExecutionStack a stack

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware stash context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create class called PluginAwareNodeClient that provides a method called switchContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove ExecutionContext class

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Change createComponents to take in PluginAwareNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update all instances of createComponents

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Initialize clients

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove casting

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on notion of ContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make stashContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make markAsSystemContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc on param

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Merge with main

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Cleanup

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemIndexFilter

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add notion of Forbidden Headers to the ThreadContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add method to initialize plugins

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create concept of pluginNodeClient that can be used for executing transport actions as the plugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test for setPluginNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove newline

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Subject.runAs and introduce PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Do nothing when runAs is called for ShiroSubject and NoopSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove extraneous changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Test all methods in PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Pass a Callable to runAs

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Simplify PR, make NoopPluginSubject and introduce IdentityAwarePlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add final

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove server dependency

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove AbstractSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove unnecessary changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc to NoopPluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to assignSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add experimental label

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add getPluginSubject(plugin) to IdentityPlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make runAs generic

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* package-private constructor

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move IdentityAwarePlugin initialization

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create separate PluginSubject interface

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authenticate method

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Separate UserSubject and PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Terminate TestThreadPool

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* mock ThreadPool in RestSendToExtensionActionTests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix Thread leak

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to getCurrentSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add type check

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to pluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add runAs to ActionRequest and surround doExecute in AbstractClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Return this

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Switch back to void

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert change to ActionRequest

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
dk2k pushed a commit to dk2k/OpenSearch that referenced this pull request Oct 21, 2024
…nsion point (opensearch-project#14630)

* Create ExecutionContext and show example with ActionPluginProxy

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Only allow core to set the ExecutionContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware thread context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Plugin Aware API Handling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test to verify that ExecutionContext is being populated during RestHandling

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Clear context in a finally block

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create switchContext method in ThreadContext and make pluginExecutionStack a stack

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on plugin aware stash context

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create class called PluginAwareNodeClient that provides a method called switchContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove ExecutionContext class

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Change createComponents to take in PluginAwareNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update all instances of createComponents

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Initialize clients

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove casting

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on notion of ContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make stashContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make markAsSystemContext package-private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc on param

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemContextSwitcher

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Merge with main

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Cleanup

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove SystemIndexFilter

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add notion of Forbidden Headers to the ThreadContext

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add method to initialize plugins

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create concept of pluginNodeClient that can be used for executing transport actions as the plugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test for setPluginNodeClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove newline

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add another test

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Subject.runAs and introduce PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Do nothing when runAs is called for ShiroSubject and NoopSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove extraneous changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Test all methods in PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Pass a Callable to runAs

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Simplify PR, make NoopPluginSubject and introduce IdentityAwarePlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add final

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove server dependency

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove AbstractSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove unnecessary changes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc to NoopPluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to assignSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add experimental label

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add getPluginSubject(plugin) to IdentityPlugin

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Make runAs generic

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* package-private constructor

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Move IdentityAwarePlugin initialization

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create separate PluginSubject interface

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authenticate method

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove import

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Separate UserSubject and PluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Terminate TestThreadPool

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* mock ThreadPool in RestSendToExtensionActionTests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix Thread leak

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to getCurrentSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add type check

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Rename to pluginSubject

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add runAs to ActionRequest and surround doExecute in AbstractClient

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Return this

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Switch back to void

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Revert change to ActionRequest

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
backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request v2.17.0 v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants