From 3c21e0ea1a05ed91b049af2ea9bb4552cd52216e Mon Sep 17 00:00:00 2001 From: XShine555 Date: Fri, 20 Mar 2026 09:41:43 +0100 Subject: [PATCH] Rename --- .../{IKeycloakUserClient.cs => IKeycloakUserService.cs} | 2 +- .../Users/Commands/CreateUser/CreateUserCommandHandler.cs | 2 +- .../Users/Queries/GetUserById/GetUserByIdQueryHandler.cs | 2 +- .../GetUserByKeycloakId/GetUserByKeycloakQueryHandler.cs | 2 +- Application/Users/Queries/GetUsers/GetUsersQueryHandler.cs | 2 +- Infrastructure/Identity/KeycloakDependencyInjection.cs | 4 ++-- .../{KeycloakIdentityService.cs => KeycloakUserService.cs} | 4 ++-- Infrastructure/InfrastructureDependencyInjection.cs | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename Application/Contracts/Infrastructure/{IKeycloakUserClient.cs => IKeycloakUserService.cs} (93%) rename Infrastructure/Identity/{KeycloakIdentityService.cs => KeycloakUserService.cs} (95%) diff --git a/Application/Contracts/Infrastructure/IKeycloakUserClient.cs b/Application/Contracts/Infrastructure/IKeycloakUserService.cs similarity index 93% rename from Application/Contracts/Infrastructure/IKeycloakUserClient.cs rename to Application/Contracts/Infrastructure/IKeycloakUserService.cs index 688ef1d..055f7f4 100644 --- a/Application/Contracts/Infrastructure/IKeycloakUserClient.cs +++ b/Application/Contracts/Infrastructure/IKeycloakUserService.cs @@ -3,7 +3,7 @@ using Musify.Application.Users.Contracts; namespace Musify.Application.Contracts.Infrastructure { - public interface IKeycloakUserClient + public interface IKeycloakUserService { Task> GetUserByIdAsync(string keycloakId, CancellationToken cancellationToken); diff --git a/Application/Users/Commands/CreateUser/CreateUserCommandHandler.cs b/Application/Users/Commands/CreateUser/CreateUserCommandHandler.cs index 2e72d70..add9aef 100644 --- a/Application/Users/Commands/CreateUser/CreateUserCommandHandler.cs +++ b/Application/Users/Commands/CreateUser/CreateUserCommandHandler.cs @@ -8,7 +8,7 @@ using Musify.Domain.Entities; namespace Musify.Application.Users.Commands.CreateUser { - public class CreateUserCommandHandler(IDatabase database, IKeycloakUserClient keycloakUserClient, ILogger logger) + public class CreateUserCommandHandler(IDatabase database, IKeycloakUserService keycloakUserClient, ILogger logger) : IRequestHandler >> { public async Task> Handle(CreateUserCommand request, CancellationToken cancellationToken) diff --git a/Application/Users/Queries/GetUserById/GetUserByIdQueryHandler.cs b/Application/Users/Queries/GetUserById/GetUserByIdQueryHandler.cs index b6550c0..f57b93b 100644 --- a/Application/Users/Queries/GetUserById/GetUserByIdQueryHandler.cs +++ b/Application/Users/Queries/GetUserById/GetUserByIdQueryHandler.cs @@ -6,7 +6,7 @@ using Musify.Application.Users.Contracts; namespace Musify.Application.Users.Queries.GetUserById { - public class GetUserByIdQueryHandler(IDatabase database, IKeycloakUserClient keycloakUserClient) + public class GetUserByIdQueryHandler(IDatabase database, IKeycloakUserService keycloakUserClient) : IRequestHandler>> { public async Task> Handle(GetUserByIdQuery request, CancellationToken cancellationToken) diff --git a/Application/Users/Queries/GetUserByKeycloakId/GetUserByKeycloakQueryHandler.cs b/Application/Users/Queries/GetUserByKeycloakId/GetUserByKeycloakQueryHandler.cs index bca8ee5..2f7c897 100644 --- a/Application/Users/Queries/GetUserByKeycloakId/GetUserByKeycloakQueryHandler.cs +++ b/Application/Users/Queries/GetUserByKeycloakId/GetUserByKeycloakQueryHandler.cs @@ -6,7 +6,7 @@ using Musify.Application.Users.Contracts; namespace Musify.Application.Users.Queries.GetUserByKeycloakId { - public class GetUserByKeycloakQueryHandler(IDatabase database, IKeycloakUserClient keycloakUserClient) + public class GetUserByKeycloakQueryHandler(IDatabase database, IKeycloakUserService keycloakUserClient) : IRequestHandler>> { public async Task> Handle(GetUserByKeycloakQuery request, CancellationToken cancellationToken) diff --git a/Application/Users/Queries/GetUsers/GetUsersQueryHandler.cs b/Application/Users/Queries/GetUsers/GetUsersQueryHandler.cs index dc4d704..9e7ecf3 100644 --- a/Application/Users/Queries/GetUsers/GetUsersQueryHandler.cs +++ b/Application/Users/Queries/GetUsers/GetUsersQueryHandler.cs @@ -8,7 +8,7 @@ using X.PagedList.Extensions; namespace Musify.Application.Users.Queries.GetUsers { - public class GetUsersQueryHandler(IDatabase database, IKeycloakUserClient keycloakUserClient) + public class GetUsersQueryHandler(IDatabase database, IKeycloakUserService keycloakUserClient) : IRequestHandler >> { public async Task> Handle(GetUsersQuery request, CancellationToken cancellationToken) diff --git a/Infrastructure/Identity/KeycloakDependencyInjection.cs b/Infrastructure/Identity/KeycloakDependencyInjection.cs index 6e5accb..ff03f43 100644 --- a/Infrastructure/Identity/KeycloakDependencyInjection.cs +++ b/Infrastructure/Identity/KeycloakDependencyInjection.cs @@ -8,7 +8,7 @@ namespace Musify.Infrastructure.Identity { public static class KeycloakDependencyInjection { - public static IServiceCollection AddKeycloakAuthentication(this IServiceCollection serviceDescriptors, IConfiguration configuration) + public static IServiceCollection AddKeycloakService(this IServiceCollection serviceDescriptors, IConfiguration configuration) { serviceDescriptors.AddOptionsWithValidateOnStart() .Bind(configuration.GetRequiredSection(KeycloakConfiguration.SectionName)) @@ -23,7 +23,7 @@ namespace Musify.Infrastructure.Identity keycloakConfiguration.Username, keycloakConfiguration.Password); } ); - serviceDescriptors.AddScoped(); + serviceDescriptors.AddScoped(); return serviceDescriptors; } } diff --git a/Infrastructure/Identity/KeycloakIdentityService.cs b/Infrastructure/Identity/KeycloakUserService.cs similarity index 95% rename from Infrastructure/Identity/KeycloakIdentityService.cs rename to Infrastructure/Identity/KeycloakUserService.cs index a2d1d8f..175fc3e 100644 --- a/Infrastructure/Identity/KeycloakIdentityService.cs +++ b/Infrastructure/Identity/KeycloakUserService.cs @@ -8,10 +8,10 @@ using Musify.Infrastructure.Configuration; namespace Musify.Infrastructure.Identity { - public class KeycloakIdentityService( + public class KeycloakUserService( KeycloakClient keycloakClient, KeycloakConfiguration keycloakConfiguration, - ILogger logger) : IKeycloakUserClient + ILogger logger) : IKeycloakUserService { public async Task> GetUserByIdAsync(string keycloakId, CancellationToken cancellationToken) { diff --git a/Infrastructure/InfrastructureDependencyInjection.cs b/Infrastructure/InfrastructureDependencyInjection.cs index 3d52f0f..8e5e072 100644 --- a/Infrastructure/InfrastructureDependencyInjection.cs +++ b/Infrastructure/InfrastructureDependencyInjection.cs @@ -17,7 +17,7 @@ namespace Musify.Infrastructure serviceDescriptors .AddInfrastructureConfigurations(configuration) .AddDatabase(configuration) - .AddKeycloakAuthentication(configuration) + .AddKeycloakClient(configuration) .AddStorageHandler() .AddPictureHandler() .AddMassTransitClient(configuration)