GCScript.Configuration.Infisical
1.0.0
dotnet add package GCScript.Configuration.Infisical --version 1.0.0
NuGet\Install-Package GCScript.Configuration.Infisical -Version 1.0.0
<PackageReference Include="GCScript.Configuration.Infisical" Version="1.0.0" />
<PackageVersion Include="GCScript.Configuration.Infisical" Version="1.0.0" />
<PackageReference Include="GCScript.Configuration.Infisical" />
paket add GCScript.Configuration.Infisical --version 1.0.0
#r "nuget: GCScript.Configuration.Infisical, 1.0.0"
#:package GCScript.Configuration.Infisical@1.0.0
#addin nuget:?package=GCScript.Configuration.Infisical&version=1.0.0
#tool nuget:?package=GCScript.Configuration.Infisical&version=1.0.0
GCScript.Configuration.Infisical
Loads secrets from Infisical into Microsoft.Extensions.Configuration, on top of the
official Infisical.Sdk. Secrets are read once, when the
configuration is built, and are never exported to the process environment.
Install
dotnet add package GCScript.Configuration.Infisical
Usage
HostApplicationBuilder builder = Host.CreateApplicationBuilder();
builder.Configuration.AddInfisical();
builder.Services.AddOptions<AcmeApiOptions>()
.Bind(builder.Configuration)
.ValidateDataAnnotations()
.ValidateOnStart();
// appsettings.json — not secrets
{
"Infisical": {
"SiteUrl": "https://infisical.example.com",
"ProjectId": "00000000-0000-0000-0000-000000000000",
"Environment": "prod"
}
}
The credentials of a machine identity (Universal Auth) come from Infisical's standard environment variables, shared with the CLI and the official SDKs:
[Environment]::SetEnvironmentVariable('INFISICAL_UNIVERSAL_AUTH_CLIENT_ID', '<client id>', 'User')
[Environment]::SetEnvironmentVariable('INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET', '<client secret>', 'User')
Secrets land at the configuration root with their Infisical name. Map them onto options classes with
[ConfigurationKeyName]:
public sealed class AcmeApiOptions {
[Required, Url, ConfigurationKeyName("ACME_API_URL")] public string BaseUrl { get; init; } = "";
[Required, ConfigurationKeyName("ACME_API_TOKEN")] public string Token { get; init; } = "";
}
Multiple projects
Call AddInfisical once per project, each with its own section. Settings in Infisical apply to every
project and the named section overrides them:
builder.Configuration
.AddInfisical("Infisical:Shared")
.AddInfisical("Infisical:App");
{
"Infisical": {
"SiteUrl": "https://infisical.example.com",
"Shared": { "ProjectId": "11111111-1111-1111-1111-111111111111" },
"App": { "ProjectId": "22222222-2222-2222-2222-222222222222" }
}
}
When two projects define the same key, the one added last wins. The machine identity needs access to every project it reads.
Settings
| Setting | Default | Source |
|---|---|---|
SiteUrl |
https://app.infisical.com |
Infisical:SiteUrl |
ProjectId |
— | Infisical:ProjectId |
Environment |
prod |
Infisical:Environment |
SecretPath |
/ |
Infisical:SecretPath |
Recursive |
true |
Infisical:Recursive |
ClientId |
— | INFISICAL_UNIVERSAL_AUTH_CLIENT_ID |
ClientSecret |
— | INFISICAL_UNIVERSAL_AUTH_CLIENT_SECRET |
Timeout |
00:00:30 |
Infisical:Timeout |
Anything can be set in code instead, with or without appsettings.json:
builder.Configuration.AddInfisical(o => {
o.SiteUrl = "https://infisical.example.com";
o.ProjectId = "00000000-0000-0000-0000-000000000000";
o.Environment = "dev";
});
With Recursive, secret keys must be unique across folders (e.g. ACME_API_TOKEN, not API_TOKEN).
Errors
Incomplete settings, rejected credentials and unreachable servers all throw InfisicalConfigurationException
while the configuration is built. The message names what failed and never includes secret values: if the
underlying SDK error echoes the Client ID or Client Secret, they are masked as *** and the original exception
is not attached, so ToString() and loggers cannot leak them either.
License
MIT
| Product | Versions 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 was computed. 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 was computed. 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. |
-
net8.0
- Infisical.Sdk (>= 3.0.4)
- Microsoft.Extensions.Configuration (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
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 |
|---|---|---|
| 1.0.0 | 43 | 9/17/2026 |