CSharpEssentials.GcpSecretManager
3.0.2
See the version list below for details.
dotnet add package CSharpEssentials.GcpSecretManager --version 3.0.2
NuGet\Install-Package CSharpEssentials.GcpSecretManager -Version 3.0.2
<PackageReference Include="CSharpEssentials.GcpSecretManager" Version="3.0.2" />
<PackageVersion Include="CSharpEssentials.GcpSecretManager" Version="3.0.2" />
<PackageReference Include="CSharpEssentials.GcpSecretManager" />
paket add CSharpEssentials.GcpSecretManager --version 3.0.2
#r "nuget: CSharpEssentials.GcpSecretManager, 3.0.2"
#:package CSharpEssentials.GcpSecretManager@3.0.2
#addin nuget:?package=CSharpEssentials.GcpSecretManager&version=3.0.2
#tool nuget:?package=CSharpEssentials.GcpSecretManager&version=3.0.2
CSharpEssentials.GcpSecretManager
CSharpEssentials.GcpSecretManager integrates Google Cloud Secret Manager into the .NET Configuration system. It allows you to load secrets directly into IConfiguration, making them accessible via standard dependency injection options patterns.
🚀 Features
- Configuration Integration: Secrets appear as standard configuration values (e.g.,
ConnectionStrings:Default). - Multi-Project Support: Load secrets from multiple Google Cloud projects.
- Flexible Configuration: Configure via
appsettings.jsonor fluent API code. - Batch Processing: Efficient secret retrieval with configurable batch sizes.
- Credentials Handling: Supports standard Google Application Credentials or explicit file paths.
📦 Installation
dotnet add package CSharpEssentials.GcpSecretManager
🛠 Usage
1. Setup via Code
Add Secret Manager in your Program.cs (or Startup.cs).
using CSharpEssentials.GcpSecretManager;
var builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddGcpSecretManager(options =>
{
options.CredentialsPath = "path/to/key.json"; // Optional, uses default if null
options.AddProject(new ProjectSecretConfiguration
{
ProjectId = "my-gcp-project-id",
Prefix = "MyApp" // Optional: Filter secrets starting with this
});
});
// Now access secrets as config
string dbConn = builder.Configuration["MyApp_ConnectionStrings_Db"];
2. Setup via AppSettings
You can define the configuration in appsettings.json and let the library load it automatically.
appsettings.json:
{
"GoogleSecretManager": {
"Projects": [
{
"ProjectId": "my-production-project",
"Prefix": "Prod",
"Exclude": ["Internal_"]
}
]
}
}
Program.cs:
// Automatically loads from "GoogleSecretManager" section
builder.Configuration.AddGcpSecretManager();
3. Key Mapping
Secrets in GCP are typically named with underscores or dashes. This library maps them to .NET configuration keys.
- GCP Secret:
MyApp__ConnectionStrings__Default - .NET Config:
MyApp:ConnectionStrings:Default
(Note: Double underscores __ are standard separators in .NET configuration providers).
4. Performance Tuning
Adjust batch sizes for large numbers of secrets.
options.BatchSize = 20;
options.PageSize = 500;
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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. 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. net11.0 is compatible. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- CSharpEssentials.Core (>= 3.0.2)
- Google.Cloud.SecretManager.V1 (>= 2.6.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Polly (>= 8.0.0)
- System.Text.Json (>= 9.0.0)
-
net10.0
- CSharpEssentials.Core (>= 3.0.2)
- Google.Cloud.SecretManager.V1 (>= 2.6.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Polly (>= 8.0.0)
-
net11.0
- CSharpEssentials.Core (>= 3.0.2)
- Google.Cloud.SecretManager.V1 (>= 2.6.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Polly (>= 8.0.0)
-
net9.0
- CSharpEssentials.Core (>= 3.0.2)
- Google.Cloud.SecretManager.V1 (>= 2.6.0)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.0)
- Polly (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.5 | 90 | 5/7/2026 |
| 3.0.4 | 91 | 5/6/2026 |
| 3.0.3 | 91 | 5/5/2026 |
| 3.0.2 | 100 | 5/5/2026 |
| 3.0.1 | 92 | 5/3/2026 |
| 3.0.0 | 91 | 5/3/2026 |
| 2.1.0 | 1,406 | 11/26/2025 |
| 2.0.9 | 230 | 9/30/2025 |
| 2.0.8 | 227 | 9/29/2025 |
| 2.0.7 | 206 | 9/29/2025 |
| 2.0.6 | 212 | 9/29/2025 |
| 2.0.5 | 223 | 9/29/2025 |
| 2.0.4 | 210 | 9/28/2025 |
| 2.0.3 | 210 | 9/28/2025 |
| 2.0.2 | 197 | 9/28/2025 |
| 2.0.1 | 211 | 9/28/2025 |
| 2.0.0 | 213 | 9/28/2025 |
| 1.0.5 | 281 | 1/30/2025 |
| 1.0.4 | 182 | 1/29/2025 |