Skip to content
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] Dashboard admin(groups/users) implementation #6554

Merged
merged 37 commits into from
May 24, 2024

Conversation

yubonluo
Copy link
Contributor

@yubonluo yubonluo commented Apr 19, 2024

Description

This PR set the backend roles in groups or users, whoever has the backend roles or exactly match the user or groups ids defined in this yml.config/dynamic config will be regard as dashboard admin.
Dashboard admin will have the access to all the workspaces and objects inside OpenSearch Dashboards.

Issues Resolved

#6389

Changelog

  • feat: [Workspace] Dashboard admin(groups/users) implementation.

Screenshot

No UI change in this PR.

Testing the changes

Yml config test

  1. Clone the latest code and clone security-dashboards-plugin to the plugins directory
  2. Build the security-dashboards-plugin and bootstrap
  3. Download the patch file test.patch and yarn git apply ./test.patch
  4. Modify config/opensearch_dashboards.yml
workspace.enabled: true 
opensearch.hosts: ["https://localhost:9200"]
opensearch.username: "username"
opensearch.password: "password" 
opensearch.ssl.verificationMode: none
savedObjects.permission.enabled: true

opensearchDashboards.dashboardAdmin.groups: ["dashboard_admin"]
opensearchDashboards.dashboardAdmin.users: ["dashboard_admin"]
  1. Run yarn start --no-base-path and visit http://localhost:5601
  2. You can check whether it is dashboards admin in the console.
image

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

yubonluo and others added 5 commits April 15, 2024 13:45
…ing with dynamic application config

Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Signed-off-by: yubonluo <[email protected]>
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 67.38%. Comparing base (3e9a159) to head (e6f9a18).
Report is 431 commits behind head on main.

Files with missing lines Patch % Lines
src/plugins/workspace/server/plugin.ts 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6554      +/-   ##
==========================================
+ Coverage   67.36%   67.38%   +0.01%     
==========================================
  Files        3443     3443              
  Lines       67762    67788      +26     
  Branches    11024    11031       +7     
==========================================
+ Hits        45651    45679      +28     
+ Misses      19440    19439       -1     
+ Partials     2671     2670       -1     
Flag Coverage Δ
Linux_1 33.07% <96.77%> (+0.03%) ⬆️
Linux_2 55.13% <100.00%> (ø)
Linux_3 45.15% <0.00%> (+<0.01%) ⬆️
Linux_4 34.81% <100.00%> (ø)
Windows_1 33.09% <96.77%> (+0.03%) ⬆️
Windows_2 55.10% <100.00%> (ø)
Windows_3 45.16% <0.00%> (ø)
Windows_4 34.81% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: yubonluo <[email protected]>
SuZhou-Joe
SuZhou-Joe previously approved these changes May 20, 2024
SuZhou-Joe
SuZhou-Joe previously approved these changes May 23, 2024
@SuZhou-Joe SuZhou-Joe merged commit b839da1 into opensearch-project:main May 24, 2024
71 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 24, 2024
* [Workspace] dashboard admin(groups/users) implementation and integrating with dynamic application config

Signed-off-by: yubonluo <[email protected]>

* Modify change log

Signed-off-by: yubonluo <[email protected]>

* optimize the code

Signed-off-by: yubonluo <[email protected]>

* modify change log

Signed-off-by: yubonluo <[email protected]>

* modify change log

Signed-off-by: yubonluo <[email protected]>

* solve change log issue

Signed-off-by: yubonluo <[email protected]>

* Changeset file for PR #6554 created/updated

* [Workspace] delete useless code

Signed-off-by: yubonluo <[email protected]>

* Changeset file for PR #6554 created/updated

* delete useless code

Signed-off-by: yubonluo <[email protected]>

* Optimize the code

Signed-off-by: yubonluo <[email protected]>

* Add unit test to cover setupPermission in plugin.

Signed-off-by: yubonluo <[email protected]>

* delete the logic of dynamic application config

Signed-off-by: yubonluo <[email protected]>

* Default to OSD admin if security uninstall

Signed-off-by: yubonluo <[email protected]>

* Default to OSD admin if security uninstall

Signed-off-by: yubonluo <[email protected]>

---------

Signed-off-by: yubonluo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit b839da1)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request May 27, 2024
* [Workspace] dashboard admin(groups/users) implementation and integrating with dynamic application config



* Modify change log



* optimize the code



* modify change log



* modify change log



* solve change log issue



* Changeset file for PR #6554 created/updated

* [Workspace] delete useless code



* Changeset file for PR #6554 created/updated

* delete useless code



* Optimize the code



* Add unit test to cover setupPermission in plugin.



* delete the logic of dynamic application config



* Default to OSD admin if security uninstall



* Default to OSD admin if security uninstall



---------



(cherry picked from commit b839da1)

Signed-off-by: yubonluo <[email protected]>
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>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
…project#6554)

* [Workspace] dashboard admin(groups/users) implementation and integrating with dynamic application config

Signed-off-by: yubonluo <[email protected]>

* Modify change log

Signed-off-by: yubonluo <[email protected]>

* optimize the code

Signed-off-by: yubonluo <[email protected]>

* modify change log

Signed-off-by: yubonluo <[email protected]>

* modify change log

Signed-off-by: yubonluo <[email protected]>

* solve change log issue

Signed-off-by: yubonluo <[email protected]>

* Changeset file for PR opensearch-project#6554 created/updated

* [Workspace] delete useless code

Signed-off-by: yubonluo <[email protected]>

* Changeset file for PR opensearch-project#6554 created/updated

* delete useless code

Signed-off-by: yubonluo <[email protected]>

* Optimize the code

Signed-off-by: yubonluo <[email protected]>

* Add unit test to cover setupPermission in plugin.

Signed-off-by: yubonluo <[email protected]>

* delete the logic of dynamic application config

Signed-off-by: yubonluo <[email protected]>

* Default to OSD admin if security uninstall

Signed-off-by: yubonluo <[email protected]>

* Default to OSD admin if security uninstall

Signed-off-by: yubonluo <[email protected]>

---------

Signed-off-by: yubonluo <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants