Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
490 changes: 467 additions & 23 deletions dotnet/src/Generated/Rpc.cs

Large diffs are not rendered by default.

705 changes: 702 additions & 3 deletions dotnet/src/Generated/SessionEvents.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dotnet/test/E2E/PerSessionAuthE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task ShouldAuthenticateWithGitHubToken()
OnPermissionRequest = PermissionHandler.ApproveAll,
});

var status = await session.Rpc.Auth.GetStatusAsync();
var status = await session.Rpc.GitHubAuth.GetStatusAsync();
Assert.True(status.IsAuthenticated);
Assert.Equal("alice", status.Login);
}
Expand All @@ -103,11 +103,11 @@ public async Task ShouldIsolateAuthBetweenSessions()
OnPermissionRequest = PermissionHandler.ApproveAll,
});

var statusA = await sessionA.Rpc.Auth.GetStatusAsync();
var statusA = await sessionA.Rpc.GitHubAuth.GetStatusAsync();
Assert.True(statusA.IsAuthenticated);
Assert.Equal("alice", statusA.Login);

var statusB = await sessionB.Rpc.Auth.GetStatusAsync();
var statusB = await sessionB.Rpc.GitHubAuth.GetStatusAsync();
Assert.True(statusB.IsAuthenticated);
Assert.Equal("bob", statusB.Login);
}
Expand All @@ -122,7 +122,7 @@ public async Task ShouldBeUnauthenticatedWithoutToken()
OnPermissionRequest = PermissionHandler.ApproveAll,
});

var status = await session.Rpc.Auth.GetStatusAsync();
var status = await session.Rpc.GitHubAuth.GetStatusAsync();
// Without a per-session GitHub token, there is no per-session identity.
Assert.True(string.IsNullOrEmpty(status.Login), $"Expected no per-session login without token, got {status.Login}");
}
Expand Down
9 changes: 3 additions & 6 deletions dotnet/test/E2E/RpcServerPluginsE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class RpcServerPluginsE2ETests(E2ETestFixture fixture, ITestOutputHelper
private const string DirectPluginName = "csharp-e2e-direct";

[Fact]
public async Task Should_Install_List_And_Uninstall_Plugin_From_Local_Marketplace()
public async Task Should_Install_And_List_Plugin_From_Local_Marketplace()
{
var marketplaceDir = CreateLocalMarketplaceFixture();
var (client, home) = await CreateIsolatedClientAsync();
Expand All @@ -53,10 +53,6 @@ public async Task Should_Install_List_And_Uninstall_Plugin_From_Local_Marketplac
p => p.Name == PluginName && p.Marketplace == MarketplaceName);
Assert.True(listed.Enabled);

await client.Rpc.Plugins.UninstallAsync(spec);

var afterUninstall = await client.Rpc.Plugins.ListAsync();
Assert.DoesNotContain(afterUninstall.Plugins, p => p.Name == PluginName && p.Marketplace == MarketplaceName);
}
finally
{
Expand Down Expand Up @@ -157,8 +153,9 @@ public async Task Should_Install_Direct_Local_Plugin_With_Deprecation_Warning()

var afterInstall = await client.Rpc.Plugins.ListAsync();
Assert.Single(afterInstall.Plugins, p => p.Name == DirectPluginName);
Assert.False(string.IsNullOrEmpty(install.Plugin.DirectSourceId));

await client.Rpc.Plugins.UninstallAsync(DirectPluginName);
await client.Rpc.Plugins.UninstallAsync(DirectPluginName, install.Plugin.DirectSourceId);

var afterUninstall = await client.Rpc.Plugins.ListAsync();
Assert.DoesNotContain(afterUninstall.Plugins, p => p.Name == DirectPluginName);
Expand Down
4 changes: 2 additions & 2 deletions dotnet/test/E2E/RpcSessionStateE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public async Task Should_Set_Auth_Credentials()
});
var login = $"sdk-rpc-{Guid.NewGuid():N}";

var setCredentials = await session.Rpc.Auth.SetCredentialsAsync(new AuthInfoUser
var setCredentials = await session.Rpc.GitHubAuth.SetCredentialsAsync(new AuthInfoUser
{
CopilotUser = new CopilotUserResponse
{
Expand All @@ -468,7 +468,7 @@ public async Task Should_Set_Auth_Credentials()
});
Assert.True(setCredentials.Success);

var status = await session.Rpc.Auth.GetStatusAsync();
var status = await session.Rpc.GitHubAuth.GetStatusAsync();
Assert.True(status.IsAuthenticated);
Assert.Equal(AuthInfoType.User, status.AuthType);
Assert.Equal("https://github.com", status.Host);
Expand Down
1 change: 1 addition & 0 deletions dotnet/test/Unit/SessionEventSerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ public class SessionEventSerializationTests
Data = new McpOauthRequiredData
{
RequestId = "oauth-request",
Reason = McpOauthRequestReason.Initial,
ServerName = "oauth-server",
ServerUrl = "https://example.com/mcp",
StaticClientConfig = new McpOauthRequiredStaticClientConfig
Expand Down
8 changes: 4 additions & 4 deletions go/internal/e2e/per_session_auth_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestPerSessionAuthE2E(t *testing.T) {
t.Fatalf("Failed to create session: %v", err)
}

authStatus, err := session.RPC.Auth.GetStatus(t.Context())
authStatus, err := session.RPC.GitHubAuth.GetStatus(t.Context())
if err != nil {
t.Fatalf("Failed to get auth status: %v", err)
}
Expand Down Expand Up @@ -79,12 +79,12 @@ func TestPerSessionAuthE2E(t *testing.T) {
t.Fatalf("Failed to create session B: %v", err)
}

statusA, err := sessionA.RPC.Auth.GetStatus(t.Context())
statusA, err := sessionA.RPC.GitHubAuth.GetStatus(t.Context())
if err != nil {
t.Fatalf("Failed to get auth status for session A: %v", err)
}

statusB, err := sessionB.RPC.Auth.GetStatus(t.Context())
statusB, err := sessionB.RPC.GitHubAuth.GetStatus(t.Context())
if err != nil {
t.Fatalf("Failed to get auth status for session B: %v", err)
}
Expand Down Expand Up @@ -115,7 +115,7 @@ func TestPerSessionAuthE2E(t *testing.T) {
t.Fatalf("Failed to create session: %v", err)
}

authStatus, err := session.RPC.Auth.GetStatus(t.Context())
authStatus, err := session.RPC.GitHubAuth.GetStatus(t.Context())
if err != nil {
t.Fatalf("Failed to get auth status: %v", err)
}
Expand Down
21 changes: 8 additions & 13 deletions go/internal/e2e/rpc_server_plugins_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
func TestRpcServerPlugins(t *testing.T) {
ctx := testharness.NewTestContext(t)

t.Run("should_install_list_and_uninstall_plugin_from_local_marketplace", func(t *testing.T) {
t.Run("should_install_and_list_plugin_from_local_marketplace", func(t *testing.T) {
ctx.ConfigureForTest(t)
marketplaceDir := createPortedLocalMarketplaceFixture(t)
client := newStartedIsolatedPortedClient(t, ctx)
Expand Down Expand Up @@ -63,17 +63,6 @@ func TestRpcServerPlugins(t *testing.T) {
t.Fatal("Expected listed marketplace plugin to be enabled")
}

if _, err := client.RPC.Plugins.Uninstall(t.Context(), &rpc.PluginsUninstallRequest{Name: spec}); err != nil {
t.Fatalf("Plugins.Uninstall failed: %v", err)
}

afterUninstall, err := client.RPC.Plugins.List(t.Context())
if err != nil {
t.Fatalf("Plugins.List after uninstall failed: %v", err)
}
if findPortedInstalledPlugin(afterUninstall.Plugins, portedPluginName, portedMarketplaceName) != nil {
t.Fatalf("Expected plugin %q to be removed", spec)
}
})

t.Run("should_enable_and_disable_marketplace_plugin", func(t *testing.T) {
Expand Down Expand Up @@ -200,8 +189,14 @@ func TestRpcServerPlugins(t *testing.T) {
if countPortedInstalledPluginByName(afterInstall.Plugins, portedDirectPluginName) != 1 {
t.Fatalf("Expected exactly one direct plugin named %q, got %+v", portedDirectPluginName, afterInstall.Plugins)
}
if install.Plugin.DirectSourceID == nil {
t.Fatal("Expected direct plugin install to include directSourceId")
}

if _, err := client.RPC.Plugins.Uninstall(t.Context(), &rpc.PluginsUninstallRequest{Name: portedDirectPluginName}); err != nil {
if _, err := client.RPC.Plugins.Uninstall(t.Context(), &rpc.PluginsUninstallRequest{
DirectSourceID: install.Plugin.DirectSourceID,
Name: portedDirectPluginName,
}); err != nil {
t.Fatalf("Plugins.Uninstall direct failed: %v", err)
}
afterUninstall, err := client.RPC.Plugins.List(t.Context())
Expand Down
4 changes: 2 additions & 2 deletions go/internal/e2e/rpc_session_state_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ func TestRPCSessionStateE2E(t *testing.T) {

api := ctx.ProxyURL
telemetry := "https://localhost:1/telemetry"
setCredentials, err := session.RPC.Auth.SetCredentials(t.Context(), &rpc.SessionSetCredentialsParams{
setCredentials, err := session.RPC.GitHubAuth.SetCredentials(t.Context(), &rpc.SessionSetCredentialsParams{
Credentials: &rpc.UserAuthInfo{
CopilotUser: &rpc.CopilotUserResponse{
AnalyticsTrackingID: rpcPtr("rpc-session-state-tracking-id"),
Expand All @@ -727,7 +727,7 @@ func TestRPCSessionStateE2E(t *testing.T) {
t.Fatalf("Expected Auth.SetCredentials Success=true, got %+v", setCredentials)
}

status, err := session.RPC.Auth.GetStatus(t.Context())
status, err := session.RPC.GitHubAuth.GetStatus(t.Context())
if err != nil {
t.Fatalf("Auth.GetStatus failed: %v", err)
}
Expand Down
Loading
Loading