Conductor-csharp PutSecret adds extra quotes to secret values. Is this a bug?

I’m using conductor-csharp (SecretResourceApi.PutSecret / PutSecretWithHttpInfo) and secrets are stored with extra quotes (e.g., VERY SECRET becomes "VERY SECRET"), which makes them unusable for authentication.

In decompiled code, this line is used:

obj = ((body == null || !(body.GetType() != typeof(byte[]))) ? body : Configuration.ApiClient.Serialize(body));

For any non-null input, body is typed as string, so:
• body == null is false
• body.GetType() != typeof(byte[ ]) is true
• !(true) is false
• condition becomes false || false => false

So it always takes the Serialize(body) branch for string, which appears to force quote-wrapping.

Has anyone found a way to use this specific method without that behavior, or confirmed this as an SDK bug?

Hi there – i’ve confirmed this is a SDK bug in conductor-oss/csharp-sdk (issue #165 (SecretResourceApi.PutSecret serializes string body as JSON, storing secrets with extra quotes · Issue #165 · conductor-oss/csharp-sdk · GitHub)).

Workaround until fixed — call the endpoint directly, bypassing the SDK’s serialization:

var client = new HttpClient();
client.DefaultRequestHeaders.Add(“X-Authorization”, yourToken);
var content = new StringContent(“VERY SECRET”, Encoding.UTF8, “text/plain”);
await client.PutAsync(“https://your-conductor-server/api/secrets/MY_KEY”, content);

If you’re willing and able, please add any supporting info directly to the github issue so we can keep things together. Thanks!