You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var azureCredentials = await vaultClient.V1.Secrets.Azure.GetCredentialsAsync(roleName);
var clientId = azureCredentials.Data.ClientId;
var clientSecret = azureCredentials.Data.ClientSecret;
This really helps a new user (like me) "see" the api documentation much more quickly, then having to actually write example code to see what the real return is.
Like here in the below, I clearly see that TokenAuthMethodInfo is an implementation of IAuthMethodInfo.
And the var word that points to "new VaultClientSettings" isn't hard to discern.
// Initialize one of the several auth methods.
IAuthMethodInfo authMethod = new TokenAuthMethodInfo("MY_VAULT_TOKEN");
// Initialize settings. You can also set proxies, custom delegates etc. here.
var vaultClientSettings = new VaultClientSettings("https://MY_VAULT_SERVER:8200", authMethod);
IVaultClient vaultClient = new VaultClient(vaultClientSettings);
My team's "rule" for the use of var is
"When its clearly a 'new Something', then ok". But when its a result of a method call that isn't easily seen, use the real object type." We do this for code reviews. I'm just looking at code, not necessarily running it, so var in code reviews make it harder to see what is happening, IMHO.
I'm not trying to change your personal preference. However, with documentation and examples, the use of "var" makes learning the API slower, IMHO.
It's a small thing in regards to the overall great library. But would be helpful, IMHO.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered:
Hi.
This is great library, and is really helping my team implement Hashicorp Vault
My one comment is that using the "var" shortcut word for variables in the documentation makes reading the documentation harder to pickup easily.
https://github.com/rajanadar/VaultSharp
Example:
MUCH MORE PREFERRED FOR DOCUMENTATION
This really helps a new user (like me) "see" the api documentation much more quickly, then having to actually write example code to see what the real return is.
Like here in the below, I clearly see that TokenAuthMethodInfo is an implementation of IAuthMethodInfo.
And the var word that points to "new VaultClientSettings" isn't hard to discern.
My team's "rule" for the use of var is
"When its clearly a 'new Something', then ok". But when its a result of a method call that isn't easily seen, use the real object type." We do this for code reviews. I'm just looking at code, not necessarily running it, so var in code reviews make it harder to see what is happening, IMHO.
I'm not trying to change your personal preference. However, with documentation and examples, the use of "var" makes learning the API slower, IMHO.
It's a small thing in regards to the overall great library. But would be helpful, IMHO.
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: