generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 59
Onboards flow-framework plugin to resource-sharing and access control framework #1251
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
Merged
dbwiddis
merged 23 commits into
opensearch-project:main
from
DarshitChanpura:resource-permissions
Nov 14, 2025
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b0718e4
Onboards flow-framework plugin to resource-sharing and access control…
DarshitChanpura cc508bb
Adds javadoc and a changelog entry
DarshitChanpura 7bc4259
Adds tests for resource sharing flow and adds a CI job to run resourc…
DarshitChanpura 78ca46b
Explicitly set security spi version to 3.4
DarshitChanpura a438d12
Refactors test to use in house Recipient class
DarshitChanpura 33feaa2
Address PR comments around renaming and version
DarshitChanpura bcc871e
Constant for awaitility version
DarshitChanpura cfbf830
Fix typo in awaitilityVersion
dbwiddis 68d581c
Update ResourceProvider to use anonymous class
dbwiddis 64c9f9f
Fix javadocs
dbwiddis 933d0dd
Wrap checked exception from PluginClient
dbwiddis db0c55c
Fix tests with param index and eq rather than raw strings
dbwiddis 6047754
Properly skip ResourceSharingApiIT
dbwiddis b20a348
Add unit test for ResourceSharingExtension
dbwiddis 1a956e4
Updates template to include `all_shared_principals` and marks relevan…
DarshitChanpura 0a2f4fb
Fix checkstyle errors
DarshitChanpura 7be08f9
Fix early .onResponse return and add all_shared_principals to workflo…
DarshitChanpura 821e137
Add implementation of type method
DarshitChanpura 12756cd
Completes FlowFrameworkSecureRestApiIT
DarshitChanpura e9a62f4
Fixes javadoc CI and addresses flakyness in search test when resource…
DarshitChanpura 582fca5
Fixes unit tests
DarshitChanpura f34d4ba
Updates coverage and adds missing builder method call in Template class
DarshitChanpura f65076d
Fix test to wait for async state deletion attempt
dbwiddis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/org/opensearch/flowframework/FlowFrameworkResourceSharingExtension.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| /* | ||
| * Copyright OpenSearch Contributors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| * | ||
| * The OpenSearch Contributors require contributions made to | ||
| * this file be licensed under the Apache-2.0 license or a | ||
| * compatible open source license. | ||
| */ | ||
| package org.opensearch.flowframework; | ||
|
|
||
| import org.opensearch.flowframework.common.CommonValue; | ||
| import org.opensearch.flowframework.util.ResourceSharingClientAccessor; | ||
| import org.opensearch.security.spi.resources.ResourceProvider; | ||
| import org.opensearch.security.spi.resources.ResourceSharingExtension; | ||
| import org.opensearch.security.spi.resources.client.ResourceSharingClient; | ||
|
|
||
| import java.util.Set; | ||
|
|
||
| import static org.opensearch.flowframework.common.CommonValue.GLOBAL_CONTEXT_INDEX; | ||
| import static org.opensearch.flowframework.common.CommonValue.WORKFLOW_STATE_INDEX; | ||
|
|
||
| /** | ||
| * Implementation for sharing resources that require access control. | ||
| */ | ||
| public class FlowFrameworkResourceSharingExtension implements ResourceSharingExtension { | ||
| @Override | ||
| public Set<ResourceProvider> getResourceProviders() { | ||
| return Set.of(new ResourceProvider() { | ||
| @Override | ||
| public String resourceType() { | ||
| return CommonValue.WORKFLOW_RESOURCE_TYPE; | ||
| } | ||
|
|
||
| @Override | ||
| public String resourceIndexName() { | ||
| return GLOBAL_CONTEXT_INDEX; | ||
| } | ||
| }, new ResourceProvider() { | ||
| @Override | ||
| public String resourceType() { | ||
| return CommonValue.WORKFLOW_STATE_RESOURCE_TYPE; | ||
| } | ||
|
|
||
| @Override | ||
| public String resourceIndexName() { | ||
| return WORKFLOW_STATE_INDEX; | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| @Override | ||
| public void assignResourceSharingClient(ResourceSharingClient resourceSharingClient) { | ||
| ResourceSharingClientAccessor.getInstance().setResourceSharingClient(resourceSharingClient); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.