Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="configuration"></param>
        /// <param name="ruleName"></param>
        /// <param name="requestUri"></param>
        /// <returns></returns>
        public static IAggregatorConfiguration UpdateFromUrl(this IAggregatorConfiguration configuration, string ruleName, Uri requestUri)
        {
            var parameters = System.Web.HttpUtility.ParseQueryString(requestUri.Query);

            configuration.DryRun   = IsDryRunEnabled(parameters);
            configuration.SaveMode = GetSaveMode(parameters);
            configuration.GetRuleConfiguration(ruleName).Impersonate = IsImpersonationEnabled(parameters);

            return(configuration);
        }
        public static void WriteConfiguration(this IAggregatorConfiguration config, Microsoft.Azure.Management.AppService.Fluent.IWebApp webApp)
        {
            var settings = new Dictionary <string, string>()
            {
                { "Aggregator_VstsTokenType", config.DevOpsTokenType.ToString() },
                { "Aggregator_VstsToken", config.DevOpsToken },
                { "Aggregator_SaveMode", config.SaveMode.ToString() },
            };

            foreach (var ruleSetting in config.RulesConfiguration.Select(kvp => kvp.Value))
            {
                settings.AddRuleSettings(ruleSetting);
            }

            webApp.ApplyWithAppSettings(settings);
        }
        public static IRuleConfiguration GetRuleConfiguration(this IAggregatorConfiguration config, string ruleName)
        {
            var ruleConfig = config.RulesConfiguration.GetValueOrDefault(ruleName) ?? (config.RulesConfiguration[ruleName] = new RuleConfiguration(ruleName));

            return(ruleConfig);
        }
Exemplo n.º 4
0
 public RuleExecutor(IAggregatorLogger logger, IAggregatorConfiguration configuration)
 {
     this.configuration = configuration;
     this.logger        = logger;
 }