https://github.com/pandatecham/be-lib-pandavault-client
This nugget is for internal use for PandaVault project.
https://github.com/pandatecham/be-lib-pandavault-client
Last synced: 7 months ago
JSON representation
This nugget is for internal use for PandaVault project.
- Host: GitHub
- URL: https://github.com/pandatecham/be-lib-pandavault-client
- Owner: PandaTechAM
- License: mit
- Created: 2023-11-15T12:05:15.000Z (about 2 years ago)
- Default Branch: development
- Last Pushed: 2025-02-17T12:26:56.000Z (11 months ago)
- Last Synced: 2025-03-18T19:30:33.219Z (10 months ago)
- Language: C#
- Size: 204 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PandaVaultClient
PandaVaultClient is an internal NuGet package designed to retrieve and apply configurations from an PandaVault service,
to your .NET projects. This package offers a seamless way to integrate and manage configurations securely within your
applications.
## Features
- **Configuration Retrieval**: Fetches configuration data from an internal service using HTTP requests with secret
authentication.
- **Configuration Application**: Applies the fetched configuration data to your .NET projects using
Microsoft's `Microsoft.Extensions.Configuration`.
- **Configuration Validation**: Validates that there are no required configurations that have been left blank. If there
are, the application will not start. To require some configuration to be required, add `"**"` as the value for the
key.
## Installation
PandaVaultClient can be installed via NuGet Package Manager or by adding the following package reference to your
project:
```bash
dotnet add package Pandatech.PandaVaultClient
```
## Usage
### Basic Configuration Retrieval
To use PandaVaultClient within your project, first, ensure you have the necessary environment variables set for the
configuration service URL and secret:
```csharp
// Set environment variables
Environment.SetEnvironmentVariable("PANDAVAULT_URL", "Your_PandaVault_URL");
Environment.SetEnvironmentVariable("PANDAVAULT_SECRET", "Your_PandaVault_Secret");
```
After setting the environment variables, register the PandaVaultClient service within your project's `Program.cs` file:
### Program.cs
```csharp
using PandaVaultClient;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddPandaVault(); // Adding PandaVaultConfigurationSource
var app = builder.Build();
app.Run();
```
## License
Pandatech.PandaVaultClient is licensed under the MIT License.