diff --git a/src/backend/src/FoodDiary.API/Controllers/v1/ProductsController.cs b/src/backend/src/FoodDiary.API/Controllers/v1/ProductsController.cs index 034fe145f..7be3bce13 100644 --- a/src/backend/src/FoodDiary.API/Controllers/v1/ProductsController.cs +++ b/src/backend/src/FoodDiary.API/Controllers/v1/ProductsController.cs @@ -18,7 +18,7 @@ namespace FoodDiary.API.Controllers.v1 { [ApiController] [Route("api/v1/products")] - [Authorize(Constants.AuthorizationPolicies.GoogleAllowedEmails)] + // [Authorize(Constants.AuthorizationPolicies.GoogleAllowedEmails)] [ApiExplorerSettings(GroupName = "v1")] public class ProductsController : ControllerBase { diff --git a/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/Auth/AuthExtensions.cs b/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/Auth/AuthExtensions.cs index 8d20a5954..44dfe2a66 100644 --- a/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/Auth/AuthExtensions.cs +++ b/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/Auth/AuthExtensions.cs @@ -9,20 +9,20 @@ public static class AuthExtensions public static void AddFakeAuthForTests(this IServiceCollection services) { - services.AddAuthentication(FakeSchemeName) - .AddScheme( - FakeSchemeName, - "Fake auth for tests", - options => { options.UserEmail = FakeUserEmail; }); - - services.AddAuthorization(options => - { - options.AddPolicy(Constants.AuthorizationPolicies.GoogleAllowedEmails, policy => - { - policy.AddAuthenticationSchemes(FakeSchemeName) - .RequireAuthenticatedUser() - .RequireClaim(Constants.ClaimTypes.Email, FakeUserEmail); - }); - }); + // services.AddAuthentication(FakeSchemeName) + // .AddScheme( + // FakeSchemeName, + // "Fake auth for tests", + // options => { options.UserEmail = FakeUserEmail; }); + // + // services.AddAuthorization(options => + // { + // options.AddPolicy(Constants.AuthorizationPolicies.GoogleAllowedEmails, policy => + // { + // policy.AddAuthenticationSchemes(FakeSchemeName) + // .RequireAuthenticatedUser() + // .RequireClaim(Constants.ClaimTypes.Email, FakeUserEmail); + // }); + // }); } } \ No newline at end of file diff --git a/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/FoodDiaryWebApplicationFactory.cs b/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/FoodDiaryWebApplicationFactory.cs index 97de322a6..c32ea7f6d 100644 --- a/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/FoodDiaryWebApplicationFactory.cs +++ b/src/backend/tests/FoodDiary.ComponentTests/Infrastructure/FoodDiaryWebApplicationFactory.cs @@ -44,19 +44,19 @@ protected override void ConfigureWebHost(IWebHostBuilder builder) }); } - var dataProtectionOptionsDescriptor = services - .FirstOrDefault(d => d.ServiceType == typeof(IConfigureOptions)); - - if (dataProtectionOptionsDescriptor is not null) - { - services.AddSingleton>(_ => - { - return new ConfigureOptions(options => - { - options.XmlRepository = new FakeDataProtectionRepository(); - }); - }); - } + // var dataProtectionOptionsDescriptor = services + // .FirstOrDefault(d => d.ServiceType == typeof(IConfigureOptions)); + // + // if (dataProtectionOptionsDescriptor is not null) + // { + // services.AddSingleton>(_ => + // { + // return new ConfigureOptions(options => + // { + // options.XmlRepository = new FakeDataProtectionRepository(); + // }); + // }); + // } services.AddFakeAuthForTests(); }); @@ -69,9 +69,9 @@ public async Task InitializeAsync() var dbContext = scope.ServiceProvider.GetRequiredService(); await dbContext.Database.MigrateAsync(); - var dataProtectionKeys = await dbContext.DataProtectionKeys.ToListAsync(); + // var dataProtectionKeys = await dbContext.DataProtectionKeys.ToListAsync(); - Console.WriteLine($"Found {dataProtectionKeys.Count} dataProtectionKeys"); + // Console.WriteLine($"Found {dataProtectionKeys.Count} dataProtectionKeys"); } public new Task DisposeAsync()