private static IDictionary <string, string> InjectSecrets(ISecretReaderFactory secretReaderFactory, Dictionary <string, string> argsDictionary)
        {
            var secretReader   = secretReaderFactory.CreateSecretReader(argsDictionary);
            var secretInjector = secretReaderFactory.CreateSecretInjector(secretReader);

            if (secretReader == null)
            {
                throw new ApplicationException("Could not create a secret reader. Please check your configuration.");
            }

            return(new SecretDictionary(secretInjector, argsDictionary));
        }
示例#2
0
        public void InjectSecretsInto(NameValueCollection collection)
        {
            var secretReader   = _secretReaderFactory.CreateSecretReader();
            var secretInjector = _secretReaderFactory.CreateSecretInjector(secretReader);

            IEnumerable keys = new List <string>(collection.AllKeys);

            foreach (string key in keys)
            {
                var framedString = collection[key];
                var newValue     = secretInjector.InjectAsync(framedString).Result;
                collection.Set(key, newValue);
            }
        }
 private ISecretInjector InitSecretInjector()
 {
     return(_secretReaderFactory.CreateSecretInjector(_secretReaderFactory.CreateSecretReader(new ConfigurationService(new EmptySecretReaderFactory()))));
 }
 private ISecretInjector InitSecretInjector()
 {
     return(_secretReaderFactory.CreateSecretInjector(_secretReaderFactory.CreateSecretReader()));
 }
 public ISecretInjector CreateSecretInjector(ISecretReader secretReader)
 {
     return(_underlyingFactory.CreateSecretInjector(secretReader));
 }
 public ISecretInjector CreateSecretInjector(ISecretReader secretReader)
 => _underlyingFactory.CreateSecretInjector(secretReader);