public WapAuthenticationMiddleware(RequestDelegate next, IOcelotConfigurationProvider ocelotConfigurationProvider, IUrlPathToUrlTemplateMatcher urlMatcher, IPlaceholderNameAndValueFinder urlPathPlaceholderNameAndValueFinder) { _ocelotConfigurationProvider = ocelotConfigurationProvider; _urlMatcher = urlMatcher; _urlPathPlaceholderNameAndValueFinder = urlPathPlaceholderNameAndValueFinder; _next = next; }
public ExceptionHandlerMiddleware(OcelotRequestDelegate next, IOcelotLoggerFactory loggerFactory, IOcelotConfigurationProvider provider, IRequestScopedDataRepository repo) { _provider = provider; _repo = repo; _next = next; _logger = loggerFactory.CreateLogger <ExceptionHandlerMiddleware>(); }
public ExceptionHandlerMiddleware(RequestDelegate next, IOcelotLoggerFactory loggerFactory, IRequestScopedDataRepository requestScopedDataRepository, IOcelotConfigurationProvider configProvider) : base(requestScopedDataRepository) { _configProvider = configProvider; _next = next; _requestScopedDataRepository = requestScopedDataRepository; _logger = loggerFactory.CreateLogger <ExceptionHandlerMiddleware>(); }
private static async Task <IOcelotConfiguration> GetOcelotConfigAndReturn(IOcelotConfigurationProvider provider) { var ocelotConfiguration = await provider.Get(); if (ocelotConfiguration == null || ocelotConfiguration.Data == null || ocelotConfiguration.IsError) { ThrowToStopOcelotStarting(ocelotConfiguration); } return(ocelotConfiguration.Data); }
public DownstreamRouteFinderMiddleware(OcelotRequestDelegate next, IOcelotLoggerFactory loggerFactory, IDownstreamRouteFinder downstreamRouteFinder, IOcelotConfigurationProvider configProvider, IMultiplexer multiplexer) { _configProvider = configProvider; _multiplexer = multiplexer; _next = next; _downstreamRouteFinder = downstreamRouteFinder; _logger = loggerFactory.CreateLogger <DownstreamRouteFinderMiddleware>(); }
public DownstreamRouteFinderMiddleware(RequestDelegate next, IOcelotLoggerFactory loggerFactory, IDownstreamRouteFinder downstreamRouteFinder, IRequestScopedDataRepository requestScopedDataRepository, IOcelotConfigurationProvider configProvider) : base(requestScopedDataRepository) { _configProvider = configProvider; _next = next; _downstreamRouteFinder = downstreamRouteFinder; _logger = loggerFactory.CreateLogger <DownstreamRouteFinderMiddleware>(); }
public FilePeersProvider(IOptions <FilePeers> options, IBaseUrlFinder finder, IOcelotConfigurationProvider provider, IIdentityServerConfiguration identityServerConfig) { _identityServerConfig = identityServerConfig; _provider = provider; _finder = finder; _options = options; _peers = new List <IPeer>(); //todo - sort out async nonsense.. var config = _provider.Get().GetAwaiter().GetResult(); foreach (var item in _options.Value.Peers) { var httpClient = new HttpClient(); //todo what if this errors? var httpPeer = new HttpPeer(item.HostAndPort, httpClient, _finder, config.Data, _identityServerConfig); _peers.Add(httpPeer); } }
public OcelotConfigurationProviderTests() { _configurationRepository = new Mock <IOcelotConfigurationRepository>(); _ocelotConfigurationProvider = new OcelotConfigurationProvider(_configurationRepository.Object); }
public DownstreamRouteFinder(IOcelotConfigurationProvider configProvider, IUrlPathToUrlTemplateMatcher urlMatcher, IUrlPathPlaceholderNameAndValueFinder urlPathPlaceholderNameAndValueFinder) { _configProvider = configProvider; _urlMatcher = urlMatcher; _urlPathPlaceholderNameAndValueFinder = urlPathPlaceholderNameAndValueFinder; }
private static async Task <Response> SetConfig(IApplicationBuilder builder, IOptions <FileConfiguration> fileConfiguration, IFileConfigurationSetter setter, IOcelotConfigurationProvider provider, IFileConfigurationRepository repo) { if (UsingConsul(repo)) { return(await SetUpConfigFromConsul(builder, repo, setter, fileConfiguration)); } return(await setter.Set(fileConfiguration.Value)); }
public FileConfigurationProviderTests() { _creator = new Mock <IOcelotConfigurationCreator>(); _configurationRepository = new Mock <IOcelotConfigurationRepository>(); _ocelotConfigurationProvider = new OcelotConfigurationProvider(_configurationRepository.Object, _creator.Object); }