コード例 #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().GetAwaiter().GetResult() : client.GetAsync(key).GetAwaiter().GetResult();
            var parser = new JsonParser();
            var data   = parser.Parse(JObject.FromObject(secret));
            var source = new MemoryConfigurationSource {
                InitialData = data
            };

            builder.Add(source);

            return(builder);
        }
コード例 #2
0
 public VaultStore(VaultOptions options)
 {
     _options = options;
     LoadEnvironmentVariables();
 }