MCPcopy Index your code
hub / github.com/coder/coder / TestMCPServerConfigsUserOIDCDirect

Function TestMCPServerConfigsUserOIDCDirect

coderd/mcp_test.go:406–431  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

404}
405
406func TestMCPServerConfigsUserOIDCDirect(t *testing.T) {
407 t.Parallel()
408
409 // Create with user_oidc and confirm validation accepts the value
410 // while no auth-specific fields are persisted on the row.
411 ctx := testutil.Context(t, testutil.WaitLong)
412 client := newMCPClient(t)
413 _ = coderdtest.CreateFirstUser(t, client)
414
415 created, err := client.CreateMCPServerConfig(ctx, codersdk.CreateMCPServerConfigRequest{
416 DisplayName: "User OIDC Direct",
417 Slug: "user-oidc-direct",
418 Transport: "streamable_http",
419 URL: "https://mcp.example.com/oidc-direct",
420 AuthType: "user_oidc",
421 Availability: "default_off",
422 Enabled: true,
423 ToolAllowList: []string{},
424 ToolDenyList: []string{},
425 })
426 require.NoError(t, err)
427 require.Equal(t, "user_oidc", created.AuthType)
428 require.False(t, created.HasOAuth2Secret)
429 require.False(t, created.HasAPIKey)
430 require.False(t, created.HasCustomHeaders)
431}
432
433func TestMCPServerConfigsAvailability(t *testing.T) {
434 t.Parallel()

Callers

nothing calls this directly

Calls 5

ContextFunction · 0.92
CreateFirstUserFunction · 0.92
newMCPClientFunction · 0.85
CreateMCPServerConfigMethod · 0.80
EqualMethod · 0.45

Tested by

no test coverage detected