This commit is contained in:
2026-11-27 19:21:58 +03:30
parent bdc8791822
commit b7a00244df
4 changed files with 130 additions and 62 deletions
-32
View File
@@ -141,38 +141,6 @@ namespace xIdentityService.DI
source.AddScoped<IXRoleHierarchyResolver, XRoleHierarchyResolver>();
}
public static void AddXAuthorizationProvider(
this IServiceCollection source
)
{
//
// Validate Requirements ...
var roles = source.GetRegisteredService<IXRoleProvider>();
var scopes = source.GetRegisteredService<IXScopeProvider>();
var policies = source.GetRegisteredService<IXPolicyProvider>();
var cache = source.GetRegisteredService<IXAuthorizationCache>();
var resolver = source.GetRegisteredService<IXRoleHierarchyResolver>();
// var roleSync = source.GetRegisteredService<IXRoleSyncService>();
// var scopeSync = source.GetRegisteredService<IXScopeSyncService>();
//
var isInvalid =
roles.IsNull() ||
cache.IsNull() ||
scopes.IsNull() ||
policies.IsNull() ||
resolver.IsNull();
// roleSync.IsNull() ||
// scopeSync.IsNull();
if (isInvalid)
{
XException.InvalidConfiguration.Throw();
}
//
source.AddScoped<IXAuthorizationProvider, XAuthorizationProvider>();
}
/// <summary>
/// Use Authentication
/// </summary>