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

[MD] Fix server sider endpoint validation by passing in request when creating datasource client #6822

Merged

Conversation

zhongnansu
Copy link
Member

@zhongnansu zhongnansu commented May 23, 2024

Description

  • Fix endpoint validation by passing in request when creating datasource client. Even tho request is an optional param, but there might be data source auth types registered that from external plugin, that will depend on the request. So we still need to pass it in when creating the client. Note that for existing MDS auth types, noauth, basic auth, sigV4, they don't depend on "request".
  • added test

Issues Resolved

Screenshot

Testing the changes

Changelog

  • fix: fix endpoint validation by passing in request when creating datasource client

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

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.92%. Comparing base (972cf10) to head (b80b940).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6822       +/-   ##
===========================================
- Coverage   67.56%   56.92%   -10.64%     
===========================================
  Files        3428     3141      -287     
  Lines       67343    63342     -4001     
  Branches    10996    10378      -618     
===========================================
- Hits        45498    36059     -9439     
- Misses      19176    25045     +5869     
+ Partials     2669     2238      -431     
Flag Coverage Δ
Linux_1 ?
Linux_2 ?
Linux_3 ?
Linux_4 ?
Windows_1 33.06% <ø> (ø)
Windows_2 ?
Windows_3 45.17% <100.00%> (+<0.01%) ⬆️
Windows_4 34.73% <ø> (ø)

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.

opensearch-changeset-bot bot added a commit to zhongnansu/OpenSearch-Dashboards that referenced this pull request May 23, 2024
… source client

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
@zhongnansu zhongnansu force-pushed the fix-endpoint-validation-request branch from 41a9ca2 to 6d21e1c Compare May 23, 2024 18:54
@zhongnansu zhongnansu changed the title [MD] Fix endpoint validation by passing in request when creating datasource client [MD] Fix server sider endpoint validation by passing in request when creating datasource client May 23, 2024
@zhongnansu zhongnansu added multiple datasource multiple datasource project v2.15.0 labels May 23, 2024
Copy link
Collaborator

@zhyuanqi zhyuanqi left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -290,6 +304,7 @@ export class DataSourceSavedObjectsClientWrapper {
savedObjects: {} as any,
cryptography: this.cryptography,
testClientDataSourceAttr: attributes as DataSourceAttributes,
request,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assuming this.dataSourcesService.getDataSourceClient already supports this option being passed?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, it's an optional param tho

@zhongnansu zhongnansu merged commit 54b5eb5 into opensearch-project:main May 23, 2024
72 of 73 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 23, 2024
…creating datasource client (#6822)

* [MD] Fix endpoint validation by passing in request when creating data source client

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
(cherry picked from commit 54b5eb5)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
zhongnansu pushed a commit that referenced this pull request May 28, 2024
…creating datasource client (#6822) (#6824)

* [MD] Fix endpoint validation by passing in request when creating data source client


(cherry picked from commit 54b5eb5)

Signed-off-by: Zhongnan Su <szhongna@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>
LDrago27 pushed a commit to LDrago27/OpenSearch-Dashboards that referenced this pull request Jun 3, 2024
…creating datasource client (opensearch-project#6822)

* [MD] Fix endpoint validation by passing in request when creating data source client

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
@zhongnansu zhongnansu mentioned this pull request Jun 11, 2024
7 tasks
@zhongnansu zhongnansu added the bug Something isn't working label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants