MCPcopy Index your code
hub / github.com/anomalyco/opencode / buildAuthorizeUrl

Function buildAuthorizeUrl

packages/opencode/src/plugin/snowflake-cortex.ts:91–103  ·  view source on GitHub ↗
(account: string, role: string | undefined, state: string, pkce: PkceCodes)

Source from the content-addressed store, hash-verified

89}
90
91function buildAuthorizeUrl(account: string, role: string | undefined, state: string, pkce: PkceCodes) {
92 const scope = oauthScope(role)
93 const params = new URLSearchParams({
94 client_id: OAUTH_CLIENT_ID,
95 response_type: "code",
96 redirect_uri: callbackUrl(),
97 scope,
98 state,
99 code_challenge: pkce.challenge,
100 code_challenge_method: "S256",
101 })
102 return `https://${account}.snowflakecomputing.com/oauth/authorize?${params.toString()}`
103}
104
105async function exchangeCodeForToken(account: string, code: string, pkce: PkceCodes) {
106 const response = await fetch(`https://${account}.snowflakecomputing.com/oauth/token-request`, {

Callers 1

authorizeFunction · 0.70

Calls 2

oauthScopeFunction · 0.85
callbackUrlFunction · 0.85

Tested by

no test coverage detected