-
Notifications
You must be signed in to change notification settings - Fork 947
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]Optimize workspace permission validation for bulk operations #7516
[Workspace]Optimize workspace permission validation for bulk operations #7516
Conversation
5c62c6b
to
a6521a2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7516 +/- ##
==========================================
+ Coverage 63.65% 63.67% +0.01%
==========================================
Files 3632 3632
Lines 80060 80101 +41
Branches 12683 12691 +8
==========================================
+ Hits 50965 51004 +39
Misses 25990 25990
- Partials 3105 3107 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
a6521a2
to
e8b4b17
Compare
Signed-off-by: Lin Wang <wonglam@amazon.com>
98d108d
to
cc91fd4
Compare
this._savedObjectCache.delete(requestKey); | ||
} | ||
|
||
public isSavedObjectsCacheActive(request: OpenSearchDashboardsRequest) { |
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.
Do we need to call isSavedObjectsCacheActive
before clearSavedObjectsCache
? Seems it can call clearSavedObjectsCache
directly.
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.
Sure, since this delete operation will be fired in every request response. Not sure if it too expensive to do the delete.
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.
We can encapsulate the check in clearSavedObjectsCache
Signed-off-by: Lin Wang <wonglam@amazon.com>
Co-authored-by: SuZhou-Joe <suzhou@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>
…ns (#7516) * Optimize workspace permission validation for bulk operations Signed-off-by: Lin Wang <wonglam@amazon.com> * Changeset file for PR #7516 created/updated * Remove isSavedObjectsCacheActive in permission control client Signed-off-by: Lin Wang <wonglam@amazon.com> * Update src/plugins/workspace/server/permission_control/client.ts Co-authored-by: SuZhou-Joe <suzhou@amazon.com> Signed-off-by: Lin Wang <wonglam@amazon.com> * Rename cacheSavedObjects to addToCacheAllowlist Signed-off-by: Lin Wang <wonglam@amazon.com> * Use request uuid as cache 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: SuZhou-Joe <suzhou@amazon.com> (cherry picked from commit ef47b5f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ns (#7516) (#7660) * Optimize workspace permission validation for bulk operations * Changeset file for PR #7516 created/updated * Remove isSavedObjectsCacheActive in permission control client * Update src/plugins/workspace/server/permission_control/client.ts * Rename cacheSavedObjects to addToCacheAllowlist * Use request uuid as cache --------- (cherry picked from commit ef47b5f) 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: SuZhou-Joe <suzhou@amazon.com>
Description
This PR is for optimizing saved objects's workspace permission validation logic for bulk operations. It mainly includes below three changes:
Issues Resolved
#7520
Screenshot
No UI Changes
Testing the changes
Can refer test files:
Changelog
Check List
yarn test:jest
yarn test:jest_integration