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] Support test connection for datasource #2435

Closed
zhongnansu opened this issue Sep 28, 2022 · 7 comments
Closed

[MD] Support test connection for datasource #2435

zhongnansu opened this issue Sep 28, 2022 · 7 comments
Assignees
Labels
enhancement New feature or request multiple datasource multiple datasource project roadmap v2.5.0 'Issues and PRs related to version v2.5.0'

Comments

@zhongnansu
Copy link
Member

zhongnansu commented Sep 28, 2022

Adding test connection feature, as a button on data source related pages to:

  1. be able to validate connection with user inputs on the page, before actually creating or updating a data source
  2. be able to validate connection any time from data source detail page, for user checking or troubleshooting.
@zhongnansu zhongnansu added the v2.5.0 'Issues and PRs related to version v2.5.0' label Sep 28, 2022
@zhongnansu zhongnansu added multiple datasource multiple datasource project enhancement New feature or request labels Sep 28, 2022
@zengyan-amazon
Copy link
Member

there isn't an OpenSearch API that can be used to verify the connection/authentication. While I think we can leverage the authInfo API provided by the security plugin to verify the authentication if the data source has auth enabled. So the logic of the test connection is

  • if user choose username password auth type, attempt to call the authInfo API of the data source, the test operation success if getting 2xx response, otherwise the test fail
  • if user choose no auth for the data source, call the cluster info API /. if getting 2xx response, the test success, otherwise the test fail

This will require a new API in data source plugin for test connection function. And in the case of users wants to connect to a non-Opensearch endpoint, like Elasticsearch with x-pack security which supports basic auth, this test connection will not work even though the username and password is valid and it could run query against that data source

@zhongnansu zhongnansu changed the title [MD] Support test connection when creating datasource [MD] [Research] Support test connection when creating datasource Nov 3, 2022
@mpabba3003
Copy link
Contributor

@kristenTian
Copy link
Contributor

Update: we can try connecting to the cluster info API as well when there is auth. And only look for 401 Unauthorized error to check if the provided auth is invalid.

@zhongnansu
Copy link
Member Author

Update: we can try connecting to the cluster info API as well when there is auth. And only look for 401 Unauthorized error to check if the provided auth is invalid.

I think per @zengyan-amazon 's point, to suggest using security plugin api, e.g. _plugin/authInfo, is to make sure when user tries to connect to ES cluster, it's with only our security plugin installed, not x-pack security. Also why not check for 200? Don't we want a "test connection" to test successful connection at the moment? Checking 401 can only make sure the auth is correct, but I doubt it's equal with 200.

@kavilla
Copy link
Member

kavilla commented Dec 13, 2022

can this be closed by: #2973 @zhongnansu

@zhongnansu
Copy link
Member Author

can this be closed by: #2973 @zhongnansu

Yes

@zhongnansu zhongnansu changed the title [MD] [Research] Support test connection when creating datasource [MD] Support test connection for datasource Jan 5, 2023
@KrooshalUX
Copy link

Feedback from our review of the latest implantation:

MDS Create flow - test connection UX

  • Differentiate messages between a username/password error vs an error reaching the cluster
  • Message for Username/Password error: "Username or password is incorrect."
  • Error reaching the endpoint: "Failure connecting to endpoint."
  • Change button copy "Text Connection" to "Test connection"

MDS detail page - test connection UX

  • Differentiate messages between a username/password error vs an error reaching the cluster
  • Message for Username/Password error: "Username or password is incorrect."
  • Error reaching the endpoint: "Failure connecting to endpoint."
  • Change button copy "Test Connection" to "Test connection"

Non blocking feedback (to add to the project roadmap):

  • Update the change password flow according to designs in Figma
  • When a user successfully completes a connection test, change the state of Test connection button to a success state (EuiIcon="check") See guidance in "Toggle buttons -> Change visual appearance" & use color euiColorSuccess

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request multiple datasource multiple datasource project roadmap v2.5.0 'Issues and PRs related to version v2.5.0'
Projects
None yet
Development

No branches or pull requests

6 participants