Search in sources :

Example 6 with ResourceSetPolicyPermission

use of org.apereo.cas.uma.ticket.resource.ResourceSetPolicyPermission in project cas by apereo.

the class BaseUmaEndpointControllerTests method createUmaPolicyRegistrationRequest.

protected static ResourceSetPolicy createUmaPolicyRegistrationRequest(final UserProfile profile, final Collection<String> scopes) {
    val policy = new ResourceSetPolicy();
    val perm = new ResourceSetPolicyPermission();
    perm.setScopes(new HashSet<>(scopes));
    perm.setClaims(new LinkedHashMap<>(CollectionUtils.wrap("givenName", "CAS")));
    perm.setSubject(profile.getId());
    policy.setPermissions(CollectionUtils.wrapHashSet(perm));
    return policy;
}
Also used : lombok.val(lombok.val) ResourceSetPolicy(org.apereo.cas.uma.ticket.resource.ResourceSetPolicy) ResourceSetPolicyPermission(org.apereo.cas.uma.ticket.resource.ResourceSetPolicyPermission)

Aggregations

lombok.val (lombok.val)6 ResourceSetPolicy (org.apereo.cas.uma.ticket.resource.ResourceSetPolicy)6 ResourceSetPolicyPermission (org.apereo.cas.uma.ticket.resource.ResourceSetPolicyPermission)6 Test (org.junit.jupiter.api.Test)5 ResourceSet (org.apereo.cas.uma.ticket.resource.ResourceSet)2