From fa4913b2b699e18ad08feb8cb43c9d768ab65604 Mon Sep 17 00:00:00 2001 From: Yvonne Yu Date: Thu, 21 Aug 2025 21:25:24 -0700 Subject: [PATCH] feat(dotnet): enable redact --- sdks/dotnet/TestServerSdk.cs | 6 ++++++ sdks/dotnet/TestServerSdk.csproj | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sdks/dotnet/TestServerSdk.cs b/sdks/dotnet/TestServerSdk.cs index 8d0f29b..4a4fe35 100644 --- a/sdks/dotnet/TestServerSdk.cs +++ b/sdks/dotnet/TestServerSdk.cs @@ -32,6 +32,8 @@ public class TestServerOptions public required string Mode { get; set; } // "record" or "replay" public required string BinaryPath { get; set; } + public string TestServerSecrets { get; set; } + public Action? OnStdOut { get; set; } public Action? OnStdErr { get; set; } public Action? OnExit { get; set; } @@ -84,6 +86,10 @@ public async Task StartAsync() UseShellExecute = false, CreateNoWindow = true }; + if (_options.TestServerSecrets != null) + { + psi.Environment["TEST_SERVER_SECRETS"] = _options.TestServerSecrets; + } _process = new Process { StartInfo = psi, EnableRaisingEvents = true }; _process.OutputDataReceived += (s, e) => { if (e.Data != null) _options.OnStdOut?.Invoke(e.Data); }; _process.ErrorDataReceived += (s, e) => { if (e.Data != null) _options.OnStdErr?.Invoke(e.Data); }; diff --git a/sdks/dotnet/TestServerSdk.csproj b/sdks/dotnet/TestServerSdk.csproj index 84e5c46..300e6e7 100644 --- a/sdks/dotnet/TestServerSdk.csproj +++ b/sdks/dotnet/TestServerSdk.csproj @@ -5,7 +5,7 @@ enable enable - 0.1.2 + 0.1.3 Google LLC A .NET SDK to manage the test-server process for integration testing. https://github.com/google/test-server