Search in sources :

Example 1 with PdpException

use of ddf.security.pdp.realm.xacml.processor.PdpException in project ddf by codice.

the class XacmlPdp method isPermitted.

protected boolean isPermitted(RequestType xacmlRequest) {
    boolean permitted;
    ResponseType xacmlResponse;
    try {
        LOGGER.debug("Calling PDP to evaluate XACML request.");
        xacmlResponse = pdp.evaluate(xacmlRequest);
        LOGGER.debug("Received response from PDP.");
        permitted = xacmlResponse != null && xacmlResponse.getResult().get(0).getDecision() == DecisionType.PERMIT;
        LOGGER.debug("Permitted: {}", permitted);
    } catch (PdpException e) {
        LOGGER.debug(e.getMessage(), e);
        permitted = false;
    }
    return permitted;
}
Also used : ResponseType(oasis.names.tc.xacml._3_0.core.schema.wd_17.ResponseType) PdpException(ddf.security.pdp.realm.xacml.processor.PdpException)

Aggregations

PdpException (ddf.security.pdp.realm.xacml.processor.PdpException)1 ResponseType (oasis.names.tc.xacml._3_0.core.schema.wd_17.ResponseType)1