@@ -6,6 +6,25 @@ All notable changes to this project are documented in this file following the [K
- Issues reported on [OW2's JIRA](https://jira.ow2.org/browse/AUTHZFORCE/) are referenced in the form of `[JIRA-N]`, where N is the issue number.
- Issues reported on [OW2's GitLab](https://gitlab.ow2.org/authzforce/core/issues) are referenced in the form of `[GL-N]`, where N is the issue number.
@@ -68,23 +67,25 @@ public final class PdpCommandLineCallable implements Callable<Void>
/*
* WARNING: do not make picocli-annoated fields final here! Known issue: https://github.com/remkop/picocli/issues/68. Planned to be fixed in release 2.1.0.
*/
@Option(names={"-t","--type"},description="Type of XACML request/response: 'XACML_XML' for XACML 3.0/XML (XACML core specification), 'XACML_JSON' for XACML 3.0/JSON (JSON Profile of XACML 3.0)")
"--type"},description="Type of XACML request/response: 'XACML_XML' for XACML 3.0/XML (XACML core specification), 'XACML_JSON' for XACML 3.0/JSON (JSON Profile of XACML 3.0)")
@Parameters(index="0",description="Path to PDP configuration file, valid against schema located at https://github.com/authzforce/core/blob/release-X.Y.Z/pdp-engine/src/main/resources/pdp.xsd (X.Y.Z is the version provided by -v option)")
privateFileconfFile;
@Option(names={"-c","--catalog"},description="Path to XML catalog for resolving schemas used in extensions XSD specified by -e option, required only if -e specified")
privateStringcatalogLocation=null;
privatefinalStringcatalogLocation=null;
@Option(names={"-e","--extensions"},description="Path to extensions XSD (contains XSD namespace imports for all extensions used in the PDP configuration), required only if using any extension in the PDP configuration file")
privateStringextensionXsdLocation=null;
@Option(names={"-e",
"--extensions"},description="Path to extensions XSD (contains XSD namespace imports for all extensions used in the PDP configuration), required only if using any extension in the PDP configuration file")
privatefinalStringextensionXsdLocation=null;
@Parameters(index="1",description="XACML Request (format determined by -t option)")
privateFilereqFile;
@Option(names={"-p","--prettyprint"},description="Pretty-print output with line feeds and indentation")
privatebooleanformattedOutput=false;
privatefinalbooleanformattedOutput=false;
@Override
publicVoidcall()throwsException
...
...
@@ -104,17 +105,17 @@ public final class PdpCommandLineCallable implements Callable<Void>
@@ -212,9 +211,9 @@ public class JsonProfileConformanceV3Test
* policies) at the moment. If some day, JSON Profile addresses policy format too, then we should do like in ConformanceV3fromV2 class from pdp-testutils package (policy syntax validation).
@@ -239,7 +238,8 @@ public final class MongoDbRefPolicyProvider extends BaseStaticRefPolicyProvider
try
{
xacmlParser=xacmlParserFactory.getInstance();
}catch(finalJAXBExceptione)
}
catch(finalJAXBExceptione)
{
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": Failed to create JAXB unmarshaller for XACML Policy(Set)",XacmlStatusCode.PROCESSING_ERROR.value(),e);
}
...
...
@@ -252,18 +252,20 @@ public final class MongoDbRefPolicyProvider extends BaseStaticRefPolicyProvider
* TODO: support more efficient formats of XML content, e.g. gzipped XML, Fast Infoset, EXI.
*/
resultJaxbObj=xacmlParser.parse(xmlInputSrc);
}catch(finalJAXBExceptione)
}
catch(finalJAXBExceptione)
{
thrownewIndeterminateEvaluationException(
"PolicyProvider "+id+": failed to parse Policy(Set) XML document from 'content' value of the policy document "+policyPOJO+" retrieved from database",
XacmlStatusCode.PROCESSING_ERROR.value(),e);
"PolicyProvider "+id+": failed to parse Policy(Set) XML document from 'content' value of the policy document "+policyPOJO+" retrieved from database",
* TODO: use a policy cache and check it before requesting the database.
*/
...
...
@@ -279,8 +281,8 @@ public final class MongoDbRefPolicyProvider extends BaseStaticRefPolicyProvider
if(!(jaxbPolicyOrPolicySetObjinstanceofPolicy))
{
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": 'content' of the policy document "+policyPOJO
+" retrieved from database is not consistent with its 'type' (expected: Policy). Actual content type: "+jaxbPolicyOrPolicySetObj.getClass()+" (corrupted database?).",
XacmlStatusCode.PROCESSING_ERROR.value());
+" retrieved from database is not consistent with its 'type' (expected: Policy). Actual content type: "+jaxbPolicyOrPolicySetObj.getClass()+" (corrupted database?).",
@@ -288,20 +290,21 @@ public final class MongoDbRefPolicyProvider extends BaseStaticRefPolicyProvider
if(!contentPolicyId.equals(policyPOJO.getId()))
{
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": PolicyId in 'content' of the policy document "+policyPOJO
+" retrieved from database is not consistent with 'id'. Actual PolicyId: "+contentPolicyId+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
+" retrieved from database is not consistent with 'id'. Actual PolicyId: "+contentPolicyId+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": Version in 'content' of the policy document "+policyPOJO
+" retrieved from database is not consistent with 'version'. Actual Version: "+contentPolicyVersion+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
+" retrieved from database is not consistent with 'version'. Actual Version: "+contentPolicyVersion+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
* TODO: use a policy cache and check it before requesting the database. If we found a matching policy in cache, and it is a policyset, we would check the depth of policy references as well:
* <p>
...
...
@@ -327,8 +331,8 @@ public final class MongoDbRefPolicyProvider extends BaseStaticRefPolicyProvider
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": 'content' of the policy document "+policyPOJO
+" retrieved from database is not consistent with 'type' (expected: PolicySet). Actual content type: "+jaxbPolicyOrPolicySetObj.getClass()+" (corrupted database?).",
XacmlStatusCode.PROCESSING_ERROR.value());
+" retrieved from database is not consistent with 'type' (expected: PolicySet). Actual content type: "+jaxbPolicyOrPolicySetObj.getClass()+" (corrupted database?).",
@@ -336,20 +340,21 @@ public final class MongoDbRefPolicyProvider extends BaseStaticRefPolicyProvider
if(!contentPolicyId.equals(policyPOJO.getId()))
{
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": PolicyId in 'content' of the policy document "+policyPOJO
+" retrieved from database is not consistent with 'id'. Actual PolicyId: "+contentPolicyId+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
+" retrieved from database is not consistent with 'id'. Actual PolicyId: "+contentPolicyId+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
thrownewIndeterminateEvaluationException("PolicyProvider "+id+": Version in 'content' of the policy document "+policyPOJO
+" retrieved from database is not consistent with 'version'. Actual Version: "+contentPolicyVersion+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
+" retrieved from database is not consistent with 'version'. Actual Version: "+contentPolicyVersion+" (corrupted database?).",XacmlStatusCode.PROCESSING_ERROR.value());
thrownewIndeterminateEvaluationException("Invalid PolicySet in 'content' of the policy document "+policyPOJO+" retrieved from database",XacmlStatusCode.PROCESSING_ERROR.value(),e);