Repository navigation
feat(core): add Snowflake Cortex browser OAuth login - #47151
Closed
rekram1-node wants to merge 1 commit into
Closed
rekram1-node wants to merge 1 commit into
rekram1-node wants to merge 1 commit into
Conversation
Collaborator
Author
|
Superseded by #47156, which uses native AI-package routing, session HTTP hooks, and account-aware browser/PAT authentication with local HTTP fixture coverage. |
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.
Ports the V1 Snowflake Cortex browser OAuth flow to the V2 plugin system as an
IntegrationOAuthMethodRegistrationon thesnowflake-cortexintegration.What changed
packages/core/src/plugin/provider/snowflake-cortex.tsbrowserOAuth method ("Login with Snowflake (External Browser)") withaccount(required) androle(optional) form fields.authorize: normalizes the account (strips scheme /.snowflakecomputing.com/ trailing slashes), generates PKCE + state, starts an ephemeral127.0.0.1loopback listener (lazynode:http, closed by scope finalizer), and returns the account-specifichttps://<account>.snowflakecomputing.com/oauth/authorizeURL using theLOCAL_APPLICATIONpublic client. Role maps tosession:role:<ROLE>orsession:role-encoded:<...>scope as in V1./oauth/token-requestwith BasicLOCAL_APPLICATION:LOCAL_APPLICATION.refresh: refresh-token grant against the account stored in credential metadata; keeps the prior refresh token if the response omits one.{ account, baseURL }. The model resolver already projects OAuth metadata into provider settings, sobaseURLreplaces the catalog's${SNOWFLAKE_ACCOUNT}template and the access token becomes the bearerapiKeyon both the native andsdk-hook paths. No changes to the existingsdkhook,cortexFetch, or PAT/env handling.labelshows the account on the stored credential.packages/core/test/plugin/provider-snowflake-cortex.test.tscortexFetchtests unchanged.V1 behavior deliberately dropped
open(url): V2 clients openattempt.url.fetch: core refreshes viaconnection.resolvewhen the token is within 5 minutes of expiry, consistent with the other V2 OAuth providers.key/envmethods remain as-is.Verification
bun typecheckinpackages/corebun test test/plugin/provider-snowflake-cortex.test.tsinpackages/core(21 pass)