public DiagnosticKeysController(ICacheOperations cacheOperations, ILogger <DiagnosticKeysController> logger,
                                 ITemporaryExposureKeyRepository temporaryExposureKeyRepository, IExposureKeyValidator exposureKeyValidator,
                                 IExposureConfigurationService exposureConfigurationService, KeyValidationConfiguration keyValidationRulesConfig,
                                 ICountryRepository countryRepository, AppSettingsConfig appSettingsConfig, IAddTemporaryExposureKeyService addTemporaryExposureKeyService)
 {
     _addTemporaryExposureKeyService = addTemporaryExposureKeyService;
     _cacheOperations = cacheOperations;
     _temporaryExposureKeyRepository = temporaryExposureKeyRepository;
     _exposureKeyValidator           = exposureKeyValidator;
     _logger = logger;
     _exposureConfigurationService = exposureConfigurationService;
     _keyValidationRulesConfig     = keyValidationRulesConfig;
     _appSettingsConfig            = appSettingsConfig;
     _countryRepository            = countryRepository;
 }
예제 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, AppSettingsConfig appSettingsConfig)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            var loggingConfig = Configuration.GetSection(nameof(Logging)).Get <Logging>();

            Enum.TryParse(loggingConfig.LogLevel.Default, out LogLevel logLevel);
            loggerFactory.AddFile(appSettingsConfig.LogsApiPath, logLevel,
                                  fileSizeLimitBytes: appSettingsConfig.LogFileSizeLimitBytes);

            app.UseHttpsRedirection();

            app.UseHsts();

            app.Use(async(context, next) =>
            {
                context.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
                await next();
            });

            app.UseRouting();

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.RoutePrefix = "";
                c.SwaggerEndpoint("swagger/v1/swagger.json", "API Version 1");
                c.SwaggerEndpoint("swagger/v2/swagger.json", "API Version 2");
                c.SwaggerEndpoint("swagger/v3/swagger.json", "API Version 3");
            });

            app.UseAuthorization();
            app.UseAuthentication();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
예제 #3
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, AppSettingsConfig appSettingsConfig)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            loggerFactory.AddFile(appSettingsConfig.LogsApiPath);

            app.UseHttpsRedirection();

            app.UseHsts();

            app.Use(async(context, next) =>
            {
                context.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
                await next();
            });

            app.UseRouting();

            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.RoutePrefix = "";
                c.SwaggerEndpoint("swagger/v1/swagger.json", "API Version 1");
                c.SwaggerEndpoint("swagger/v2/swagger.json", "API Version 2");
                c.SwaggerEndpoint("swagger/v3/swagger.json", "API Version 3");
            });

            app.UseAuthorization();
            app.UseAuthentication();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }