Esempio n. 1
0
 public static IDictionary <string, string> Parse(string input)
 {
     using (var reader = new StringReader(input))
         using (var parser = new JsonConfigurationParser())
         {
             return(parser.ParseInput(reader));
         }
 }
Esempio n. 2
0
 public static IDictionary <string, string> Parse(string input)
 {
     using (var doc = JsonDocument.Parse(input))
     {
         using (var parser = new JsonConfigurationParser())
         {
             parser.VisitElement(doc.RootElement);
             return(parser._data);
         }
     }
 }
Esempio n. 3
0
        private async Task <IDictionary <string, string> > GetParameterAsync()
        {
            using (var client = Source.AwsOptions.CreateServiceClient <IAmazonSimpleSystemsManagement>())
            {
                if (client is AmazonSimpleSystemsManagementClient impl)
                {
                    impl.BeforeRequestEvent += ServiceClientBeforeRequestEvent;
                }

                var response = await client.GetParameterAsync(new GetParameterRequest { Name = Source.Path, WithDecryption = true }).ConfigureAwait(false);

                if (!Source.ParameterProcessor.IncludeParameter(response.Parameter, SecretsManagerPath))
                {
                    return(new Dictionary <string, string>());
                }

                var prefix = Source.Prefix ?? Source.ParameterProcessor.GetKey(response.Parameter, SecretsManagerPath);
                return(AddPrefix(JsonConfigurationParser.Parse(Source.ParameterProcessor.GetValue(response.Parameter, SecretsManagerPath)), prefix));
            }
        }