The middleware is not able to pick up the transformer, and fails with:
System.ArgumentException: Can find any specified type request transformer. (Parameter 'RequestTransformerType')
at Casbin.AspNetCore.Authorization.DefaultEnforcerService.EnforceAsync(ICasbinAuthorizationContext context)
at Casbin.AspNetCore.Authorization.Policy.CasbinAuthorizationHandler.HandleRequirementAsync(AuthorizationHandlerContext context, CasbinAuthorizationRequirement requirement, ICasbinAuthorizationContext casbinContext)
at Microsoft.AspNetCore.Authorization.AuthorizationHandler`2.HandleAsync(AuthorizationHandlerContext context)
at Microsoft.AspNetCore.Authorization.DefaultAuthorizationService.AuthorizeAsync(ClaimsPrincipal user, Object resource, IEnumerable`1 requirements)
at Casbin.AspNetCore.Authorization.CasbinEvaluator.AuthorizeAsync(ICasbinAuthorizationContext casbinContext, AuthorizationPolicy policy, AuthenticateResult authenticationResult)
at Casbin.AspNetCore.Authorization.CasbinAuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Builder.Extensions.MapWhenMiddleware.Invoke(HttpContext context)
at AspNetCoreRateLimit.RateLimitMiddleware`1.Invoke(HttpContext context) in C:\Users\User\Documents\Github\AspNetCoreRateLimit\src\AspNetCoreRateLimit\Middleware\RateLimitMiddleware.cs:line 123
at Serilog.AspNetCore.RequestLoggingMiddleware.Invoke(HttpContext httpContext)
Not sure how to make CasbinAuthorizeAttribute() use the specific transformer. I've tried creating the transformer in the same namespace as the controller, but with the same result.
I am trying to override the default request transformer for individual controller actions.
Like so:
The middleware is not able to pick up the transformer, and fails with:
Not sure how to make CasbinAuthorizeAttribute() use the specific transformer. I've tried creating the transformer in the same namespace as the controller, but with the same result.