JF91.VaultSharp
0.0.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package JF91.VaultSharp --version 0.0.2
NuGet\Install-Package JF91.VaultSharp -Version 0.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JF91.VaultSharp" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JF91.VaultSharp --version 0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JF91.VaultSharp, 0.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JF91.VaultSharp as a Cake Addin #addin nuget:?package=JF91.VaultSharp&version=0.0.2 // Install JF91.VaultSharp as a Cake Tool #tool nuget:?package=JF91.VaultSharp&version=0.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JF91.VaultSharp
WIP Minimalist Vault Client.
1: Install Nuget Package
dotnet add package JF91.VaultSharp
<br>
Available authentication methods:
- Token
- App Role
Available features:
- Get all secrets from path
- Get secret name value
- Get secret name value and update appsettings.json (Currently limited to one nested property)
<br>
How to use:
Add this to your appsettings.json:
"VaultSettings": {
"AuthenticationMethod": "approle",
"Host": "http://localhost:8200",
"RoleId": "",
"SecretId": "",
"Token": ""
}
Possible values:
- AuthenticationMethod: approle, token
<br>
All methods are extensions methods from IConfiguration, which you can inject anywhere in your application and call them like this:
private readonly IConfiguration _configuration;
public MyController
(
IConfiguration configuration
)
{
_configuration = configuration;
}
[HttpGet(Name = "MyEndpoint")]
public ActionResult HelloWorld()
{
var secrets = _configuration.GetVaultSecrets
(
"kv",
"secretPath"
);
var secretValue = _configuration.GetVaultSecret
(
"kv",
"secretPath",
"secretName"
);
_configuration.InjectSecretToConfiguration
(
"kv",
"secretPath",
"secretName",
"RootProperty:ChildProperty",
"Development" // Application Environment
);
return "Hello World!";
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net7.0
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
- Newtonsoft.Json (>= 13.0.3)
- VaultSharp (>= 1.13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
0.0.2:
# Added method to retrieve secret value from Vault and update appsettings.json
# Added Token authentication
0.0.1:
# AppRole Authentication
# Vault settings from appsettings.json
# Added method: Get Vault Secret