Open tebeco opened 1 year ago
Tagging subscribers to this area: @dotnet/area-extensions-configuration See info in area-owners.md if you want to be subscribed.
Author: | tebeco |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `untriaged`, `area-Extensions-Configuration` |
Milestone: | - |
Background and motivation
This affects teams working in organizations which works on multiple (micro or not) services.
When working with multiple Project/Api, the chance is hight that most services will share the same monitoring cluster / cache / SignalR / etc.... The result is that
ServiceA
andServiceB
while clone few douzen of repo at work.ServiceA
new Redis code in a local redis container etc ...ServiceA
might have key specific toServiceA
which are not desired to be loaded or could conflict inServiceB
Hopefully, the
Configuration
Api handle adding multiple source of configurations for that. The limitation today is thatUserSecrets
can only ever loaded once which make it impossible to re-use shared key:When a key is edited:
API Proposal
Unsure if we should add
UserSecretsIds
(with ans
) in addition toUserSecretsIds
. I'm guessing both are probably possibleWill load
foo
and thenbar
. Just like all `Configuration provider the order matters, nothing changes hereAPI Usage
single:
multiple:
Alternative Designs
It's unclear for me what's the best solution here between:
UserSecretsIdAttribute
fromstring
tostring[]
inproperty
only and split + dedup in ctorUserSecretsIdAttribute
fromstring
tostring[]
inctor
+property
Impact: will create clear/direct breaking code at build timeUserSecretsIdsAttribute
Impact: might create runtime bug on existing code/third part not updating how to list attributesAllowMultiple = false
toAllowMultiple = true
on existingUserSecretsIdsAttribute
Impact: might create runtime bug on existing code/third part not updating how to list attributesSticking with the proposal would allow to not change this part of the code:
.\src\libraries\Microsoft.Extensions.Configuration.UserSecrets\src\buildTransitive\Microsoft.Extensions.Configuration.UserSecrets.targets
Risks
If MsBuild pluralization is asked, then we would need to consider that consumers could have conflict such as: