seedClient inserts a public DCR client row and returns its ID. The CHECK constraints on oauth_clients require token_endpoint_auth_method='none' when public=TRUE, which matches what we want for the PKCE-only path fosite handles on our behalf.
(t *testing.T, pool *pgxpool.Pool, clientID string)
| 21 | // when public=TRUE, which matches what we want for the PKCE-only path |
| 22 | // fosite handles on our behalf. |
| 23 | func seedClient(t *testing.T, pool *pgxpool.Pool, clientID string) { |
| 24 | t.Helper() |
| 25 | _, err := pool.Exec(context.Background(), ` |
| 26 | INSERT INTO oauth_clients |
| 27 | (client_id, client_name, redirect_uris, grant_types, |
| 28 | response_types, scopes, audiences, token_endpoint_auth_method, |
| 29 | public, created_via) |
| 30 | VALUES ($1, $2, ARRAY['http://localhost/cb'], ARRAY['authorization_code','refresh_token'], |
| 31 | ARRAY['code'], ARRAY['agent'], ARRAY[]::TEXT[], 'none', |
| 32 | TRUE, 'dcr') |
| 33 | `, clientID, "test client") |
| 34 | if err != nil { |
| 35 | t.Fatalf("seedClient: %v", err) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | func seedUser(t *testing.T, store *identity.Store, sub string) string { |
| 40 | t.Helper() |