{"id":18494198,"url":"https://github.com/workleap/wl-extensions-configuration-substitution","last_synced_at":"2026-04-01T22:50:05.164Z","repository":{"id":38123856,"uuid":"479063401","full_name":"workleap/wl-extensions-configuration-substitution","owner":"workleap","description":"Variable substitution configuration provider implementation for Microsoft.Extensions.Configuration.","archived":false,"fork":false,"pushed_at":"2026-03-30T05:51:16.000Z","size":208,"stargazers_count":39,"open_issues_count":2,"forks_count":4,"subscribers_count":24,"default_branch":"main","last_synced_at":"2026-03-30T07:52:18.140Z","etag":null,"topics":["product--idp","vertical--infra"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/workleap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-07T16:24:29.000Z","updated_at":"2026-03-30T05:51:11.000Z","dependencies_parsed_at":"2026-01-11T07:02:05.978Z","dependency_job_id":null,"html_url":"https://github.com/workleap/wl-extensions-configuration-substitution","commit_stats":null,"previous_names":["gsoft-inc/gsoft-extensions-configuration-substitution","workleap/wl-extensions-configuration-substitution","gsoft-inc/wl-extensions-configuration-substitution"],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/workleap/wl-extensions-configuration-substitution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-extensions-configuration-substitution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-extensions-configuration-substitution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-extensions-configuration-substitution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-extensions-configuration-substitution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/workleap","download_url":"https://codeload.github.com/workleap/wl-extensions-configuration-substitution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/workleap%2Fwl-extensions-configuration-substitution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["product--idp","vertical--infra"],"created_at":"2024-11-06T13:18:21.191Z","updated_at":"2026-04-01T22:50:05.138Z","avatar_url":"https://github.com/workleap.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workleap.Extensions.Configuration.Substitution\n\nThis package adds variable substitution configuration provider implementation for [Microsoft.Extensions.Configuration](https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration).\n\n[![nuget](https://img.shields.io/nuget/v/Workleap.Extensions.Configuration.Substitution.svg?logo=nuget)](https://www.nuget.org/packages/Workleap.Extensions.Configuration.Substitution/)\n[![build](https://img.shields.io/github/actions/workflow/status/workleap/wl-extensions-configuration-substitution/publish.yml?logo=github)](https://github.com/workleap/wl-extensions-configuration-substitution/actions/workflows/publish.yml)\n\n## Getting started\n\n```\ndotnet add package Workleap.Extensions.Configuration.Substitution\n```\n\n```csharp\n// Example for an ASP.NET Core web application\nvar builder = WebApplication.CreateBuilder(args);\n\n// Setup your configuration\nbuilder.Configuration.AddJsonFile(\"appsettings.json\");\nbuilder.Configuration.AddEnvironmentVariables();\nbuilder.Configuration.AddSubstitution(); // \u003c-- Add this after other configuration providers\n```\n\n\n## How it works\n\nYou can reference configuration values inside other configuration values by enclosing the referenced configuration key like this: `${ReferencedConfigurationKey}`.\n\n\n### Examples\n\nConsider this `appsettings.json`:\n\n```json\n{\n  \"Credentials\": {\n    \"Username\": \"alice1\",\n    \"Password\": \"P@ssw0rd\"\n  },\n  \"ConnectionString\": \"usr=${Credentials:Username};pwd=${Credentials:Password}\"\n}\n```\n\nEvaluating the configuration value `ConnectionString` would return `usr=alice1;pwd=P@ssw0rd`.\n\n\n**This also works if you're using multiple configuration providers**. For instance, one could have the `Credentials:Password` configuration value provided by a secret from Azure Key Vault and this value would have been injected into the `ConnectionString` value too.\n\nIt also works with **arrays**:\n\n```json\n{\n  \"Credentials\": [ \"alice1\", \"P@ssw0rd\" ],\n  \"ConnectionString\": \"usr=${Credentials:0};pwd=${Credentials:1}\"\n}\n```\n\nAgain, you're not limited to JSON file providers, **you could use substitution with any configuration providers**. It was easier to use JSON files in these examples.\n\n\n### Escaping values\n\nYou might not want a specific value to be substituted. In that case, escape it using double curly braces:\n\n```json\n{\n  \"Foo\": \"foo\",\n  \"Bar\": \"${{Foo}}\"\n}\n```\n\nEvaluating the configuration value `Bar` would return `${Foo}`.\n\n\n### Exceptions\n\nYou can encounter two kinds of exceptions if your configuration is incorrect:\n\n* `UnresolvedConfigurationKeyException`, if you're trying to substitute a configuration value that is undefined (i.e. the key does not exist).\n* `RecursiveConfigurationKeyException`, if you have many configuration values that reference each other in a recursive manner, no matter how deep the recursion is. The exception will give you details about the recursive path.\n\n`UnresolvedConfigurationKeyException` can also be triggered sooner than later by using `AddSubstitution(eagerValidation: true)`. Using `eagerValidation` with value `true` (default is `false`) instructs the library to check for undefined values in **all the existing configuration values** once, instead of checking for a particular value. This happens as soon as any configuration value is loaded.\n\n\n### Configuration providers order\n\nWhen using .NET's [IConfigurationBuilder](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.iconfigurationbuilder), the order of configuration providers matters . Any configuration provider added after `AddSubstitution()` would not benefit from the substitution process.\n\n\n## License\n\nCopyright © 2022, Workleap. This code is licensed under the Apache License, Version 2.0. You may obtain a copy of this license at https://github.com/workleap/gsoft-license/blob/master/LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkleap%2Fwl-extensions-configuration-substitution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworkleap%2Fwl-extensions-configuration-substitution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworkleap%2Fwl-extensions-configuration-substitution/lists"}