private void InitializeFakeObjects()
 {
     _httpClientFactoryStub = new Mock<IHttpClientFactory>();
     _policyClient = new PolicyClient(new AddPolicyOperation(_httpClientFactoryStub.Object),
         new GetPolicyOperation(_httpClientFactoryStub.Object),
         new DeletePolicyOperation(_httpClientFactoryStub.Object),
         new GetPoliciesOperation(_httpClientFactoryStub.Object),
         new AddResourceToPolicyOperation(_httpClientFactoryStub.Object),
         new DeleteResourceFromPolicyOperation(_httpClientFactoryStub.Object),
         new UpdatePolicyOperation(_httpClientFactoryStub.Object),
         new GetConfigurationOperation(_httpClientFactoryStub.Object));
     _resourceSetClient = new ResourceSetClient(new AddResourceSetOperation(_httpClientFactoryStub.Object),
         new DeleteResourceSetOperation(_httpClientFactoryStub.Object),
         new GetResourcesOperation(_httpClientFactoryStub.Object),
         new GetResourceOperation(_httpClientFactoryStub.Object),
         new UpdateResourceOperation(_httpClientFactoryStub.Object),
         new GetConfigurationOperation(_httpClientFactoryStub.Object));
     _authorizationClient = new AuthorizationClient(new GetAuthorizationOperation(_httpClientFactoryStub.Object),
         new GetConfigurationOperation(_httpClientFactoryStub.Object));
     _permissionClient = new PermissionClient(
         new AddPermissionsOperation(_httpClientFactoryStub.Object),
         new GetConfigurationOperation(_httpClientFactoryStub.Object));
     _introspectionClient = new IntrospectionClient(
         new GetIntrospectionAction(_httpClientFactoryStub.Object),
         new GetIntrospectionsAction(_httpClientFactoryStub.Object),
         new GetConfigurationOperation(_httpClientFactoryStub.Object));
 }
 private void InitializeFakeObjects()
 {
     _httpClientFactoryStub = new Mock <IHttpClientFactory>();
     _resourceSetClient     = new ResourceSetClient(new AddResourceSetOperation(_httpClientFactoryStub.Object),
                                                    new DeleteResourceSetOperation(_httpClientFactoryStub.Object),
                                                    new GetResourcesOperation(_httpClientFactoryStub.Object),
                                                    new GetResourceOperation(_httpClientFactoryStub.Object),
                                                    new UpdateResourceOperation(_httpClientFactoryStub.Object),
                                                    new GetConfigurationOperation(_httpClientFactoryStub.Object));
 }
        private void InitializeFakeObjects()
        {
            var services = new ServiceCollection();

            services.AddSimpleIdentityServerJwt();
            var provider = services.BuildServiceProvider();

            _httpClientFactoryStub = new Mock <IHttpClientFactory>();
            _resourceSetClient     = new ResourceSetClient(new AddResourceSetOperation(_httpClientFactoryStub.Object),
                                                           new DeleteResourceSetOperation(_httpClientFactoryStub.Object),
                                                           new GetResourcesOperation(_httpClientFactoryStub.Object),
                                                           new GetResourceOperation(_httpClientFactoryStub.Object),
                                                           new UpdateResourceOperation(_httpClientFactoryStub.Object),
                                                           new GetConfigurationOperation(_httpClientFactoryStub.Object),
                                                           new SearchResourcesOperation(_httpClientFactoryStub.Object));
        }
Exemple #4
0
 private void InitializeFakeObjects()
 {
     _httpClientFactoryStub = new Mock <IHttpClientFactory>();
     _policyClient          = new PolicyClient(new AddPolicyOperation(_httpClientFactoryStub.Object),
                                               new GetPolicyOperation(_httpClientFactoryStub.Object),
                                               new DeletePolicyOperation(_httpClientFactoryStub.Object),
                                               new GetPoliciesOperation(_httpClientFactoryStub.Object),
                                               new AddResourceToPolicyOperation(_httpClientFactoryStub.Object),
                                               new DeleteResourceFromPolicyOperation(_httpClientFactoryStub.Object),
                                               new UpdatePolicyOperation(_httpClientFactoryStub.Object),
                                               new GetConfigurationOperation(_httpClientFactoryStub.Object),
                                               new SearchPoliciesOperation(_httpClientFactoryStub.Object));
     _resourceSetClient = new ResourceSetClient(new AddResourceSetOperation(_httpClientFactoryStub.Object),
                                                new DeleteResourceSetOperation(_httpClientFactoryStub.Object),
                                                new GetResourcesOperation(_httpClientFactoryStub.Object),
                                                new GetResourceOperation(_httpClientFactoryStub.Object),
                                                new UpdateResourceOperation(_httpClientFactoryStub.Object),
                                                new GetConfigurationOperation(_httpClientFactoryStub.Object),
                                                new SearchResourcesOperation(_httpClientFactoryStub.Object));
 }
        private void InitializeFakeObjects()
        {
            var services = new ServiceCollection();

            services.AddSimpleIdentityServerJwt();
            var provider = services.BuildServiceProvider();

            _jwsGenerator             = provider.GetService <IJwsGenerator>();
            _httpClientFactoryStub    = new Mock <IHttpClientFactory>();
            _umaHttpClientFactoryStub = new Mock <SimpleIdentityServer.Uma.Client.Factory.IHttpClientFactory>();
            var postTokenOperation     = new PostTokenOperation(_httpClientFactoryStub.Object);
            var getDiscoveryOperation  = new GetDiscoveryOperation(_httpClientFactoryStub.Object);
            var introspectionOperation = new IntrospectOperation(_httpClientFactoryStub.Object);
            var revokeTokenOperation   = new RevokeTokenOperation(_httpClientFactoryStub.Object);

            _clientAuthSelector = new ClientAuthSelector(
                new TokenClientFactory(postTokenOperation, getDiscoveryOperation),
                new IntrospectClientFactory(introspectionOperation, getDiscoveryOperation),
                new RevokeTokenClientFactory(revokeTokenOperation, getDiscoveryOperation));
            _resourceSetClient = new ResourceSetClient(new AddResourceSetOperation(_umaHttpClientFactoryStub.Object),
                                                       new DeleteResourceSetOperation(_umaHttpClientFactoryStub.Object),
                                                       new GetResourcesOperation(_umaHttpClientFactoryStub.Object),
                                                       new GetResourceOperation(_umaHttpClientFactoryStub.Object),
                                                       new UpdateResourceOperation(_umaHttpClientFactoryStub.Object),
                                                       new GetConfigurationOperation(_umaHttpClientFactoryStub.Object),
                                                       new SearchResourcesOperation(_umaHttpClientFactoryStub.Object));
            _permissionClient = new PermissionClient(
                new AddPermissionsOperation(_umaHttpClientFactoryStub.Object),
                new GetConfigurationOperation(_umaHttpClientFactoryStub.Object));
            _policyClient = new PolicyClient(new AddPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new GetPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new DeletePolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new GetPoliciesOperation(_umaHttpClientFactoryStub.Object),
                                             new AddResourceToPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new DeleteResourceFromPolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new UpdatePolicyOperation(_umaHttpClientFactoryStub.Object),
                                             new GetConfigurationOperation(_umaHttpClientFactoryStub.Object),
                                             new SearchPoliciesOperation(_umaHttpClientFactoryStub.Object));
        }