Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

add global tenant for report definition urls #324

Conversation

zhongnansu
Copy link
Member

@zhongnansu zhongnansu commented Feb 16, 2021

Issue #, if available:
on-demand report definition still renders the tenant panel
Description of changes:
add condtion to check global tenant and add to url

TODO:

  1. remove the old fix where we add the key-value pair to browser loacal storage
  2. See if we can get rid of the addTenantToUrl logic from UI side. Only using the tenant info from ES backend.
  3. Currently there's no way to distinguish global tenant and non-security from tenant field returned by backend. As they both are empty string.

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.

if (tenant === '__user__') {
if (tenant !== undefined) {
if (tenant === '') {
tenant = 'global';
Copy link
Contributor

Choose a reason for hiding this comment

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

what if the user creates a new tenant with name "global"?

Copy link
Member Author

Choose a reason for hiding this comment

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

then after this if else check, tenant variable will be assigned with global. It will be added to the url without any issue. Same for global tenant. they follow the same format in the url ?security_tenant=global or ?security_tenant=<customized_tenant_name>. From the actual behavior point, it's out of our control. Not sure seucirty plugin has a way to distinguish that.

@codecov
Copy link

codecov bot commented Feb 16, 2021

Codecov Report

Merging #324 (f5cd6b7) into dev (9a0534d) will decrease coverage by 0.03%.
The diff coverage is 25.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev     #324      +/-   ##
============================================
- Coverage     64.07%   64.04%   -0.04%     
  Complexity      291      291              
============================================
  Files           100      100              
  Lines          4064     4066       +2     
  Branches        618      619       +1     
============================================
  Hits           2604     2604              
- Misses         1300     1302       +2     
  Partials        160      160              
Flag Coverage Δ Complexity Δ
Kibana-reports 77.23% <25.00%> (-0.09%) 0.00 <0.00> (ø)
reports-scheduler 53.28% <ø> (ø) 0.00 <ø> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...orts/server/routes/utils/converters/backendToUi.ts 69.67% <25.00%> (-1.17%) 0.00 <0.00> (ø)

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 9a0534d...f5cd6b7. Read the comment docs.

@zhongnansu zhongnansu marked this pull request as ready for review February 16, 2021 21:49
@zhongnansu zhongnansu merged commit fb3cdf8 into opendistro-for-elasticsearch:dev Feb 16, 2021
zhongnansu added a commit to zhongnansu/kibana-reports that referenced this pull request Feb 27, 2021
zhongnansu added a commit that referenced this pull request Mar 1, 2021
…o 7.9.1 from opendistro-1.13.0.0 (#337)

* add security_tenant info into url (#323)

* add global tenant for report definition urls (#324)

* update target
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants