MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / newPKCE

Function newPKCE

internal/agent/oauth_token_test.go:101–111  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

99}
100
101func newPKCE(t *testing.T) (verifier, challenge string) {
102 t.Helper()
103 v := make([]byte, 32)
104 if _, err := rand.Read(v); err != nil {
105 t.Fatal(err)
106 }
107 verifier = base64.RawURLEncoding.EncodeToString(v)
108 sum := sha256.Sum256([]byte(verifier))
109 challenge = base64.RawURLEncoding.EncodeToString(sum[:])
110 return
111}
112
113// mintAuthCode drives fosite's authorize flow inline to produce a code
114// for the given user/client. This is what the consent handler will do

Calls 1

makeFunction · 0.85

Tested by

no test coverage detected