mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 14:11:10 +00:00
Implements authorization caching and check in the web client
This commit is contained in:
1 parent
7bca5b1ba3
commit
8eb1b9f13c
108 files changed
+5931
-73
No files matched your search
+9
-1
@@ -3,8 +3,10 @@ using FluentValidation;
|
||||
using Lumina.Presentation.Web.Common.Api;
|
||||
using Lumina.Presentation.Web.Common.Authorization;
|
||||
using Lumina.Presentation.Web.Common.Exceptions;
|
||||
using Lumina.Presentation.Web.Common.Filters;
|
||||
using Lumina.Presentation.Web.Common.Filters.AuthorizationFilters;
|
||||
using Lumina.Presentation.Web.Common.Filters.ExceptionFilters;
|
||||
using Lumina.Presentation.Web.Common.MiddlewareFilters;
|
||||
using Lumina.Presentation.Web.Common.Models.Authorization;
|
||||
using Lumina.Presentation.Web.Common.Security;
|
||||
using Lumina.Presentation.Web.Common.Services;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
@@ -203,9 +205,14 @@ public static class PresentationWebLayerServices
|
||||
|
||||
// register the HTTP typed client used for the API interaction
|
||||
services.AddHttpClient<IApiHttpClient, ApiHttpClient>()
|
||||
.AddHttpMessageHandler<CachedAuthorizationHandler>()
|
||||
.AddPolicyHandler(retryPolicy)
|
||||
.AddPolicyHandler(circuitBreakerPolicy);
|
||||
|
||||
services.AddScoped<CachedAuthorizationHandler>();
|
||||
services.AddScoped<ApiAuthorizationFilter>();
|
||||
services.AddScoped<AuthorizationRequirementModel>();
|
||||
|
||||
// enable access to the current HTTP context in non-controller classes
|
||||
services.AddHttpContextAccessor();
|
||||
|
||||
@@ -213,6 +220,7 @@ public static class PresentationWebLayerServices
|
||||
services.AddScoped<IAuthorizationHandler, InitializationHandler>();
|
||||
services.AddSingleton<ICryptographyService, CryptographyService>();
|
||||
services.AddSingleton<IUrlService, UrlService>();
|
||||
services.AddHybridCache(); // used for caching authorization roles, permissions and policies
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user