-
Notifications
You must be signed in to change notification settings - Fork 44
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
Added user level access control based on backend roles #838
Added user level access control based on backend roles #838
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some suggestions.
[For this task, I had to change the search queries to boolean to add a nested filter query] @dbwiddis any thoughts?
See comment below. You can wrap any query inside a BoolQuery
with a must()
and then add a filter. I linked to an example I just wrote last week.
src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/DeprovisionWorkflowTransportAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ParseUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/GetWorkflowTransportAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/ProvisionWorkflowTransportAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ParseUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ParseUtils.java
Outdated
Show resolved
Hide resolved
82ad189
to
76f89d4
Compare
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com>
Signed-off-by: Owais <owaiskazi19@gmail.com>
6c08678
to
e5a4c74
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some style nits.
src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ParseUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/handler/SearchHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/ParseUtils.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Owais <owaiskazi19@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me, just some non-blocking comments. Thanks @owaiskazi19 for add this in
src/main/java/org/opensearch/flowframework/common/FlowFrameworkSettings.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Owais <owaiskazi19@gmail.com>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/flow-framework/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/flow-framework/backport-2.x
# Create a new branch
git switch --create backport/backport-838-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 60458a6275a2fe358a236583bce29db821d09ddc
# Push it to GitHub
git push --set-upstream origin backport/backport-838-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/flow-framework/backport-2.x Then, create a pull request where the |
…oject#838) * Implemented backend role filtering for Flow Framework Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Spotless Fixes Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added secured integ tests Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed threadcontext and an integ test Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added javadocs and fixed checkstyle Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added backend role filtering for reprovisioning API Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed exceptions Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Updated CHANGELOG Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed forbidden APIs in tests Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added secured integ tests for reprovision workflow Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed checkstyle violation Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added more tests and resolved PR comments Signed-off-by: Owais <owaiskazi19@gmail.com> * Addressed additional PR Comments Signed-off-by: Owais <owaiskazi19@gmail.com> * Updated the javadoc Signed-off-by: Owais <owaiskazi19@gmail.com> --------- Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> Signed-off-by: Owais <owaiskazi19@gmail.com> (cherry picked from commit 60458a6)
…#838) (#847) * Added user level access control based on backend roles (#838) * Implemented backend role filtering for Flow Framework Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Spotless Fixes Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added secured integ tests Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed threadcontext and an integ test Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added javadocs and fixed checkstyle Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added backend role filtering for reprovisioning API Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed exceptions Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Updated CHANGELOG Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed forbidden APIs in tests Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added secured integ tests for reprovision workflow Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Fixed checkstyle violation Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> * Added more tests and resolved PR comments Signed-off-by: Owais <owaiskazi19@gmail.com> * Addressed additional PR Comments Signed-off-by: Owais <owaiskazi19@gmail.com> * Updated the javadoc Signed-off-by: Owais <owaiskazi19@gmail.com> --------- Signed-off-by: owaiskazi19 <owaiskazi19@gmail.com> Signed-off-by: Owais <owaiskazi19@gmail.com> (cherry picked from commit 60458a6) * Updated HttpHost import Signed-off-by: Owais <owaiskazi19@gmail.com> --------- Signed-off-by: Owais <owaiskazi19@gmail.com>
Description
Added user level access control based on backend roles.
[For this task, I had to change the search queries to boolean to add a nested filter query] @dbwiddis any thoughts?
Learning after working on this feature
Refer #668 (comment) for step by step workflow and
src/test/java/org/opensearch/flowframework/rest/FlowFrameworkSecureRestApiIT.java
file for complete functionality.Related Issues
Resolves ##668
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.