Skip to content

Disable private tenant for read only users#868

Merged
peternied merged 2 commits intoopensearch-project:mainfrom
hsiang9431-amzn:812-disable-readonly-private
Jun 9, 2022
Merged

Disable private tenant for read only users#868
peternied merged 2 commits intoopensearch-project:mainfrom
hsiang9431-amzn:812-disable-readonly-private

Conversation

@hsiang9431-amzn
Copy link
Contributor

@hsiang9431-amzn hsiang9431-amzn commented Nov 30, 2021

opensearch-project/security-dashboards-plugin pull request intake form

Please provide as much details as possible to get feedback/acceptance on your PR quickly

  1. Category: (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Bug fix

  1. Github Issue # or road-map entry, if available:

#812

  1. Description of changes:

If a user has a role that is configured as "read only" in opensearch_dashboards.yml, or if a user has the default read only role "kibana_read_only", make Dashboards behave as if the private tenant is disabled. You cannot choose "Private" in the tenant switch panel anymore, and a descriptive text is displayed in the tenant switch panel.

  1. Why these changes are required?

If a user has a read only role, offering the possibility to use the private tenant does not make much sense. The read only role implies that only read operations are allowed. Since no one other as the current user is able to access the private tenant, but due to read only the current user is also not allowed to make any changes, selecting the private tenant in this situation is useless.

  1. What is the old behavior before changes and new behavior after changes? (Please add any example/logs/screen-shot if available)

If a user has a read only role, the tenant switch panel would still allow to choose the private tenant.

  1. Testing done: (Please provide details of testing done: Unit testing, integration testing and manual testing)

Added additional tests to password-reset-panel.test.tsx. Manual testing for different combinations of roles and read only roles.

  1. TO-DOs, if any: (Please describe pending items and provide Github issues# for each of them)

None.

  1. Is it backport from main branch? (If yes, please add backport PR # and commits #)

No.

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

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.

@hsiang9431-amzn hsiang9431-amzn force-pushed the 812-disable-readonly-private branch 2 times, most recently from aa49c8d to a38b892 Compare November 30, 2021 22:12
@davidlago davidlago changed the title 812 disable readonly private Disable private tenant for read only user Feb 12, 2022
@davidlago davidlago changed the title Disable private tenant for read only user Disable private tenant for read only users Feb 12, 2022
Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the new functional test, could you please add unit test for the behavior in tenant_resolver.ts so your change in that file gets test coverage?

Signed-off-by: Gio Collina <gio.collina@eliatra.com>
Signed-off-by: Gio Collina <gio.collina@eliatra.com>
@cliu123 cliu123 force-pushed the 812-disable-readonly-private branch from a38b892 to d20d292 Compare June 9, 2022 00:18
@hsiang9431-amzn hsiang9431-amzn requested a review from a team June 9, 2022 00:18
@codecov-commenter
Copy link

Codecov Report

Merging #868 (d20d292) into main (c19b01f) will increase coverage by 0.11%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #868      +/-   ##
==========================================
+ Coverage   72.10%   72.21%   +0.11%     
==========================================
  Files          87       87              
  Lines        1907     1915       +8     
  Branches      247      249       +2     
==========================================
+ Hits         1375     1383       +8     
  Misses        478      478              
  Partials       54       54              
Impacted Files Coverage Δ
...plugin/public/apps/account/tenant-switch-panel.tsx 91.11% <0.00%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c19b01f...d20d292. Read the comment docs.

@cliu123
Copy link
Member

cliu123 commented Jun 9, 2022

I've rebased this PR against main branch.
@opensearch-project/security Please review.

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates

@peternied peternied merged commit 062ba6a into opensearch-project:main Jun 9, 2022
spartan2015 pushed a commit to spartan2015/security-dashboards-plugin that referenced this pull request Aug 8, 2022
* Disable private tenant for read only users

Signed-off-by: Gio Collina <gio.collina@eliatra.com>
Signed-off-by: Vasile Negru <vasile@eosfintek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants