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

Function seedClient

internal/oauth/storage_test.go:23–37  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

21// when public=TRUE, which matches what we want for the PKCE-only path
22// fosite handles on our behalf.
23func 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
39func seedUser(t *testing.T, store *identity.Store, sub string) string {
40 t.Helper()

Callers 1

setupFunction · 0.85

Calls 1

ExecMethod · 0.65

Tested by

no test coverage detected