Example #1
0
        public static void AddFirstPartyServices(
            this IServiceCollection services,
            IHostingEnvironment env,
            IConfigurationRoot config)
        {
            ConfigureAuth(services, config);


            if (env.IsDevelopment())
            {
                services.AddDbContext <IncidentContext>(options => options.UseInMemoryDatabase("Live"));
            }
            if (env.IsStaging())
            {
                services.AddDbContext <IncidentContext>(options => options.UseSqlServer(config.GetConnectionString("incidentStaging")));
            }

            services.AddTicketingConnector(env, config);

            services.AddSingleton <IConfigurationRoot>(i => config);

            var httpClients = new HttpClientLookup();

            if (TryGetConfigValue(config, "Services:Playbook", out string playbookBaseUrl))
            {
                httpClients.RegisterEndpoint("Playbook", playbookBaseUrl);
            }

            services.AddSingleton(httpClients);
        }
        public static IServiceCollection AddMicroserviceProxies(this IServiceCollection services, GatewayConfiguration config)
        {
            var httpClients = new HttpClientLookup();

            if (!String.IsNullOrEmpty(config.Services.Playbook))
            {
                httpClients.RegisterEndpoint(nameof(config.Services.Playbook), config.Services.Playbook);
            }

            return(services.AddSingleton(httpClients));
        }
Example #3
0
 protected ProxyHandler(HttpClientLookup clientFactory, string endpointName)
     : base(clientFactory, endpointName)
 {
 }
Example #4
0
 protected ProxyHandlerBase(HttpClientLookup clientFactory, string endpointName)
 {
     _client = clientFactory.GetClientForEndpoint(endpointName);
 }
 protected PlaybookProxyHandler(HttpClientLookup clientFactory)
     : base(clientFactory, PlaybookEndpointName)
 {
 }
Example #6
0
 public GetGlobalActionsHandler(HttpClientLookup clientFactory) : base(clientFactory)
 {
 }
Example #7
0
 public GetEventTypeHandler(HttpClientLookup clientFactory) : base(clientFactory)
 {
 }