Remove multi-tenant path check in auth handler#1151
Merged
cliu123 merged 8 commits intoopensearch-project:mainfrom Oct 28, 2022
Merged
Remove multi-tenant path check in auth handler#1151cliu123 merged 8 commits intoopensearch-project:mainfrom
cliu123 merged 8 commits intoopensearch-project:mainfrom
Conversation
kristenTian
previously approved these changes
Oct 20, 2022
cliu123
previously approved these changes
Oct 21, 2022
DarshitChanpura
previously requested changes
Oct 21, 2022
Member
DarshitChanpura
left a comment
There was a problem hiding this comment.
Ty for submitting this PR. Could you please add a test/modify a test to check this behavior?
cliu123
reviewed
Oct 26, 2022
The Opensearch Dashboards tenant only impacts the saved objects access. The multi-tenant path check in the auth handler was meant to by pass the resolve tenant logic for some APIs which doesn't deal with saved objects. However with the new datasource support feature in OpenSearch Dashboards, Dashboards APIs which used to not dealing with saved objects such as data queries and index resolve operations will require the new data source saved object type under the hood. This change removes the multi-tenant path check, so that tenant header will be injected to all route handlers. So that all route handlers can work with the right tenant in case they need to deal with any saved objects. Signed-off-by: Yan Zeng <zengyan@amazon.com>
Signed-off-by: Yan Zeng <zengyan@amazon.com>
Signed-off-by: Yan Zeng <zengyan@amazon.com>
Signed-off-by: Yan Zeng <zengyan@amazon.com>
Signed-off-by: Yan Zeng <zengyan@amazon.com>
e02522f to
d74605e
Compare
cliu123
previously approved these changes
Oct 26, 2022
kristenTian
previously approved these changes
Oct 26, 2022
cwperks
previously approved these changes
Oct 27, 2022
Member
|
Integration test failed. |
Signed-off-by: Yan Zeng <zengyan@amazon.com>
a4cb488
Codecov Report
@@ Coverage Diff @@
## main #1151 +/- ##
=======================================
Coverage 72.07% 72.07%
=======================================
Files 88 88
Lines 1959 1959
Branches 258 258
=======================================
Hits 1412 1412
Misses 490 490
Partials 57 57 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
cliu123
approved these changes
Oct 28, 2022
cwperks
approved these changes
Oct 28, 2022
@DarshitChanpura Thanks for reviewing! All the comments have been resolved. We are merging this PR.
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Oct 28, 2022
Signed-off-by: Yan Zeng <zengyan@amazon.com> Co-authored-by: Chang Liu <lc12251109@gmail.com> (cherry picked from commit 6236fe2)
cliu123
pushed a commit
that referenced
this pull request
Oct 28, 2022
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The Opensearch Dashboards tenant only impacts the saved objects access. The multi-tenant path check in the auth handler was meant to by pass the resolve tenant logic for some APIs which doesn't deal with saved objects. However with the new datasource support feature in OpenSearch Dashboards, Dashboards APIs which used to not dealing with saved objects such as data queries and index resolve operations will require the new data source saved object type under the hood.
This change removes the multi-tenant path check, so that tenant header will be injected to all route handlers. So that all route handlers can work with the right tenant in case they need to deal with any saved objects.
Signed-off-by: Yan Zeng zengyan@amazon.com
Category
Bug fix
Why these changes are required?
This change is required for OpenSearch Dashboards data source support feature to work with correct tenant when querying remote data sources.
What is the old behavior before changes and new behavior after changes?
Old behavior: auth handler will not inject tenant header for some APIs (e.g. APIs starts with
/internal)New behavior: auth handler will inject tenant header to all OSD APIs
Issues Resolved
opensearch-project/OpenSearch-Dashboards#2634
Testing
Manually tested

Old behavior causing error getting saved objects:
New behavior solved the issue:

Check List
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.