本文整理汇总了Java中org.jasig.cas.services.RegexRegisteredService类的典型用法代码示例。如果您正苦于以下问题:Java RegexRegisteredService类的具体用法?Java RegexRegisteredService怎么用?Java RegexRegisteredService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegexRegisteredService类属于org.jasig.cas.services包,在下文中一共展示了RegexRegisteredService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getRegexRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
private static RegisteredService getRegexRegisteredService() {
final AbstractRegisteredService rs = new RegexRegisteredService();
rs.setName("Service Name Regex");
rs.setProxyPolicy(new RefuseRegisteredServiceProxyPolicy());
rs.setUsernameAttributeProvider(new AnonymousRegisteredServiceUsernameAttributeProvider(
new ShibbolethCompatiblePersistentIdGenerator("hello")
));
rs.setDescription("Service description");
rs.setServiceId("^http?://.+");
rs.setTheme("the theme name");
rs.setEvaluationOrder(123);
rs.setDescription("Here is another description");
rs.setRequiredHandlers(new HashSet<>(Arrays.asList("handler1", "handler2")));
final Map<String, RegisteredServiceProperty> propertyMap = new HashMap();
final DefaultRegisteredServiceProperty property = new DefaultRegisteredServiceProperty();
final Set<String> values = new HashSet<>();
values.add("value1");
values.add("value2");
property.setValues(values);
propertyMap.put("field1", property);
rs.setProperties(propertyMap);
return rs;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:27,代码来源:LdapServiceRegistryDaoTests.java
示例2: ensureDefaultServiceExists
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
/**
* Ensure default service exists.
*/
private void ensureDefaultServiceExists() {
this.servicesManager.reload();
final Collection<RegisteredService> c = this.servicesManager.getAllServices();
if (c == null) {
throw new IllegalStateException("Services cannot be empty");
}
if (!this.servicesManager.matchesExistingService(defaultService)) {
final RegexRegisteredService svc = new RegexRegisteredService();
svc.setServiceId('^' + defaultService.getId());
svc.setName("Services Management Web Application");
svc.setDescription(svc.getName());
this.servicesManager.save(svc);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:19,代码来源:ManageRegisteredServicesMultiActionController.java
示例3: verifyAddRegisteredServiceWithValues
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void verifyAddRegisteredServiceWithValues() throws Exception {
final RegisteredServiceImpl svc = new RegisteredServiceImpl();
svc.setDescription("description");
svc.setServiceId("serviceId");
svc.setName("name");
svc.setEvaluationOrder(123);
assertTrue(this.manager.getAllServices().isEmpty());
final RegisteredServiceEditBean.ServiceData data = registeredServiceFactory.createServiceData(svc);
this.controller.saveService(new MockHttpServletRequest(),
new MockHttpServletResponse(),
data, mock(BindingResult.class));
final Collection<RegisteredService> services = this.manager.getAllServices();
assertEquals(1, services.size());
for(final RegisteredService rs : this.manager.getAllServices()) {
assertTrue(rs instanceof RegexRegisteredService);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例4: verifyAddRegexRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void verifyAddRegexRegisteredService() throws Exception {
final RegexRegisteredService svc = new RegexRegisteredService();
svc.setDescription("description");
svc.setServiceId("^serviceId");
svc.setName("name");
svc.setId(1000);
svc.setEvaluationOrder(1000);
final RegisteredServiceEditBean.ServiceData data = registeredServiceFactory.createServiceData(svc);
this.controller.saveService(new MockHttpServletRequest(),
new MockHttpServletResponse(),
data, mock(BindingResult.class));
final Collection<RegisteredService> services = this.manager.getAllServices();
assertEquals(1, services.size());
for(final RegisteredService rs : this.manager.getAllServices()) {
assertTrue(rs instanceof RegexRegisteredService);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例5: read
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Override
public RegisteredService read(final Kryo kryo, final Input input, final Class<RegisteredService> type) {
final AbstractRegisteredService svc = new RegexRegisteredService();
svc.setServiceId(kryo.readObject(input, String.class));
svc.setName(kryo.readObject(input, String.class));
svc.setDescription(kryo.readObject(input, String.class));
svc.setId(kryo.readObject(input, Long.class));
svc.setEvaluationOrder(kryo.readObject(input, Integer.class));
svc.setLogo(kryo.readObject(input, URL.class));
svc.setLogoutType(kryo.readObject(input, LogoutType.class));
svc.setLogoutUrl(kryo.readObject(input, URL.class));
svc.setRequiredHandlers(kryo.readObject(input, ImmutableSet.class));
svc.setTheme(kryo.readObject(input, String.class));
svc.setPublicKey(readObjectByReflection(kryo, input, RegisteredServicePublicKey.class));
svc.setProxyPolicy(readObjectByReflection(kryo, input, RegisteredServiceProxyPolicy.class));
svc.setAttributeReleasePolicy(readObjectByReflection(kryo, input, RegisteredServiceAttributeReleasePolicy.class));
svc.setUsernameAttributeProvider(readObjectByReflection(kryo, input, RegisteredServiceUsernameAttributeProvider.class));
svc.setAccessStrategy(readObjectByReflection(kryo, input, RegisteredServiceAccessStrategy.class));
return svc;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:23,代码来源:RegisteredServiceSerializer.java
示例6: verifyAddRegisteredServiceWithValues
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void verifyAddRegisteredServiceWithValues() throws Exception {
final RegisteredServiceImpl svc = new RegisteredServiceImpl();
svc.setDescription("description");
svc.setServiceId("serviceId");
svc.setName("name");
svc.setEvaluationOrder(123);
assertTrue(this.manager.getAllServices().isEmpty());
final RegisteredServiceEditBean data = RegisteredServiceEditBean.fromRegisteredService(svc);
this.controller.saveService(new MockHttpServletRequest(),
new MockHttpServletResponse(),
data.getServiceData(), mock(BindingResult.class));
final Collection<RegisteredService> services = this.manager.getAllServices();
assertEquals(1, services.size());
for(final RegisteredService rs : this.manager.getAllServices()) {
assertTrue(rs instanceof RegexRegisteredService);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例7: verifyAddRegexRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void verifyAddRegexRegisteredService() throws Exception {
final RegexRegisteredService svc = new RegexRegisteredService();
svc.setDescription("description");
svc.setServiceId("^serviceId");
svc.setName("name");
svc.setId(1000);
svc.setEvaluationOrder(1000);
final RegisteredServiceEditBean data = RegisteredServiceEditBean.fromRegisteredService(svc);
this.controller.saveService(new MockHttpServletRequest(),
new MockHttpServletResponse(),
data.getServiceData(), mock(BindingResult.class));
final Collection<RegisteredService> services = this.manager.getAllServices();
assertEquals(1, services.size());
for(final RegisteredService rs : this.manager.getAllServices()) {
assertTrue(rs instanceof RegexRegisteredService);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例8: verifyAddMockRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void verifyAddMockRegisteredService() throws Exception {
final RegexRegisteredService svc = new RegexRegisteredService();
svc.setDescription("description");
svc.setServiceId("^serviceId");
svc.setName("name");
svc.setId(1000);
svc.setEvaluationOrder(1000);
final RegisteredServiceEditBean data = RegisteredServiceEditBean.fromRegisteredService(svc);
this.controller.saveService(new MockHttpServletRequest(),
new MockHttpServletResponse(),
data.getServiceData(), mock(BindingResult.class));
final Collection<RegisteredService> services = this.manager.getAllServices();
assertEquals(1, services.size());
for (final RegisteredService rs : this.manager.getAllServices()) {
assertTrue(rs instanceof RegisteredService);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例9: verifyEditMockRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void verifyEditMockRegisteredService() throws Exception {
final RegexRegisteredService r = new RegexRegisteredService();
r.setId(1000);
r.setName("Test Service");
r.setServiceId("test");
r.setDescription("description");
this.manager.save(r);
r.setServiceId("serviceId1");
//this.controller.onSubmit(r, mock(BindingResult.class), new ModelMap(), new MockHttpServletRequest());
assertFalse(this.manager.getAllServices().isEmpty());
final RegisteredService r2 = this.manager.findServiceBy(1000);
assertEquals("serviceId1", r2.getServiceId());
assertTrue(r2 instanceof RegexRegisteredService);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:20,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例10: read
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Override
public RegisteredService read(final Kryo kryo, final Input input, final Class<RegisteredService> type) {
final AbstractRegisteredService svc = new RegexRegisteredService();
svc.setServiceId(kryo.readObject(input, String.class));
svc.setName(kryo.readObject(input, String.class));
svc.setDescription(kryo.readObject(input, String.class));
svc.setId(kryo.readObject(input, Long.class));
svc.setEvaluationOrder(kryo.readObject(input, Integer.class));
svc.setLogo(kryo.readObject(input, URL.class));
svc.setLogoutType(kryo.readObject(input, LogoutType.class));
svc.setLogoutUrl(kryo.readObject(input, URL.class));
svc.setRequiredHandlers(kryo.readObject(input, ImmutableSet.class));
svc.setTheme(kryo.readObject(input, String.class));
svc.setPublicKey(readObjectByReflection(kryo, input, RegisteredServicePublicKey.class));
svc.setProxyPolicy(readObjectByReflection(kryo, input, RegisteredServiceProxyPolicy.class));
svc.setAttributeReleasePolicy(readObjectByReflection(kryo, input, AttributeReleasePolicy.class));
svc.setUsernameAttributeProvider(readObjectByReflection(kryo, input, RegisteredServiceUsernameAttributeProvider.class));
svc.setAccessStrategy(readObjectByReflection(kryo, input, RegisteredServiceAccessStrategy.class));
return svc;
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:23,代码来源:RegisteredServiceSerializer.java
示例11: getRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
public RegisteredService getRegisteredService() {
if (StringUtils.isBlank(serviceId) || StringUtils.isBlank(name)
|| StringUtils.isBlank(description)) {
throw new IllegalArgumentException("Service name/description/id is missing");
}
final RegexRegisteredService service = new RegexRegisteredService();
service.setServiceId(serviceId);
service.setDescription(description);
service.setName(name);
service.setEvaluationOrder(evaluationOrder);
service.setAccessStrategy(
new DefaultRegisteredServiceAccessStrategy(enabled, ssoEnabled));
return service;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:16,代码来源:RegisteredServiceResource.java
示例12: getRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
/**
* Gets the registered service by id that would either match an ant or regex pattern.
*
* @param id the id
* @return the registered service
*/
private AbstractRegisteredService getRegisteredService(@NotNull final String id) {
if (RegexUtils.isValidRegex(id)) {
return new RegexRegisteredService();
}
if (new AntPathMatcher().isPattern(id)) {
return new RegisteredServiceImpl();
}
return null;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:DefaultLdapRegisteredServiceMapper.java
示例13: determineServiceTypeByPattern
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
/**
* Determine service type by pattern.
*
* @param serviceId the service id
* @return the abstract registered service
*/
private AbstractRegisteredService determineServiceTypeByPattern(final String serviceId) {
try {
Pattern.compile(serviceId);
LOGGER.debug("Service id {} is a valid regex.", serviceId);
return new RegexRegisteredService();
} catch (final PatternSyntaxException exception) {
LOGGER.debug("Service id {} is not a valid regex. Checking ant patterns...", serviceId);
if (new AntPathMatcher().isPattern(serviceId)) {
LOGGER.debug("Service id {} is a valid ant pattern.", serviceId);
return new RegisteredServiceImpl();
}
}
throw new RuntimeException("Service id " + serviceId + " cannot be resolve to a service type");
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:DefaultRegisteredServiceMapper.java
示例14: getRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
public static AbstractRegisteredService getRegisteredService(final String id) {
try {
final RegexRegisteredService s = new RegexRegisteredService();
s.setServiceId(id);
s.setEvaluationOrder(1);
s.setName("Test registered service");
s.setDescription("Registered service description");
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^https?://.+"));
s.setId(new SecureRandom().nextInt(Math.abs(s.hashCode())));
s.setTheme("exampleTheme");
s.setUsernameAttributeProvider(new PrincipalAttributeRegisteredServiceUsernameProvider("uid"));
final DefaultRegisteredServiceAccessStrategy accessStrategy =
new DefaultRegisteredServiceAccessStrategy(true, true);
accessStrategy.setRequireAllAttributes(true);
accessStrategy.setRequiredAttributes(getTestAttributes());
s.setAccessStrategy(accessStrategy);
s.setLogo(new URL("https://logo.example.org/logo.png"));
s.setLogoutType(LogoutType.BACK_CHANNEL);
s.setLogoutUrl(new URL("https://sys.example.org/logout.png"));
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^http.+"));
s.setPublicKey(new RegisteredServicePublicKeyImpl("classpath:pub.key", "RSA"));
final ReturnAllowedAttributeReleasePolicy policy = new ReturnAllowedAttributeReleasePolicy();
policy.setAuthorizedToReleaseCredentialPassword(true);
policy.setAuthorizedToReleaseProxyGrantingTicket(true);
final CachingPrincipalAttributesRepository repo =
new CachingPrincipalAttributesRepository(new StubPersonAttributeDao(), 10);
repo.setMergingStrategy(new NoncollidingAttributeAdder());
policy.setPrincipalAttributesRepository(repo);
policy.setAttributeFilter(new RegisteredServiceRegexAttributeFilter("https://.+"));
policy.setAllowedAttributes(new ArrayList(getTestAttributes().keySet()));
s.setAttributeReleasePolicy(policy);
return s;
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:41,代码来源:TestUtils.java
示例15: getRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
/**
* Gets the registered service by id that would either match an ant or regex pattern.
*
* @param id the id
* @return the registered service
*/
private AbstractRegisteredService getRegisteredService(@NotNull final String id) {
if (isValidRegexPattern(id)) {
return new RegexRegisteredService();
}
if (new AntPathMatcher().isPattern(id)) {
return new RegisteredServiceImpl();
}
return null;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:DefaultLdapRegisteredServiceMapper.java
示例16: getRegexRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
private RegisteredService getRegexRegisteredService() {
final AbstractRegisteredService rs = new RegexRegisteredService();
rs.setName("Service Name Regex");
rs.setProxyPolicy(new RefuseRegisteredServiceProxyPolicy());
rs.setUsernameAttributeProvider(new AnonymousRegisteredServiceUsernameAttributeProvider());
rs.setDescription("Service description");
rs.setServiceId("^http?://.+");
rs.setTheme("the theme name");
rs.setEvaluationOrder(123);
rs.setDescription("Here is another description");
rs.setRequiredHandlers(new HashSet<String>(Arrays.asList("handler1", "handler2")));
return rs;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:14,代码来源:LdapServiceRegistryDaoTests.java
示例17: ensureDefaultServiceExists
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
/**
* Ensure default service exists.
*/
private void ensureDefaultServiceExists() {
final Collection<RegisteredService> c = this.servicesManager.getAllServices();
if (c == null) {
throw new IllegalStateException("Services cannot be empty");
}
if (!this.servicesManager.matchesExistingService(defaultService)) {
final RegexRegisteredService svc = new RegexRegisteredService();
svc.setServiceId('^' + defaultService.getId());
svc.setName("Services Management Web Application");
svc.setDescription(svc.getName());
this.servicesManager.save(svc);
}
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:ManageRegisteredServicesMultiActionController.java
示例18: getRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
private AbstractRegisteredService getRegisteredService(@NotNull final String id) {
if (isValidRegexPattern(id)) {
return new RegexRegisteredService();
}
if (new AntPathMatcher().isPattern(id)) {
return new RegisteredServiceImpl();
}
return null;
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:11,代码来源:DefaultLdapServiceMapper.java
示例19: testAddRegexRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
@Test
public void testAddRegexRegisteredService() throws Exception {
final MockHttpServletRequest request = new MockHttpServletRequest();
final MockHttpServletResponse response = new MockHttpServletResponse();
request.addParameter("description", "description");
request.addParameter("serviceId", "^https://.*");
request.addParameter("name", "name");
request.addParameter("theme", "theme");
request.addParameter("allowedToProxy", "true");
request.addParameter("enabled", "true");
request.addParameter("ssoEnabled", "true");
request.addParameter("anonymousAccess", "false");
request.addParameter("evaluationOrder", "1");
request.setMethod("POST");
assertTrue(this.manager.getAllServices().isEmpty());
this.controller.handleRequest(
request, response);
final Collection<RegisteredService> services = this.manager.getAllServices();
assertEquals(1, services.size());
for(RegisteredService rs : this.manager.getAllServices()) {
assertTrue(rs instanceof RegexRegisteredService);
}
}
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:29,代码来源:RegisteredServiceSimpleFormControllerTests.java
示例20: getRegisteredService
import org.jasig.cas.services.RegexRegisteredService; //导入依赖的package包/类
public static AbstractRegisteredService getRegisteredService(final String id) {
try {
final RegexRegisteredService s = new RegexRegisteredService();
s.setServiceId(id);
s.setEvaluationOrder(1);
s.setName("Test registered service");
s.setDescription("Registered service description");
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^https?://.+"));
s.setId(new SecureRandom().nextInt(Math.abs(s.hashCode())));
s.setTheme("exampleTheme");
s.setUsernameAttributeProvider(new PrincipalAttributeRegisteredServiceUsernameProvider("uid"));
final DefaultRegisteredServiceAccessStrategy accessStrategy =
new DefaultRegisteredServiceAccessStrategy(true, true);
accessStrategy.setRequireAllAttributes(true);
accessStrategy.setRequiredAttributes(getTestAttributes());
s.setAccessStrategy(accessStrategy);
s.setLogo(new URL("https://logo.example.org/logo.png"));
s.setLogoutType(LogoutType.BACK_CHANNEL);
s.setLogoutUrl(new URL("https://sys.example.org/logout.png"));
s.setProxyPolicy(new RegexMatchingRegisteredServiceProxyPolicy("^http.+"));
s.setPublicKey(new RegisteredServicePublicKeyImpl("classpath:pub.key", "RSA"));
final ReturnAllowedAttributeReleasePolicy policy = new ReturnAllowedAttributeReleasePolicy();
policy.setAuthorizedToReleaseCredentialPassword(true);
policy.setAuthorizedToReleaseProxyGrantingTicket(true);
final CachingPrincipalAttributesRepository repo =
new CachingPrincipalAttributesRepository(10);
repo.setMergingStrategy(CachingPrincipalAttributesRepository.MergingStrategy.ADD);
policy.setPrincipalAttributesRepository(repo);
policy.setAttributeFilter(new RegisteredServiceRegexAttributeFilter("https://.+"));
policy.setAllowedAttributes(new ArrayList(getTestAttributes().keySet()));
s.setAttributeReleasePolicy(policy);
return s;
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
开发者ID:xuchengdong,项目名称:cas4.1.9,代码行数:41,代码来源:TestUtils.java
注:本文中的org.jasig.cas.services.RegexRegisteredService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论