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

Hide/Show authentication method in multi data source plugin based on configuration #5916

Merged

Conversation

xinruiba
Copy link
Member

@xinruiba xinruiba commented Feb 22, 2024

Description

PR to hide/Show authentication method in multi data source plugin based on configuration

Please check more details under #5694

Issues Resolved

#5694

Screenshot

AuthTypeRegistry.mov

Testing the changes

New test cases added.

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

…ass value to dataSourceManagement root mount

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
…with AuthRegistray and providing data source options from AuthRegistry

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 89.47368% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 67.02%. Comparing base (6d5560e) to head (6d7463e).
Report is 4 commits behind head on main.

❗ Current head 6d7463e differs from pull request most recent head 39f77b9. Consider uploading reports for the commit 39f77b9 to get more accurate results

Files Patch % Lines
...rc/plugins/data_source_management/public/plugin.ts 42.85% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5916   +/-   ##
=======================================
  Coverage   67.01%   67.02%           
=======================================
  Files        3310     3307    -3     
  Lines       63647    63650    +3     
  Branches    10165    10171    +6     
=======================================
+ Hits        42656    42664    +8     
+ Misses      18522    18514    -8     
- Partials     2469     2472    +3     
Flag Coverage Δ
Linux_1 35.21% <ø> (ø)
Linux_2 55.09% <ø> (ø)
Linux_3 43.68% <89.47%> (-0.70%) ⬇️
Linux_4 35.21% <52.17%> (+<0.01%) ⬆️
Windows_1 35.24% <ø> (ø)
Windows_2 55.06% <ø> (ø)
Windows_3 43.70% <89.47%> (-0.70%) ⬇️
Windows_4 35.21% <52.17%> (+<0.01%) ⬆️

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.

xinruiba and others added 10 commits February 23, 2024 00:12
…ce creation page

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
…s no more than 1

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
…ct NoAuth option. Also update credentialField data type

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
});
});

test('default auth method is NoAuth when no auth options configured', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I thought that will nothing return, and gray out. so we changed the plan to show NoAuth

Copy link
Member Author

Choose a reason for hiding this comment

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

@bandinib-amzn and I have a further discussion, when there are no option enabled, the UX will looks like this:
Screenshot 2024-02-26 at 5 11 36 PM

@bandinib-amzn
Copy link
Member

Screenshot 2024-02-26 at 3 14 48 PM

Can we update this text as well?

If NoAuthentication.enabled: true

Enter the authentication details to access the endpoint. If no authentication is required, select No authentication

If NoAuthentication.enabled: false

Enter the authentication details to access the endpoint.

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
@xinruiba
Copy link
Member Author

xinruiba commented Feb 27, 2024

Synced with @bandinib-amzn offline, when NoAuth type not been supported, the page will looks like this:

Screenshot 2024-02-26 at 5 11 36 PM

Flyingliuhub
Flyingliuhub previously approved these changes Feb 27, 2024
xinruiba and others added 3 commits February 27, 2024 21:26
@xinruiba
Copy link
Member Author

Test failure not looks like related to this change.

@bandinib-amzn bandinib-amzn added the multiple datasource multiple datasource project label Feb 28, 2024
@bandinib-amzn bandinib-amzn merged commit 20b6c5a into opensearch-project:main Feb 28, 2024
17 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 28, 2024
…configuration (#5916)

* [AuthType Config] Add EnabledAuthType configuration in yml file and pass value to dataSourceManagement root mount

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthType Config] provide default auth types when types array is empty

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard - DataSourceCreationForm] Integrate auth cofig with AuthRegistray and providing data source options from AuthRegistry

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] Support default selected auth type in datasource creation page

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] SDisable auth option selector when auth options no more than 1

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] clear credential attribute every time use select NoAuth option. Also update credentialField data type

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update yml file to disable config

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update change.md file

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Fix broken test cases

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Add more unit tests

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test and handle scenario when no options enabled

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update description of unit test case

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test cases to resolve comment

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Snapshot auth option super selector for unit test. Also upate the default message in datasorurce creation form ---> auth type section

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

---------

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
(cherry picked from commit 20b6c5a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
gaobinlong pushed a commit to gaobinlong/OpenSearch-Dashboards that referenced this pull request Feb 28, 2024
…configuration (opensearch-project#5916)

* [AuthType Config] Add EnabledAuthType configuration in yml file and pass value to dataSourceManagement root mount

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthType Config] provide default auth types when types array is empty

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard - DataSourceCreationForm] Integrate auth cofig with AuthRegistray and providing data source options from AuthRegistry

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] Support default selected auth type in datasource creation page

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] SDisable auth option selector when auth options no more than 1

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] clear credential attribute every time use select NoAuth option. Also update credentialField data type

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update yml file to disable config

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update change.md file

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Fix broken test cases

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Add more unit tests

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test and handle scenario when no options enabled

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update description of unit test case

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test cases to resolve comment

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Snapshot auth option super selector for unit test. Also upate the default message in datasorurce creation form ---> auth type section

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

---------

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
ZilongX pushed a commit that referenced this pull request Feb 28, 2024
…configuration (#5916) (#5976)

* [AuthType Config] Add EnabledAuthType configuration in yml file and pass value to dataSourceManagement root mount

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthType Config] provide default auth types when types array is empty

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard - DataSourceCreationForm] Integrate auth cofig with AuthRegistray and providing data source options from AuthRegistry

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] Support default selected auth type in datasource creation page

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] SDisable auth option selector when auth options no more than 1

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] clear credential attribute every time use select NoAuth option. Also update credentialField data type

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update yml file to disable config

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update change.md file

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Fix broken test cases

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Add more unit tests

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test and handle scenario when no options enabled

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update description of unit test case

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test cases to resolve comment

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Snapshot auth option super selector for unit test. Also upate the default message in datasorurce creation form ---> auth type section

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

---------

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>
(cherry picked from commit 20b6c5a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Mar 4, 2024
…configuration (opensearch-project#5916)

* [AuthType Config] Add EnabledAuthType configuration in yml file and pass value to dataSourceManagement root mount

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthType Config] provide default auth types when types array is empty

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard - DataSourceCreationForm] Integrate auth cofig with AuthRegistray and providing data source options from AuthRegistry

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] Support default selected auth type in datasource creation page

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] SDisable auth option selector when auth options no more than 1

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [AuthRegistry Onboard] clear credential attribute every time use select NoAuth option. Also update credentialField data type

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update yml file to disable config

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* Update change.md file

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Fix broken test cases

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Add more unit tests

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test and handle scenario when no options enabled

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update description of unit test case

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] update unit test cases to resolve comment

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

* [UT] Snapshot auth option super selector for unit test. Also upate the default message in datasorurce creation form ---> auth type section

Signed-off-by: Xinrui Bai <xinruiba@amazon.com>

---------

Signed-off-by: Xinrui Bai <xinruiba@amazon.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.

5 participants