public RotateKeysBackgroundService( ILogger <RotateKeysBackgroundService> logger, EncryptionServiceApi encryptionServiceApi) { _logger = logger; _encryptionServiceApi = encryptionServiceApi; }
public ProxyController(IHttpClientFactory factory, EncryptionServiceApi encryptionServiceApi) { _encryptionServiceApi = encryptionServiceApi; var client = factory.CreateClient(); client.BaseAddress = new Uri(_encryptionServiceApi.BaseUrl); _httpClient = client; }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddHttpClient(); services.AddSingleton((serviceProvider) => { var settingsApi = new EncryptionServiceApi(); Configuration.GetSection("EncryptionServiceApi").Bind(settingsApi); return(settingsApi); }); services.AddResponseCompression(); services.AddHostedService <RotateKeysBackgroundService>(); services.AddSwaggerDocument(); }