Skip to content

Commit

Permalink
Shuffle some openapi and authentication config around
Browse files Browse the repository at this point in the history
  • Loading branch information
Kishotta committed May 27, 2024
1 parent ade94b6 commit 3573322
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/Evently/Api/Evently.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
.AddRedis(cacheConnectionString)
.AddUrlGroup(new Uri(keycloakHealthUrl), HttpMethod.Get, "Keycloak");

builder.Services.AddOpenApi();

var app = builder.Build();

if (app.Environment.IsDevelopment())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ internal static class AuthenticationExtensions
{
internal static IServiceCollection AddAuthenticationInternal(this IServiceCollection services)
{
services.AddAuthorization();

services.AddAuthentication().AddJwtBearer();

services.AddHttpContextAccessor();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ internal static class AuthorizationExtensions
{
internal static IServiceCollection AddAuthorizationInternal(this IServiceCollection services)
{
services.AddAuthorization();

services.AddTransient<IClaimsTransformation, CustomClaimsTransformation>();
services.AddTransient<IAuthorizationHandler, PermissionAuthorizationHandler>();
services.AddTransient<IAuthorizationPolicyProvider, PermissionAuthorizationPolicyProvider>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public static IServiceCollection AddInfrastructure(
string databaseConnectionString,
string cacheConnectionString)
{
services.AddAuthenticationInternal();
services.AddAuthorizationInternal();
services.AddAuthenticationInternal();

services.AddAuditing();

Expand Down

0 comments on commit 3573322

Please sign in to comment.