(t *testing.T)
| 99 | } |
| 100 | |
| 101 | func 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 |
no test coverage detected