Examples of PDP


Examples of com.sun.xacml.PDP

        // use the default factories from the configuration
        store.useDefaultFactories();

        // get the PDP configuration's and setup the PDP
        pdp = new PDP(store.getDefaultPDPConfig());
    }
View Full Code Here

Examples of com.sun.xacml.PDP

            List<AttributeFinderModule> attrModules = new ArrayList<AttributeFinderModule>();
            attrModules.add(envModule);
            attrModules.add(selectorModule);
            attrFinder.setModules(attrModules);

            pdp = new PDP(new PDPConfig(attrFinder, policyFinder, null));
            XACMLUtil.getXACMLLogger().info("GeoXACML repository loaded ");
            return pdp;
        }
    }
View Full Code Here

Examples of com.sun.xacml.PDP

    @Override
    protected ModelAndView handleRequestInternal(HttpServletRequest req, HttpServletResponse resp)
            throws Exception {

        PDP pdp = GeoXACMLConfig.getPDP();
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setIgnoringComments(true);
        factory.setIgnoringElementContentWhitespace(true);
        factory.setNamespaceAware(true);

        String booleanString = req.getParameter("validate");
        Boolean validate = new Boolean(booleanString);

        if (validate) {
            factory.setSchema(GeoXACML.getContextSchema());
            logger.info("Request validation enabled");
        }

        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(req.getInputStream());

        RequestCtx request = RequestCtx.getInstance(doc.getDocumentElement());
        ResponseCtx response = pdp.evaluate(request);

        response.encode(resp.getOutputStream(), new Indenter(0), true);
        return null;
    }
View Full Code Here

Examples of com.sun.xacml.PDP

        // ...and add the module used by the tests
        policyModules.add(policyModule);
        finder.setModules(policyModules);

        // finally, setup the PDP
        pdp = new PDP(config);
    }
View Full Code Here

Examples of com.sun.xacml.PDP

        TestSupport.initOutputDir();
    }

    public void testXACMTransportSingleRequest() {

        PDP pdp = TestSupport
                .getPDP(TestSupport.getGeoXACMLFNFor("wildcard", "WildCardPolicy.xml"));

        RequestCtx request = null;
        try {
            request = RequestCtx.getInstance(new FileInputStream(TestSupport.getGeoXACMLFNFor(
View Full Code Here

Examples of com.sun.xacml.PDP

    }

    public void testXACMLTransportMultipleRequestsSerial() {

        PDP pdp = TestSupport
                .getPDP(TestSupport.getGeoXACMLFNFor("wildcard", "WildCardPolicy.xml"));
        XACMLTransport transport = new XACMLLocalTransportFactory(pdp, false).getXACMLTransport();
        List<RequestCtx> requestList = createRequestList();
        List<ResponseCtx> responseList = transport.evaluateRequestCtxList(requestList);
        checkResponseList(responseList);
View Full Code Here

Examples of com.sun.xacml.PDP

    }

    public void testXACMLTransportMultipleRequestsMultiThreaded() {

        PDP pdp = TestSupport
                .getPDP(TestSupport.getGeoXACMLFNFor("wildcard", "WildCardPolicy.xml"));
        XACMLTransport transport = new XACMLLocalTransportFactory(pdp, true).getXACMLTransport();
        List<RequestCtx> requestList = createRequestList();
        List<ResponseCtx> responseList = transport.evaluateRequestCtxList(requestList);
        checkResponseList(responseList);
View Full Code Here

Examples of com.sun.xacml.PDP

        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }

    public void testOverlaps1() {

        PDP pdp = TestSupport
                .getPDP(TestSupport.getGeoXACMLFNFor("topology", "OverlapsPolicy.xml"));

        RequestCtx request = null;
        try {
            request = RequestCtx.getInstance(new FileInputStream(TestSupport.getGeoXACMLFNFor(
                    "topology", "OverlapsRequest1.xml")));
        } catch (Exception e) {
            e.printStackTrace();
            Assert.fail(e.getMessage());
        }

        ResponseCtx response = pdp.evaluate(request);
        Result result = (Result) response.getResults().iterator().next();
        assertTrue(result.getDecision() == Result.DECISION_NOT_APPLICABLE);
        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }
View Full Code Here

Examples of com.sun.xacml.PDP

        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }

    public void testIntersects() {

        PDP pdp = TestSupport.getPDP(TestSupport.getGeoXACMLFNFor("topology",
                "IntersectsPolicy.xml"));

        RequestCtx request = null;
        try {
            request = RequestCtx.getInstance(new FileInputStream(TestSupport.getGeoXACMLFNFor(
                    "topology", "IntersectsRequest.xml")));
        } catch (Exception e) {
            e.printStackTrace();
            Assert.fail(e.getMessage());
        }

        ResponseCtx response = pdp.evaluate(request);
        Result result = (Result) response.getResults().iterator().next();
        assertTrue(result.getDecision() == Result.DECISION_PERMIT);
        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }
View Full Code Here

Examples of com.sun.xacml.PDP

        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }

    public void testIntersects1() {

        PDP pdp = TestSupport.getPDP(TestSupport.getGeoXACMLFNFor("topology",
                "IntersectsPolicy.xml"));

        RequestCtx request = null;
        try {
            request = RequestCtx.getInstance(new FileInputStream(TestSupport.getGeoXACMLFNFor(
                    "topology", "IntersectsRequest1.xml")));
        } catch (Exception e) {
            e.printStackTrace();
            Assert.fail(e.getMessage());
        }

        ResponseCtx response = pdp.evaluate(request);
        Result result = (Result) response.getResults().iterator().next();
        assertTrue(result.getDecision() == Result.DECISION_NOT_APPLICABLE);
        assertTrue(result.getStatus().getCode().iterator().next().equals(Status.STATUS_OK));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.