(t *testing.T)
| 518 | } |
| 519 | |
| 520 | func TestMCPServerConfigsOAuth2Disconnect(t *testing.T) { |
| 521 | t.Parallel() |
| 522 | |
| 523 | ctx := testutil.Context(t, testutil.WaitLong) |
| 524 | adminClient := newMCPClient(t) |
| 525 | firstUser := coderdtest.CreateFirstUser(t, adminClient) |
| 526 | memberClient, _ := coderdtest.CreateAnotherUser(t, adminClient, firstUser.OrganizationID) |
| 527 | |
| 528 | created, err := adminClient.CreateMCPServerConfig(ctx, codersdk.CreateMCPServerConfigRequest{ |
| 529 | DisplayName: "OAuth Disconnect Test", |
| 530 | Slug: "oauth-disconnect", |
| 531 | Transport: "streamable_http", |
| 532 | URL: "https://mcp.example.com/oauth-disc", |
| 533 | AuthType: "oauth2", |
| 534 | OAuth2ClientID: "cid", |
| 535 | OAuth2AuthURL: "https://auth.example.com/authorize", |
| 536 | OAuth2TokenURL: "https://auth.example.com/token", |
| 537 | Availability: "default_on", |
| 538 | Enabled: true, |
| 539 | ToolAllowList: []string{}, |
| 540 | ToolDenyList: []string{}, |
| 541 | }) |
| 542 | require.NoError(t, err) |
| 543 | |
| 544 | // Disconnect should succeed even when no token exists (idempotent). |
| 545 | err = memberClient.MCPServerOAuth2Disconnect(ctx, created.ID) |
| 546 | require.NoError(t, err) |
| 547 | } |
| 548 | |
| 549 | func TestMCPServerConfigsOAuth2AutoDiscovery(t *testing.T) { |
| 550 | t.Parallel() |
nothing calls this directly
no test coverage detected