Package org.opensaml.xacml.ctx

Examples of org.opensaml.xacml.ctx.RequestType


        MessageImpl msg = new MessageImpl();
        String resourceURL = "/doubleit";
        msg.put(Message.REQUEST_URI, resourceURL);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        List<ResourceType> resources = request.getResources();
        assertNotNull(resources);
        assertEquals(1, resources.size());
       
        ResourceType resource = resources.get(0);
        assertEquals(1, resource.getAttributes().size());
View Full Code Here


        String resourceURI = "/doubleit";
        msg.put(Message.REQUEST_URI, resourceURI);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        ((DefaultXACMLRequestBuilder)builder).setSendFullRequestURL(true);
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        List<ResourceType> resources = request.getResources();
        assertNotNull(resources);
        assertEquals(1, resources.size());
       
        ResourceType resource = resources.get(0);
        assertEquals(1, resource.getAttributes().size());
View Full Code Here

     * Perform a (remote) authorization decision and return a boolean depending on the result
     */
    protected boolean authorize(
        Principal principal, List<String> roles, Message message
    ) throws Exception {
        RequestType request = requestBuilder.createRequest(principal, roles, message);
        if (LOG.isLoggable(Level.FINE)) {
            Document doc = DOMUtils.createDocument();
            Element requestElement = OpenSAMLUtil.toDom(request, doc);
            LOG.log(Level.FINE, DOM2Writer.nodeToString(requestElement));
        }
View Full Code Here

        attributes.clear();
        attributes.add(actionAttribute);
        ActionType action = RequestComponentBuilder.createActionType(attributes);
       
        // Request
        RequestType request =
            RequestComponentBuilder.createRequestType(
                    Collections.singletonList(subject),
                    Collections.singletonList(resource),
                    action,
                    null
View Full Code Here

* request, otherwise it denies it.
*/
public class DummyPDP implements PolicyDecisionPoint {

    public Source evaluate(Source requestSource) {
        RequestType request = requestSourceToRequestType(requestSource);
        String role = getSubjectRole(request);
        DECISION decision = "manager".equals(role) ? DecisionType.DECISION.Permit : DecisionType.DECISION.Deny;       
        ResponseType response = createResponse(decision);
        return responseType2Source(response);
    }
View Full Code Here

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURL = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URI, resourceURL);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
    }
View Full Code Here

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURL = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URI, resourceURL);
       
        DefaultXACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        String action =
            request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
        assertEquals("execute", action);
       
        builder.setAction("write");
        request = builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        action =
            request.getAction().getAttributes().get(0).getAttributeValues().get(0).getValue();
        assertEquals("write", action);
    }
View Full Code Here

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURL = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URL, resourceURL);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
        assertFalse(request.getEnvironment().getAttributes().isEmpty());
       
        ((DefaultXACMLRequestBuilder)builder).setSendDateTime(false);
        request = builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
        assertTrue(request.getEnvironment().getAttributes().isEmpty());
    }
View Full Code Here

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURL = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URL, resourceURL);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        List<ResourceType> resources = request.getResources();
        assertNotNull(resources);
        assertEquals(1, resources.size());
       
        ResourceType resource = resources.get(0);
        assertEquals(4, resource.getAttributes().size());
View Full Code Here

        msg.put(Message.WSDL_SERVICE, QName.valueOf(service));
        String resourceURL = "https://localhost:8080/doubleit";
        msg.put(Message.REQUEST_URL, resourceURL);
       
        XACMLRequestBuilder builder = new DefaultXACMLRequestBuilder();
        RequestType request =
            builder.createRequest(principal, Collections.singletonList("manager"), msg);
        assertNotNull(request);
       
        List<ResourceType> resources = request.getResources();
        assertNotNull(resources);
        assertEquals(1, resources.size());
       
        ResourceType resource = resources.get(0);
        assertEquals(4, resource.getAttributes().size());
View Full Code Here

TOP

Related Classes of org.opensaml.xacml.ctx.RequestType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.