Exemplo n.º 1
0
 private static void RegisterDependencies(IServiceCollection serviceCollection, UmaConfigurationOptions umaConfigurationOptions = null, ICollection <ResourceSet> resources = null, ICollection <Policy> policies = null)
 {
     serviceCollection.AddTransient <IResourceSetActions, ResourceSetActions>();
     serviceCollection.AddTransient <IAddResourceSetAction, AddResourceSetAction>();
     serviceCollection.AddTransient <IGetResourceSetAction, GetResourceSetAction>();
     serviceCollection.AddTransient <IUpdateResourceSetAction, UpdateResourceSetAction>();
     serviceCollection.AddTransient <IDeleteResourceSetAction, DeleteResourceSetAction>();
     serviceCollection.AddTransient <IGetAllResourceSetAction, GetAllResourceSetAction>();
     serviceCollection.AddTransient <IResourceSetParameterValidator, ResourceSetParameterValidator>();
     serviceCollection.AddTransient <IPermissionControllerActions, PermissionControllerActions>();
     serviceCollection.AddTransient <IAddPermissionAction, AddPermissionAction>();
     serviceCollection.AddTransient <IRepositoryExceptionHelper, RepositoryExceptionHelper>();
     serviceCollection.AddTransient <IAuthorizationPolicyValidator, AuthorizationPolicyValidator>();
     serviceCollection.AddTransient <IBasicAuthorizationPolicy, BasicAuthorizationPolicy>();
     serviceCollection.AddTransient <ICustomAuthorizationPolicy, CustomAuthorizationPolicy>();
     serviceCollection.AddTransient <IAddAuthorizationPolicyAction, AddAuthorizationPolicyAction>();
     serviceCollection.AddTransient <IPolicyActions, PolicyActions>();
     serviceCollection.AddTransient <IGetAuthorizationPolicyAction, GetAuthorizationPolicyAction>();
     serviceCollection.AddTransient <IDeleteAuthorizationPolicyAction, DeleteAuthorizationPolicyAction>();
     serviceCollection.AddTransient <IGetAuthorizationPoliciesAction, GetAuthorizationPoliciesAction>();
     serviceCollection.AddTransient <IUpdatePolicyAction, UpdatePolicyAction>();
     serviceCollection.AddTransient <IJwtTokenParser, JwtTokenParser>();
     serviceCollection.AddTransient <IAddResourceSetToPolicyAction, AddResourceSetToPolicyAction>();
     serviceCollection.AddTransient <IDeleteResourcePolicyAction, DeleteResourcePolicyAction>();
     serviceCollection.AddTransient <IGetPoliciesAction, GetPoliciesAction>();
     serviceCollection.AddTransient <ISearchAuthPoliciesAction, SearchAuthPoliciesAction>();
     serviceCollection.AddTransient <ISearchResourceSetOperation, SearchResourceSetOperation>();
     serviceCollection.AddTransient <IUmaTokenActions, UmaTokenActions>();
     serviceCollection.AddTransient <IGetTokenByTicketIdAction, GetTokenByTicketIdAction>();
     serviceCollection.AddTransient <IIdentityServerClientFactory, IdentityServerClientFactory>();
     serviceCollection.AddSingleton <IUmaConfigurationService>(new DefaultUmaConfigurationService(umaConfigurationOptions));
     serviceCollection.AddSingleton <IPolicyRepository>(new DefaultPolicyRepository(policies));
     serviceCollection.AddSingleton <IResourceSetRepository>(new DefaultResourceSetRepository(resources));
     serviceCollection.AddSingleton <ITicketStore, DefaultTicketStore>();
     serviceCollection.AddSingleton <IPendingRequestRepository, DefaultPendingRequestRepository>();
 }
Exemplo n.º 2
0
 public static IServiceCollection AddSimpleIdServerUmaCore(this IServiceCollection serviceCollection, UmaConfigurationOptions umaConfigurationOptions = null, ICollection <ResourceSet> resources = null, ICollection <Policy> policies = null, ICollection <SharedLink> sharedLinks = null)
 {
     RegisterDependencies(serviceCollection, umaConfigurationOptions, resources, policies);
     return(serviceCollection);
 }