public ClientApiKeyValidationMiddleware(RequestDelegate next, IClientApiKeyService clientApiKeyService, IOptions <ApiGatewaySettings> settings) { _next = next; _clientApiKeyService = clientApiKeyService; _settings = settings.Value; if (!string.IsNullOrWhiteSpace(_settings.AllowAnonymousApiPath) && _settings.AllowAnonymousApiPath.Length > 0) { _allowAnnon = new Regex(_settings.AllowAnonymousApiPath, RegexOptions.IgnoreCase); } }
public ReverseProxyMiddleware(RequestDelegate next, ILoggerFactory loggerFactory, IOptions <ApiGatewaySettings> apiGatewaySettingsOptions, IHttpClientFactory httpClientFactory) { if (loggerFactory == null) { throw new ArgumentNullException(nameof(loggerFactory)); } _logger = loggerFactory.CreateLogger <ReverseProxyMiddleware>(); _settings = apiGatewaySettingsOptions?.Value ?? throw new ArgumentNullException(nameof(apiGatewaySettingsOptions)); _httpClientFactory = httpClientFactory ?? throw new ArgumentNullException(nameof(httpClientFactory)); }
public Startup(IConfiguration configuration) { Configuration = configuration; _settings = Configuration.GetSection(typeof(ApiGatewaySettings).Name).Get <ApiGatewaySettings>(); }
public ClientApiKeyService(IOptions <ApiGatewaySettings> settings, IHttpClientFactory clientFactory) { _settings = settings.Value; _clientFactory = clientFactory; }