-
Notifications
You must be signed in to change notification settings - Fork 918
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
[Workspace][Feature] Add ACL related functions #5084
Conversation
…ct#146) * [Workspace] Add acl related functions for workspace Signed-off-by: gaobinlong <gbinlong@amazon.com> * Minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5084 +/- ##
==========================================
+ Coverage 67.10% 67.13% +0.03%
==========================================
Files 3315 3316 +1
Lines 63922 64015 +93
Branches 10220 10256 +36
==========================================
+ Hits 42892 42975 +83
- Misses 18544 18547 +3
- Partials 2486 2493 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.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.
Thanks for opening!
IMO, it might be worth to have this one hooked into the saved object functionality for us to see how it is being used and to give suggestions.
I see it on the mappings but I'm not sure how it interacts for existing data barring the mapping addition.
Also, just a heads up but I'm sure you already know. I'm really easily able to pass a compressed file of a 100+ MB files to the saved objects API. But the default size of the saved objects payload is quite large. Some users saved objects are sometimes too large that it is really not as performant. So based off the design proposal seeing how these permission controls are being used might make a big difference for our suggestions and increased latency to a potential slower response.
Would also suggest adding a configuration here that gives cluster admins the ability to disable permission controls? But I'm not sure how that impacts your design proposal but would make me sleep easier at night when we are filtering responses.
Final thing, which I tried seeing in the design, I'm pretty sure the saved objects retrieval is slightly cached and it might refresh at specific times. So I can see it having an impact on design if we want to worry about where to store this information but seems like a difficult issue to solve. For example, what do we plan to do as a user who originally had access, could still get the saved objects. Will they have the ability to have write permissions still in the cache state. They also still have access to the data and resending the request without refreshing the page.
I will paste a links to this on the design doc.
Thanks again!
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
src/core/server/saved_objects/migrations/core/build_active_mappings.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.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.
Excellent job! Appreciate your dedication to refining the code according to the comments and discussions. It looks good to me now. 👍
* [Workspace] Add ACL related functions for workspace (opensearch-project#146) * [Workspace] Add acl related functions for workspace Signed-off-by: gaobinlong <gbinlong@amazon.com> * Minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify changelog Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more unit test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify test case Signed-off-by: gaobinlong <gbinlong@amazon.com> * Some minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Optimize some code and the comments of the functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more comments for some basic functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Export more interfaces Signed-off-by: gaobinlong <gbinlong@amazon.com> * consume permissions in repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: consume permissions in serializer Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * Add unit tests for consuming permissions in repository Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove double exclamation Signed-off-by: gaobinlong <gbinlong@amazon.com> * Rename some variables Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove duplicated semicolon Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add permissions field to the mapping only if the permission control is enabled Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add feature flag config to the yml file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the comment of feature flag more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make comment more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove management permission type Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
* [Workspace] Add ACL related functions for workspace (opensearch-project#146) * [Workspace] Add acl related functions for workspace Signed-off-by: gaobinlong <gbinlong@amazon.com> * Minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify changelog Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more unit test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify test case Signed-off-by: gaobinlong <gbinlong@amazon.com> * Some minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Optimize some code and the comments of the functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more comments for some basic functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Export more interfaces Signed-off-by: gaobinlong <gbinlong@amazon.com> * consume permissions in repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: consume permissions in serializer Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * Add unit tests for consuming permissions in repository Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove double exclamation Signed-off-by: gaobinlong <gbinlong@amazon.com> * Rename some variables Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove duplicated semicolon Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add permissions field to the mapping only if the permission control is enabled Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add feature flag config to the yml file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the comment of feature flag more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make comment more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove management permission type Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
…) (#287) * [Workspace] Add ACL related functions for workspace (#146) * [Workspace] Add acl related functions for workspace * Minor change --------- * Modify changelog * Add more unit test cases * Modify test case * Some minor change * Add more test cases * Optimize some code and the comments of the functions * Add more comments for some basic functions * Export more interfaces * consume permissions in repository * feat: consume permissions in serializer * Add unit tests for consuming permissions in repository * Remove double exclamation * Rename some variables * Remove duplicated semicolon * Add permissions field to the mapping only if the permission control is enabled * Fix test failure * Add feature flag config to the yml file * Make the comment of feature flag more clear * Make comment more clear * Remove management permission type * Fix test failure --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
* [Workspace][Feature] Add ACL related functions (opensearch-project#5084) * [Workspace] Add ACL related functions for workspace (#146) * [Workspace] Add acl related functions for workspace Signed-off-by: gaobinlong <gbinlong@amazon.com> * Minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify changelog Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more unit test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify test case Signed-off-by: gaobinlong <gbinlong@amazon.com> * Some minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Optimize some code and the comments of the functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more comments for some basic functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Export more interfaces Signed-off-by: gaobinlong <gbinlong@amazon.com> * consume permissions in repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: consume permissions in serializer Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * Add unit tests for consuming permissions in repository Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove double exclamation Signed-off-by: gaobinlong <gbinlong@amazon.com> * Rename some variables Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove duplicated semicolon Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add permissions field to the mapping only if the permission control is enabled Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add feature flag config to the yml file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the comment of feature flag more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make comment more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove management permission type Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com> * Remove duplicated attribute Signed-off-by: gaobinlong <gbinlong@amazon.com> * Enable acl in integration tests for workspace client wrapper Signed-off-by: gaobinlong <gbinlong@amazon.com> * Format the code Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify feature flag Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify feature flag to false Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify feature flag to true Signed-off-by: gaobinlong <gbinlong@amazon.com> * Enhance the test case Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
…) (opensearch-project#287) * [Workspace] Add ACL related functions for workspace (opensearch-project#146) * [Workspace] Add acl related functions for workspace * Minor change --------- * Modify changelog * Add more unit test cases * Modify test case * Some minor change * Add more test cases * Optimize some code and the comments of the functions * Add more comments for some basic functions * Export more interfaces * consume permissions in repository * feat: consume permissions in serializer * Add unit tests for consuming permissions in repository * Remove double exclamation * Rename some variables * Remove duplicated semicolon * Add permissions field to the mapping only if the permission control is enabled * Fix test failure * Add feature flag config to the yml file * Make the comment of feature flag more clear * Make comment more clear * Remove management permission type * Fix test failure --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
* [Workspace] Add ACL related functions for workspace (#146) * [Workspace] Add acl related functions for workspace Signed-off-by: gaobinlong <gbinlong@amazon.com> * Minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify changelog Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more unit test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Modify test case Signed-off-by: gaobinlong <gbinlong@amazon.com> * Some minor change Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more test cases Signed-off-by: gaobinlong <gbinlong@amazon.com> * Optimize some code and the comments of the functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add more comments for some basic functions Signed-off-by: gaobinlong <gbinlong@amazon.com> * Export more interfaces Signed-off-by: gaobinlong <gbinlong@amazon.com> * consume permissions in repository Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * feat: consume permissions in serializer Signed-off-by: SuZhou-Joe <suzhou@amazon.com> * Add unit tests for consuming permissions in repository Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove double exclamation Signed-off-by: gaobinlong <gbinlong@amazon.com> * Rename some variables Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove duplicated semicolon Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add permissions field to the mapping only if the permission control is enabled Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> * Add feature flag config to the yml file Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make the comment of feature flag more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Make comment more clear Signed-off-by: gaobinlong <gbinlong@amazon.com> * Remove management permission type Signed-off-by: gaobinlong <gbinlong@amazon.com> * Fix test failure Signed-off-by: gaobinlong <gbinlong@amazon.com> --------- Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com> (cherry picked from commit 54c36fe) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* [Workspace] Add ACL related functions for workspace (#146) * consume permissions in repository * feat: consume permissions in serializer * Add unit tests for consuming permissions in repository * Remove double exclamation * Rename some variables * Remove duplicated semicolon * Add permissions field to the mapping only if the permission control is enabled * Fix test failure * Add feature flag config to the yml file * Make the comment of feature flag more clear * Make comment more clear * Remove management permission type * Fix test failure --------- (cherry picked from commit 54c36fe) Signed-off-by: gaobinlong <gbinlong@amazon.com> Signed-off-by: SuZhou-Joe <suzhou@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Josh Romero <rmerqg@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
Description
The main change of this PR are:
permissions
field to the default mapping of the OSD index(.kibana) to support ACL for workspaceIssues Resolved
#5083
Testing the changes
Check List
yarn test:jest
yarn test:jest_integration
yarn test:ftr