-
Notifications
You must be signed in to change notification settings - Fork 885
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]Restrict saved objects finding when workspace enabled #7125
[Workspace]Restrict saved objects finding when workspace enabled #7125
Conversation
…bled Signed-off-by: Lin Wang <wonglam@amazon.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7125 +/- ##
==========================================
- Coverage 67.56% 67.55% -0.01%
==========================================
Files 3469 3469
Lines 68508 68497 -11
Branches 11141 11138 -3
==========================================
- Hits 46289 46276 -13
- Misses 19514 19515 +1
- Partials 2705 2706 +1
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: Lin Wang <wonglam@amazon.com>
42923d3
to
17b36b6
Compare
// TODO: The `formatFindParams` is a workaround for 2.14 to always list global data sources, | ||
// should remove this workaround in the upcoming release once readonly share is available. | ||
wrapperOptions.client.find(this.formatFindParams(options)), | ||
find: wrapperOptions.client.find, |
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.
Can we remove formatFindParams
since it's no longer used?
src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts
Outdated
Show resolved
Hide resolved
…ects_client_wrapper.ts Co-authored-by: SuZhou-Joe <suzhou@amazon.com> Signed-off-by: Lin Wang <wonglam@amazon.com>
…ects_client_wrapper.ts Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
* Limit data source saved objects finding and access when workspace enabled Signed-off-by: Lin Wang <wonglam@amazon.com> * Remove options.workspaces drop behavior in conflict client wrapper Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #7125 created/updated * Update src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts Co-authored-by: SuZhou-Joe <suzhou@amazon.com> Signed-off-by: Lin Wang <wonglam@amazon.com> * Update src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> Signed-off-by: Lin Wang <wonglam@amazon.com> * Remove formatFindParams Signed-off-by: Lin Wang <wonglam@amazon.com> * Fix code format Signed-off-by: Lin Wang <wonglam@amazon.com> * Fix ACLSearchParams and empty workspaces Signed-off-by: Lin Wang <wonglam@amazon.com> * Refactor workspace client wrapper find Signed-off-by: Lin Wang <wonglam@amazon.com> * Remove global saved objects validation logic Signed-off-by: Lin Wang <wonglam@amazon.com> * Update uts and its Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #7125 created/updated * Remove no need changes and refactor Signed-off-by: Lin Wang <wonglam@amazon.com> * Fix global saved objects not found Signed-off-by: Lin Wang <wonglam@amazon.com> * Change saved object get to assert Signed-off-by: Lin Wang <wonglam@amazon.com> --------- Signed-off-by: Lin Wang <wonglam@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Yulong Ruan <ruanyu1@gmail.com> (cherry picked from commit 1cb5956) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…) (#7182) * Limit data source saved objects finding and access when workspace enabled * Remove options.workspaces drop behavior in conflict client wrapper * Changeset file for PR #7125 created/updated * Update src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts * Update src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts * Remove formatFindParams * Fix code format * Fix ACLSearchParams and empty workspaces * Refactor workspace client wrapper find * Remove global saved objects validation logic * Update uts and its * Changeset file for PR #7125 created/updated * Remove no need changes and refactor * Fix global saved objects not found * Change saved object get to assert --------- (cherry picked from commit 1cb5956) Signed-off-by: Lin Wang <wonglam@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: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Co-authored-by: Yulong Ruan <ruanyl@amazon.com> Co-authored-by: SuZhou-Joe <suzhou@amazon.com> Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Description
This PR is for restricting saved objects finding when workspace enabled. Non dashboard admin should only have access to saved objects in workspaces. This PR will overwrite passed arguments.
Issues Resolved
#7127
Screenshot
No ui changes
Testing the changes
See the integration test file:
src/plugins/workspace/server/saved_objects/integration_tests/workspace_saved_objects_client_wrapper.test.ts
Changelog
Check List
yarn test:jest
yarn test:jest_integration