rajanadar / VaultSharp

A comprehensive cross-platform .NET Library for HashiCorp's Vault, a secret management tool
http://rajanadar.github.io/VaultSharp
Apache License 2.0
488 stars 130 forks source link

JsonIgnore missing on SignKeyRequest properties #346

Closed lukeocamden closed 1 week ago

lukeocamden commented 6 months ago

Describe the bug Serialized SigninKeyRequest can be invalid due to missing [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]

VaultSharp Version 1.13.0.1

Vault Version 1.13.2+ent

Does this work with Vault CLI? Yes

Sample Code Snippet

var signedKey = await vaultClient.V1.Secrets.SSH.SignKeyAsync(principal,
    new SignKeyRequest
    {
        ValidPrincipals = principal,
        PublicKey = publicKey,
    }, "ssh/whatever");

Exception Details/Stack Trace/Error Message Permission denied from server.

Any additional info Hello! In 11af98d4a7647fd0b36daaa67d93bc244a70ecef you fixed lots of properties so null values would not be sent to Vault API (fixing #312). However I think SignKeyRequest.cs was missed from this change. Is it easy to fix?