feat: add connection test API#682
Open
sowen1023 wants to merge 2 commits into
Open
Conversation
Contributor
Author
CI failure noteThe Locally verified:
|
Contributor
Author
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.




What does this PR do
Adds Test Connection for data sources so users can validate credentials before saving.
POST /datasource/_test_connectionand per-connectorConnectionTesterimplementations: MongoDB, PostgreSQL, MySQL, MSSQL, Oracle, Neo4j,Milvus, Network Drive.
TestConnectionButtonintegrated into therdbms,mongodb,neo4j,milvus,network_driveforms with inline ✓/✗ feedback.DB_NAME()becausego-mssqldbsilently falls back tomasterwhen the configured database is missing.Incidental fixes pulled in while testing:
web: persistaccess_tokento localStorage on login and injectAuthorization: Bearerin the main request interceptor (previously only set on theunused
demoRequest).core/auth_filter.go: temporaryAuthFilterthat re-wires JWT/session →r.Context(). Framework's security refactor dropped the equivalent filter;remove once it lands upstream.
Rationale for this change
Misconfigured data sources fail silently during the first sync. Surfacing failures at config time saves an iteration cycle.
The MSSQL verification matters because the path-style URI
sqlserver://user:pass@host:1433/databasereports success while actually connecting tomaster,then queries explode with
Invalid object name.The auth fixes blocked the new endpoint itself: every authenticated request was rejected by
PermissionFilterafter the framework refactor. Including themhere keeps the branch self-buildable.
Standards checklist
databaseFromMSSQLURIandTestSQLConnection