fix: Hide Token Auth for Snowflake endpoints#3459
Draft
zackverham wants to merge 5 commits intomainfrom
Draft
Conversation
When creating a credential for Connect inside Snowflake, Token Authentication doesn't work - only API Key and Snowflake Connection work. This change modifies the auth method selection to show different options based on the server type: - For Connect URLs: Token Authentication (Recommended), API Key - For Snowflake URLs: Snowflake Connection, API Key (no Token Auth) Fixes #3226 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Export AuthMethod, AuthMethodName, and getAuthMethod for testing - Add tests for getAuthMethod covering all three auth methods - Add tests for AuthMethod and AuthMethodName enum values - Create multiStepHelpers.test.ts with tests for server type helpers (isConnect, isSnowflake, isConnectCloud) and type conversion helpers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Enhance the "New PCS Credential" test to explicitly verify that: - Exactly 2 auth method options are shown - First option is "Token Authentication" with "Recommended" label - Second option is "API Key" Added a note that Snowflake endpoints show different options (Snowflake Connection + API Key, no Token Auth) but cannot be E2E tested without Snowflake infrastructure. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous fix only hid Token Auth when the URL matched Snowflake patterns (*.snowflakecomputing.app). However, users inside Snowflake often use internal URLs like https://connect/ which don't match those patterns, causing Token Auth to still appear even though it won't work. This change adds detection of Snowflake environment by checking if Snowflake connections are configured on the system. When connections exist (from connections.toml, config.toml, or environment variables), we're inside Snowflake and Token Auth should be hidden. Backend changes: - Add hasSnowflakeConnections field to test-credentials API response - Check for Snowflake connections when validating credentials Frontend changes: - Update TestResult type to include hasSnowflakeConnections - Hide Token Auth when hasSnowflakeConnections is true OR URL is Snowflake Fixes #3226 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
When creating a credential for Connect inside Snowflake, Token Authentication doesn't work - only API Key and Snowflake Connection work. This change modifies the auth method selection to show different options based on the server type:
Fixes #3226
Intent
Type of Change
Approach
User Impact
Automated Tests
Directions for Reviewers
Checklist