Skip to content

Support for multiple secrets containing same key (hierarchy of secrets) #94

@madkins-webscale

Description

@madkins-webscale

The provider crashes if you have multiple secrets that specify the same key
This occurs in the SetData method when generating the dictionary (Unhandled exception. System.ArgumentException: An item with the same key has already been added)

Our use case is wanting to have a full set of configuration, including development or placeholder values for secrets and then a separate secret which takes precedence over this and supplies the actual secret values, overriding the placeholder values

It'd be nice if there was a way to either override the SetData method (ie we could customise the provider class - protected methods and ability to pass derived class into SecretsManagerConfigurationSource etc) or a preFilter type options method that allowed you to filter _loadedValues before the call to SetData (or at the beginning of SetData):

          if (!oldValues.SetEquals(newValues))
            {
                _loadedValues = newValues;
                SetData(_loadedValues, triggerReload: true);
            }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions