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

Function generatePKCE

packages/opencode/src/plugin/snowflake-cortex.ts:58–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56}
57
58async function generatePKCE(): Promise<PkceCodes> {
59 const verifier = generateRandomString(64)
60 const hash = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(verifier))
61 return {
62 verifier,
63 challenge: base64UrlEncode(hash),
64 }
65}
66
67function callbackUrl() {
68 if (!oauthServerPort) throw new Error("Snowflake OAuth callback server is not running")

Callers 1

authorizeFunction · 0.70

Calls 2

generateRandomStringFunction · 0.70
base64UrlEncodeFunction · 0.70

Tested by

no test coverage detected