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
493 stars 134 forks source link

VaultSharp.V1.SecretsEngines.Database: The JSON value could not be converted to System.String. Path: $.data.default_ttl #315

Closed DamienDennehy closed 2 months ago

DamienDennehy commented 1 year ago

Describe the bug When calling "await vaultClient.V1.Secrets.Database.ReadRoleAsync("role_name");", a JsonException is thrown.

VaultSharp Version 1.13.0.1

Vault Version 1.13.2

Does this work with Vault CLI? Yes

Sample Code Snippet var databaseRole = await vaultClient.V1.Secrets.Database.ReadRoleAsync("role_name");

Exception Details/Stack Trace/Error Message "System.Text.Json.JsonException: 'The JSON value could not be converted to System.String. Path: $.data.default_ttl | LineNumber: 0 | BytePositionInLine: 373.'"

Any additional info This seems very similar to https://github.com/rajanadar/VaultSharp/issues/312

rajanadar commented 1 year ago

hi @DamienDennehy let me have a look this weekend

KyleZevenbergen commented 3 months ago

Yes it seems vault returns ints for default_ttl and max_ttl while your library is expecting a string.

https://developer.hashicorp.com/vault/api-docs/secret/databases#parameters-7