we are using Hashi vault enterprise. I have a couple of questions as I am struggling to understand what variables go where and how to format them. Here is my vault settings. Assume v1. we are currently using v1 kv vault Version 1. First we use token auth.
url = https://something.opt.com (standard port 443)
namespace is "our_groupname" and we have a sub namespace that is one of 3 dev, stage, prod
we have a number of secret engines under each namespace. For this example I am using test_access and the actual secrets are under dev_jay.
I know this works as I have it working in python. Just getting the feel of it in c# (my first choice).
the code below. first would the url be just the " https://something.opt.com:443" or "https://something.opt.com:443/our_groupname/dev/ and does the url need to be encoded?
for the vaultClient.V1.Secrets.KeyValue.V1.ReadSecretPathsAsync(secPath,secMount) this is my struggle. is path = "/engine/secrets/" and mount = the /namespace/subnamespace or what?
` // Initialize the Vault client IAuthMethodInfo authMethod = new TokenAuthMethodInfo(config.HashiKey); var vaultClientSettings = new VaultClientSettings(config.hashiURL, authMethod); IVaultClient vaultClient = new VaultClient(vaultClientSettings);
// Read the secrets list
List<string> secretsList = new List<string>();
try
{
Secret<ListInfo> secretListInfo = await vaultClient.V1.Secrets.KeyValue.V1.ReadSecretPathsAsync(secPath,secMount);
secretsList.AddRange(secretListInfo.Data.Keys);
}
catch (Exception ex)
{
Console.WriteLine($"Error reading secrets list: {ex.Message}");
}
return secretsList;
}
`
what I run the code above the error I get is Newtonsoft.Json.JsonReaderException: 'Unexpected character encountered while parsing value: <. Path '', line 0, position 0.'