Ejemplo n.º 1
0
        private static IConfigurationBuilder AddVault(this IConfigurationBuilder builder,
                                                      VaultOptions options, string key)
        {
            var client = new VaultStore(options);
            var secret = string.IsNullOrWhiteSpace(key) ? client.GetDefaultAsync().Result : client.GetAsync(key).Result;
            var parser = new JsonParser();
            var data   = parser.Parse(JObject.FromObject(secret));
            var source = new MemoryConfigurationSource {
                InitialData = data
            };

            builder.Add(source);

            return(builder);
        }
Ejemplo n.º 2
0
 public VaultStore(VaultOptions options)
 {
     _options = options;
     LoadEnvironmentVariables();
 }