Search in sources :

Example 1 with DefaultServicesManager

use of org.apereo.cas.services.DefaultServicesManager in project cas by apereo.

the class Saml10SuccessResponseViewTests method setUp.

@Before
public void setUp() throws Exception {
    final List<RegisteredService> list = new ArrayList<>();
    list.add(RegisteredServiceTestUtils.getRegisteredService("https://.+"));
    final InMemoryServiceRegistry dao = new InMemoryServiceRegistry();
    dao.setRegisteredServices(list);
    final DefaultServicesManager mgmr = new DefaultServicesManager(dao);
    mgmr.load();
    this.response = new Saml10SuccessResponseView(new DefaultCasProtocolAttributeEncoder(mgmr, NoOpCipherExecutor.getInstance()), mgmr, "attribute", new Saml10ObjectBuilder(configBean), new DefaultArgumentExtractor(new SamlServiceFactory()), StandardCharsets.UTF_8.name(), 1000, "testIssuer", "whatever");
}
Also used : RegisteredService(org.apereo.cas.services.RegisteredService) DefaultArgumentExtractor(org.apereo.cas.web.support.DefaultArgumentExtractor) SamlServiceFactory(org.apereo.cas.support.saml.authentication.principal.SamlServiceFactory) ArrayList(java.util.ArrayList) DefaultCasProtocolAttributeEncoder(org.apereo.cas.authentication.support.DefaultCasProtocolAttributeEncoder) DefaultServicesManager(org.apereo.cas.services.DefaultServicesManager) Saml10ObjectBuilder(org.apereo.cas.support.saml.util.Saml10ObjectBuilder) InMemoryServiceRegistry(org.apereo.cas.services.InMemoryServiceRegistry) Before(org.junit.Before)

Example 2 with DefaultServicesManager

use of org.apereo.cas.services.DefaultServicesManager in project cas by apereo.

the class ServiceThemeResolverTests method setUp.

@Before
public void setUp() throws Exception {
    this.servicesManager = new DefaultServicesManager(new InMemoryServiceRegistry());
    mobileBrowsers = new HashMap<>();
    mobileBrowsers.put(MOZILLA, "theme");
    this.serviceThemeResolver = new ServiceThemeResolver(DEFAULT_THEME_NAME, servicesManager, mobileBrowsers);
}
Also used : DefaultServicesManager(org.apereo.cas.services.DefaultServicesManager) InMemoryServiceRegistry(org.apereo.cas.services.InMemoryServiceRegistry) Before(org.junit.Before)

Example 3 with DefaultServicesManager

use of org.apereo.cas.services.DefaultServicesManager in project cas by apereo.

the class RegisteredServiceSimpleFormControllerTests method setUp.

@Before
public void setUp() throws Exception {
    final Map<String, List<Object>> attributes = new HashMap<>();
    attributes.put(TEST_ID, Arrays.asList(new Object[] { TEST_ID }));
    this.repository = new StubPersonAttributeDao();
    this.repository.setBackingMap(attributes);
    this.registeredServiceFactory = new DefaultRegisteredServiceFactory(new DefaultAccessStrategyMapper(), policyMapper, new DefaultProxyPolicyMapper(), new DefaultRegisteredServiceMapper(), new DefaultUsernameAttributeProviderMapper(), Collections.singletonList(new AttributeFormDataPopulator(this.repository)));
    this.manager = new DefaultServicesManager(new InMemoryServiceRegistry());
    this.controller = new RegisteredServiceSimpleFormController(this.manager, this.registeredServiceFactory);
}
Also used : HashMap(java.util.HashMap) DefaultAccessStrategyMapper(org.apereo.cas.mgmt.services.web.factory.DefaultAccessStrategyMapper) DefaultProxyPolicyMapper(org.apereo.cas.mgmt.services.web.factory.DefaultProxyPolicyMapper) DefaultRegisteredServiceMapper(org.apereo.cas.mgmt.services.web.factory.DefaultRegisteredServiceMapper) InMemoryServiceRegistry(org.apereo.cas.services.InMemoryServiceRegistry) RegisteredServiceSimpleFormController(org.apereo.cas.mgmt.services.web.RegisteredServiceSimpleFormController) List(java.util.List) DefaultRegisteredServiceFactory(org.apereo.cas.mgmt.services.web.factory.DefaultRegisteredServiceFactory) DefaultServicesManager(org.apereo.cas.services.DefaultServicesManager) DefaultUsernameAttributeProviderMapper(org.apereo.cas.mgmt.services.web.factory.DefaultUsernameAttributeProviderMapper) StubPersonAttributeDao(org.apereo.services.persondir.support.StubPersonAttributeDao) AttributeFormDataPopulator(org.apereo.cas.mgmt.services.web.factory.AttributeFormDataPopulator) Before(org.junit.Before)

Example 4 with DefaultServicesManager

use of org.apereo.cas.services.DefaultServicesManager in project cas by apereo.

the class ManageRegisteredServicesMultiActionControllerTests method setUp.

@Before
public void setUp() throws Exception {
    this.servicesManager = new DefaultServicesManager(new InMemoryServiceRegistry());
    this.registeredServiceFactory = new DefaultRegisteredServiceFactory(new DefaultAccessStrategyMapper(), policyMapper, new DefaultProxyPolicyMapper(), new DefaultRegisteredServiceMapper(), new DefaultUsernameAttributeProviderMapper(), Collections.emptyList());
    this.controller = new ManageRegisteredServicesMultiActionController(this.servicesManager, this.registeredServiceFactory, new WebApplicationServiceFactory(), "https://cas.example.org");
}
Also used : WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) DefaultAccessStrategyMapper(org.apereo.cas.mgmt.services.web.factory.DefaultAccessStrategyMapper) DefaultServicesManager(org.apereo.cas.services.DefaultServicesManager) DefaultRegisteredServiceFactory(org.apereo.cas.mgmt.services.web.factory.DefaultRegisteredServiceFactory) DefaultProxyPolicyMapper(org.apereo.cas.mgmt.services.web.factory.DefaultProxyPolicyMapper) DefaultRegisteredServiceMapper(org.apereo.cas.mgmt.services.web.factory.DefaultRegisteredServiceMapper) DefaultUsernameAttributeProviderMapper(org.apereo.cas.mgmt.services.web.factory.DefaultUsernameAttributeProviderMapper) ManageRegisteredServicesMultiActionController(org.apereo.cas.mgmt.services.web.ManageRegisteredServicesMultiActionController) InMemoryServiceRegistry(org.apereo.cas.services.InMemoryServiceRegistry) Before(org.junit.Before)

Example 5 with DefaultServicesManager

use of org.apereo.cas.services.DefaultServicesManager in project cas by apereo.

the class SamlRegisteredServiceTests method checkPattern.

@Test
public void checkPattern() {
    final SamlRegisteredService service = new SamlRegisteredService();
    service.setName(SAML_SERVICE);
    service.setServiceId("^http://.+");
    service.setMetadataLocation(METADATA_LOCATION);
    final InMemoryServiceRegistry dao = new InMemoryServiceRegistry();
    dao.setRegisteredServices(Collections.singletonList(service));
    final DefaultServicesManager impl = new DefaultServicesManager(dao);
    impl.load();
    final RegisteredService s = impl.findServiceBy(new WebApplicationServiceFactory().createService("http://mmoayyed.unicon.net:8081/sp/saml/SSO"));
    assertNotNull(s);
}
Also used : RegisteredService(org.apereo.cas.services.RegisteredService) SamlRegisteredService(org.apereo.cas.support.saml.services.SamlRegisteredService) SamlRegisteredService(org.apereo.cas.support.saml.services.SamlRegisteredService) WebApplicationServiceFactory(org.apereo.cas.authentication.principal.WebApplicationServiceFactory) DefaultServicesManager(org.apereo.cas.services.DefaultServicesManager) InMemoryServiceRegistry(org.apereo.cas.services.InMemoryServiceRegistry) Test(org.junit.Test)

Aggregations

DefaultServicesManager (org.apereo.cas.services.DefaultServicesManager)6 InMemoryServiceRegistry (org.apereo.cas.services.InMemoryServiceRegistry)6 Before (org.junit.Before)5 WebApplicationServiceFactory (org.apereo.cas.authentication.principal.WebApplicationServiceFactory)2 DefaultAccessStrategyMapper (org.apereo.cas.mgmt.services.web.factory.DefaultAccessStrategyMapper)2 DefaultProxyPolicyMapper (org.apereo.cas.mgmt.services.web.factory.DefaultProxyPolicyMapper)2 DefaultRegisteredServiceFactory (org.apereo.cas.mgmt.services.web.factory.DefaultRegisteredServiceFactory)2 DefaultRegisteredServiceMapper (org.apereo.cas.mgmt.services.web.factory.DefaultRegisteredServiceMapper)2 DefaultUsernameAttributeProviderMapper (org.apereo.cas.mgmt.services.web.factory.DefaultUsernameAttributeProviderMapper)2 RegisteredService (org.apereo.cas.services.RegisteredService)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 DefaultCasProtocolAttributeEncoder (org.apereo.cas.authentication.support.DefaultCasProtocolAttributeEncoder)1 ManageRegisteredServicesMultiActionController (org.apereo.cas.mgmt.services.web.ManageRegisteredServicesMultiActionController)1 RegisteredServiceSimpleFormController (org.apereo.cas.mgmt.services.web.RegisteredServiceSimpleFormController)1 AttributeFormDataPopulator (org.apereo.cas.mgmt.services.web.factory.AttributeFormDataPopulator)1 SamlServiceFactory (org.apereo.cas.support.saml.authentication.principal.SamlServiceFactory)1 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)1 Saml10ObjectBuilder (org.apereo.cas.support.saml.util.Saml10ObjectBuilder)1