From 3e4d29744a1a84fc2ecab66f666acf4d3ba447b4 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 26 Jul 2023 21:08:05 -0400 Subject: [PATCH] removed unused service --- .../Keycloak/Service/CachedKeycloakService.cs | 127 ------------------ 1 file changed, 127 deletions(-) delete mode 100644 services/identity/src/EShopOnAbp.IdentityService.Application/Keycloak/Service/CachedKeycloakService.cs diff --git a/services/identity/src/EShopOnAbp.IdentityService.Application/Keycloak/Service/CachedKeycloakService.cs b/services/identity/src/EShopOnAbp.IdentityService.Application/Keycloak/Service/CachedKeycloakService.cs deleted file mode 100644 index 64e06aec..00000000 --- a/services/identity/src/EShopOnAbp.IdentityService.Application/Keycloak/Service/CachedKeycloakService.cs +++ /dev/null @@ -1,127 +0,0 @@ -// using System.Collections.Generic; -// using System.Linq; -// using System.Threading; -// using System.Threading.Tasks; -// using Keycloak.Net.Models.Roles; -// using Keycloak.Net.Models.Users; -// using Volo.Abp.Caching; -// using Volo.Abp.DependencyInjection; -// -// namespace EShopOnAbp.IdentityService.Keycloak.Service; -// -// [ExposeServices(typeof(CachedKeycloakService))] -// public class CachedKeycloakService : IKeycloakService -// { -// protected const string UsersCacheKey = "KeycloakUsers"; -// protected const string RolesCacheKey = "KeycloakRoles"; -// private readonly IKeycloakService _keycloakService; -// private readonly IDistributedCache> _keycloakUsersCache; -// private readonly IDistributedCache> _keycloakRolesCache; -// -// public CachedKeycloakService(IKeycloakService keycloakService, -// IDistributedCache> keycloakUsersCache, -// IDistributedCache> keycloakRolesCache) -// { -// _keycloakService = keycloakService; -// _keycloakUsersCache = keycloakUsersCache; -// _keycloakRolesCache = keycloakRolesCache; -// } -// -// public async Task> GetUsersAsync(string search = null, string username = null, -// string email = null, -// CancellationToken cancellationToken = default) -// { -// var users = await _keycloakUsersCache.GetAsync(UsersCacheKey, token: cancellationToken); -// if (users == null) -// { -// users = (await _keycloakService.GetUsersAsync(search, username, email, cancellationToken)).ToList(); -// await _keycloakUsersCache.SetAsync(UsersCacheKey, users, token: cancellationToken); -// } -// -// return users; -// } -// -// public async Task CreateUserAsync(User user, CancellationToken cancellationToken = default) -// { -// var result = await _keycloakService.CreateUserAsync(user, cancellationToken); -// if (result) -// { -// await _keycloakUsersCache.RemoveAsync(UsersCacheKey, token: cancellationToken); -// } -// -// return result; -// } -// -// public async Task UpdateUserAsync(string userId, User user, CancellationToken cancellationToken = default) -// { -// var result = await _keycloakService.UpdateUserAsync(userId, user, cancellationToken); -// if (result) -// { -// await _keycloakUsersCache.RemoveAsync(UsersCacheKey, token: cancellationToken); -// } -// -// return result; -// } -// -// public async Task DeleteUserAsync(string userId, CancellationToken cancellationToken = default) -// { -// var result = await _keycloakService.DeleteUserAsync(userId, cancellationToken); -// if (result) -// { -// await _keycloakUsersCache.RemoveAsync(UsersCacheKey, token: cancellationToken); -// } -// -// return result; -// } -// -// public async Task> GetRolesAsync(CancellationToken cancellationToken = default) -// { -// var roles = await _keycloakRolesCache.GetAsync(RolesCacheKey, token: cancellationToken); -// if (roles == null) -// { -// roles = (await _keycloakService.GetRolesAsync(cancellationToken: cancellationToken)).ToList(); -// await _keycloakRolesCache.SetAsync(RolesCacheKey, roles, token: cancellationToken); -// } -// -// return roles; -// } -// -// public Task AddRolesToUserAsync(string userId, IEnumerable roles, -// CancellationToken cancellationToken = default) -// { -// return _keycloakService.AddRolesToUserAsync(userId, roles, cancellationToken); -// } -// -// public async Task CreateRoleAsync(string name, CancellationToken cancellationToken = default) -// { -// var result = await _keycloakService.CreateRoleAsync(name, cancellationToken); -// if (result) -// { -// await _keycloakRolesCache.RemoveAsync(RolesCacheKey, token: cancellationToken); -// } -// -// return result; -// } -// -// public async Task DeleteRoleByIdAsync(string id, CancellationToken cancellationToken = default) -// { -// var result = await _keycloakService.DeleteRoleByIdAsync(id, cancellationToken); -// if (result) -// { -// await _keycloakRolesCache.RemoveAsync(RolesCacheKey, token: cancellationToken); -// } -// -// return result; -// } -// -// public async Task UpdateRoleAsync(string id, Role role, CancellationToken cancellationToken = default) -// { -// var result = await _keycloakService.UpdateRoleAsync(id, role, cancellationToken); -// if (result) -// { -// await _keycloakRolesCache.RemoveAsync(RolesCacheKey, token: cancellationToken); -// } -// -// return result; -// } -// } \ No newline at end of file