Pandatech.PandaVaultClient 6.0.0

dotnet add package Pandatech.PandaVaultClient --version 6.0.0
                    
NuGet\Install-Package Pandatech.PandaVaultClient -Version 6.0.0
                    
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="Pandatech.PandaVaultClient" Version="6.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pandatech.PandaVaultClient" Version="6.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Pandatech.PandaVaultClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pandatech.PandaVaultClient --version 6.0.0
                    
#r "nuget: Pandatech.PandaVaultClient, 6.0.0"
                    
#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.
#:package Pandatech.PandaVaultClient@6.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pandatech.PandaVaultClient&version=6.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Pandatech.PandaVaultClient&version=6.0.0
                    
Install as a Cake Tool

Pandatech.PandaVaultClient

Secure configuration retrieval client for PandaVault service integration in .NET 8+ applications with automatic configuration injection and validation.

Installation

dotnet add package Pandatech.PandaVaultClient

Quick Start

1. Set Environment Variables

export PANDAVAULT_URL="https://vault.yourcompany.com"
export PANDAVAULT_SECRET="your-vault-secret"

Or in appsettings.json (not recommended for secrets):

{
  "PANDAVAULT_URL": "https://vault.yourcompany.com",
  "PANDAVAULT_SECRET": "your-vault-secret"
}

2. Register in Program.cs

using PandaVaultClient.Extensions;

var builder = WebApplication.CreateBuilder(args);

// Fetch and apply PandaVault configurations
builder.AddPandaVault();

var app = builder.Build();
app.Run();

3. Use Configurations

Direct access:

var rabbitMqHost = builder.Configuration["RabbitMQSettings:HostName"];

Strongly-typed options:

public class RabbitMQSettings
{
    public required string HostName { get; set; }
    public required string ExchangeName { get; set; }
}

// Register
builder.Services.Configure<RabbitMQSettings>(
    builder.Configuration.GetSection("RabbitMQSettings"));

// Inject
public class MyService
{
    private readonly RabbitMQSettings _settings;
    
    public MyService(IOptions<RabbitMQSettings> options)
    {
        _settings = options.Value;
    }
}

Features

Automatic configuration retrieval - Fetches configs from PandaVault on startup
Environment variable authentication - Secure secret management
Configuration validation - Ensures required configs are set
IConfiguration integration - Works with Microsoft.Extensions.Configuration
Startup failure on missing configs - Prevents runtime errors

Required Configuration Validation

Mark configurations as required by setting their value to "**" in your local appsettings.json:

{
  "DatabaseConnection": "**",
  "RabbitMQSettings:HostName": "**"
}

If PandaVault doesn't provide these configurations, the application will not start and throws:

InvalidOperationException: Configuration key 'DatabaseConnection' is not configured in the PandaVault.

How It Works

  1. Reads environment variables (PANDAVAULT_URL, PANDAVAULT_SECRET)
  2. Validates URL and secret
  3. Fetches configurations via HTTP GET to /api/v1/vault-configs
  4. Merges into IConfiguration - PandaVault configs override appsettings.json
  5. Validates required configs - Ensures no "**" placeholders remain

API Endpoint

PandaVault must expose:

GET /api/v1/vault-configs
Headers:
  secret: {PANDAVAULT_SECRET}

Response:
[
  { "key": "DatabaseConnection", "value": "Server=..." },
  { "key": "RabbitMQSettings:HostName", "value": "rabbitmq.local" }
]

Error Handling

Missing environment variables:

ArgumentNullException: PANDAVAULT_URL environment variable is not set

Invalid URL:

ArgumentNullException: PANDAVAULT_URL is not valid. Url: {url}

HTTP errors:

HttpRequestException: Failed to fetch configurations. Status Code: 401

Wrong secret:

Console: The secret is wrong or there is no configurations set
Returns: Empty list (application continues with local config)

Security Considerations

⚠️ Do not hardcode secrets - Always use environment variables
⚠️ Use HTTPS - PandaVault URL should use https:// (http:// is allowed but not recommended)
⚠️ Rotate secrets regularly - Update PANDAVAULT_SECRET periodically
⚠️ Validate configurations - Use the "**" pattern for critical configs

Advanced Usage

Manual Configuration Fetch

var configs = await PandaVaultHttpClient.FetchConfigurationsAsync();

foreach (var config in configs)
{
    Console.WriteLine($"{config.Key} = {config.Value}");
}

Custom Configuration Processing

var builder = WebApplication.CreateBuilder(args);

// Fetch configs manually
var vaultConfigs = await PandaVaultHttpClient.FetchConfigurationsAsync();

// Apply with custom logic
foreach (var config in vaultConfigs)
{
    if (config.Key.StartsWith("Secrets:"))
    {
        // Handle secrets differently
        builder.Configuration[config.Key] = DecryptValue(config.Value);
    }
    else
    {
        builder.Configuration[config.Key] = config.Value;
    }
}

Troubleshooting

Issue: Application starts but configurations are not applied
Solution: Ensure AddPandaVault() is called before accessing configurations

Issue: The secret is wrong or there is no configurations set
Solution: Verify PANDAVAULT_SECRET matches the vault's expected secret

Issue: Configuration key 'X' is not configured in the PandaVault
Solution: Either add the config to PandaVault or remove the "**" placeholder

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Pandatech.PandaVaultClient:

Package Downloads
Pandatech.SharedKernel

Opinionated ASP.NET Core 10 infrastructure kernel: OpenAPI (Swagger + Scalar), Serilog, MediatR, FluentValidation, CORS, SignalR, OpenTelemetry, health checks, maintenance mode, resilience pipelines, and shared utilities.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.0 119 2/28/2026
5.0.1 144 1/26/2026
5.0.0 121 12/28/2025
4.0.6 387 8/7/2025
4.0.5 310 6/1/2025
4.0.4 294 2/17/2025
4.0.3 271 11/26/2024
4.0.2 194 11/26/2024
4.0.1 214 11/26/2024
4.0.0 270 11/21/2024
3.1.0 363 3/18/2024
3.0.6 236 3/17/2024
3.0.5 587 12/18/2023
3.0.4 262 12/14/2023
3.0.3 259 11/29/2023
3.0.2 247 11/29/2023
3.0.1 246 11/28/2023
2.1.1 221 11/26/2023
2.1.0 223 11/26/2023
2.0.0 259 11/25/2023
Loading failed

Multi-target net8.0/9.0/10.0, framework-first dependencies, improved documentation