- Modify the PDP configuration (XML): replace the XML namespace `http://authzforce.github.io/core/xmlns/pdp/7.0` with `http://authzforce.github.io/core/xmlns/pdp/7`.
## Migration from v13.x to v14.x
- Make sure all your custom PolicyProviders implement the new PolicyProvider interfaces, i.e. BaseStaticPolicyProvider or, as fallback option, CloseableStaticPolicyProvider
*`pdp.xml`: PDP configuration file, that defines the location(s) of XACML policy(ies), among other PDP engine parameters; the content of this file is a XML document compliant with the PDP configuration [XML schema](pdp-engine/src/main/resources/pdp.xsd), so you can read the documentation of every configuration parameter in that schema file;**Feel free to change the policy location to point to your own for testing.**
*`pdp.xml`: PDP configuration file in XML format, that defines the location(s) of XACML policy(ies) and more; for more information about PDP configuration parameters, the configuration format is fully specified and documented in the [XML schema `pdp.xsd`](pdp-engine/src/main/resources/pdp.xsd), also available in a [more user-friendly HTML form](https://authzforce.github.io/pdp.xsd/7.1).**Feel free to change the policy location to point to your own for testing.**
*`Request.xml`: XACML request in XACML 3.0/XML (core specification) format. **Feel free to replace with your own for testing.**
If you want to test the JSON Profile of XACML 3.0, run it with extra option `-t XACML_JSON`:
...
...
@@ -147,7 +147,7 @@ Since this is a Maven artifact and it requires dependencies, you should build yo
To get started using a PDP to evaluate XACML requests, the first step is to write/get a XACML 3.0 policy. Please refer to [XACML v3.0 - Core standard](http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.html) for the syntax. For a basic example, see [this one](pdp-testutils/src/test/resources/conformance/xacml-3.0-from-2.0-ct/mandatory/IIA001/IIA001Policy.xml).
Then instantiate a PDP engine configuration with method [PdpEngineConfiguration#getInstance(String)](pdp-engine/src/main/java/org/ow2/authzforce/core/pdp/impl/PdpEngineConfiguration.java#L663). The required parameter *confLocation* must be the location of the PDP configuration file. The content of such file is a XML document compliant with the PDP configuration [XML schema](pdp-engine/src/main/resources/pdp.xsd). This schema defines every configuration parameter with associated documentation. Here is a minimal example of configuration:
Then instantiate a PDP engine configuration with method [PdpEngineConfiguration#getInstance(String)](pdp-engine/src/main/java/org/ow2/authzforce/core/pdp/impl/PdpEngineConfiguration.java#L663). The required parameter *confLocation* must be the location of the PDP configuration file. For more information about PDP configuration parameters, the configuration format is fully specified and documented in the [XML schema `pdp.xsd`](pdp-engine/src/main/resources/pdp.xsd), also available in a [more user-friendly HTML form](https://authzforce.github.io/pdp.xsd/7.1). Here is a minimal example of configuration:
to replace ${property_name} placeholders with such properties.
You may use '!' as a separating character
between the placeholder
property name
and a default value that is used if the property is undefined.
E.g. ${PARENT_DIR!/home/foo/conf} will be
replaced with
'/home/foo/conf' if PARENT_DIR is undefined.
In the location, you
may use placeholders enclosed between '${' and '}' for the following properties:
- the global property 'PARENT_DIR' for defining - in a generic way - a path relative to the parent directory to the
XML file where this is used;
- Java system properties;
- System environment variables.
</p>
</documentation>
</annotation>
</element>
<elementname="pdp">
<complexType>
<sequence>
<element
name="attributeDatatype"
type="anyURI"
minOccurs="0"
maxOccurs="unbounded">
<annotation>
<documentation>
URI of an attribute datatype to be added to supported datatypes. Policies require datatypes for function arguments and AttributeAssignment expressions. For every datatype,
URI of an XACML attribute datatype to be added to supported datatypes. Policies require datatypes for function arguments and AttributeAssignment expressions. For every datatype,
there
must be one and only one Java class - say 'com.example.FooValueFactory' - on the classpath implementing interface
'org.ow2.authzforce.core.pdp.api.value.AttributeValueFactory' with zero-arg
constructor, such that this URI equals: new com.example.FooValueFactory().getId().
</documentation>
</annotation>
</element>
<element
name="function"
type="anyURI"
minOccurs="0"
maxOccurs="unbounded">
<annotation>
<documentation>
URI of a function to be added to supported functions. For every function, its return type and all its parameter types must be either standard mandatory ones enabled by
'useStandardDatatypes' attribute, or custom ones declared in previous 'attributeDatatype' elements; and there must be one and only one Java class - say
'com.example.FooFunction' - on the
classpath implementing interface 'org.ow2.authzforce.core.pdp.api.func.Function' with zero-arg constructor, such that this URI equals:
new com.example.FooFunction().getId().
</documentation>
</annotation>
</element>
<element
name="combiningAlgorithm"
type="anyURI"
minOccurs="0"
maxOccurs="unbounded">
<annotation>
<documentation>
URI of a policy/rule-combining algorithm to be added to supported algorithms. There must be one and only one Java class - say 'com.example.FooCombiningAlg' - on the
must be one and only one Java class on the classpath - say <i>com.example.FooValueFactory</i> - implementing interface
<i>org.ow2.authzforce.core.pdp.api.value.AttributeValueFactory</i> with zero-arg
constructor, and this URI must match the one returned by <i>new com.example.FooValueFactory().getId()</i>.
</p>
<p>More info about Attribute Data-types is available on <ahref="https://github.com/authzforce/core/wiki/XACML-Data-Types">AuthzForce wiki</a>.</p>
URI of a XACML function to be added to supported functions. For every function, its return type and all its parameter types must be either standard mandatory ones enabled by
<i>useStandardDatatypes</i> attribute, or custom ones declared in previous <i>attributeDatatype</i> elements; and there must be one and only one Java class - say
<i>com.example.FooFunction</i> - on the
classpath implementing interface <i>org.ow2.authzforce.core.pdp.api.func.Function</i> with zero-arg constructor, and this URI must match the one returned by:
<i>new com.example.FooFunction().getId()</i>.
<p>More info about Functions is available on <ahref="https://github.com/authzforce/core/wiki/XACML-Functions">AuthzForce wiki</a>.</p>
URI of a XACML policy/rule-combining algorithm to be added to supported algorithms. There must be one and only one Java class - say <i>com.example.FooCombiningAlg</i> - on the
classpath
implementing interface 'org.ow2.authzforce.core.pdp.api.combining.CombiningAlg' with zero-arg constructor, such that this URI equals: new
com.example.FooCombiningAlg().getId().
</documentation>
</annotation>
</element>
<element
ref="tns:attributeProvider"
maxOccurs="unbounded"
minOccurs="0"/>
<element
name="policyProvider"
type="authz-ext:AbstractPolicyProvider"
minOccurs="1"
maxOccurs="1">
<annotation>
<documentation>
Policy Provider that resolves Policy(Set)IdReferences. There must be one and only one Java class - say 'com.example.FooPolicyProviderFactory' - on the classpath
implementing interface
'org.ow2.authzforce.core.pdp.api.policy.CLoseablePolicyProvider.Factory<CONF_T>' with zero-arg constructor, where CONF_T is the JAXB type bound
implementing interface <i>org.ow2.authzforce.core.pdp.api.combining.CombiningAlg</i> with zero-arg constructor, and this URI must match the one returned by: <i>new
com.example.FooCombiningAlg().getId()</i>.
<p>More info about Policy and Rule Combining Algorithms is available on <ahref="https://github.com/authzforce/core/wiki/XACML-Combining-Algorithms">AuthzForce wiki</a>.</p>
XACML Policy Provider that resolves <i>Policy(Set)IdReference</i>s. There must be one and only one Java class on the classpath - say <i>com.example.FooPolicyProviderFactory</i> - implementing interface
<i>org.ow2.authzforce.core.pdp.api.policy.CLoseablePolicyProvider.Factory<CONF_T></i> with zero-arg constructor, where <i>CONF_T</i> is the JAXB type bound
to this XML element type.
</p>
<p>More info about Policy Providers (how to make/use one) is available on <ahref="https://github.com/authzforce/core/wiki/Policy-Providers">AuthzForce wiki</a>.</p>
<p>
Implementation classes can use org.ow2.authzforce.pd.api.EnvironmentProperties#replacePlaceholders() to replace ${property_name} placeholders with such properties. You
may use '!' as a
Implementation classes can use <i>org.ow2.authzforce.pd.api.EnvironmentProperties#replacePlaceholders()</i> method to replace <i>${property_name}</i> placeholders with such properties. You
may use <i>!</i> (exclamation mark) as a
separating character between the placeholder property name and a default value that is used if the property is undefined. E.g.
${PARENT_DIR!/home/foo/conf} will be replaced with
'/home/foo/conf' if PARENT_DIR is undefined.
<i>${PARENT_DIR!/home/foo/conf}</i> will be replaced with
<i>/home/foo/conf</i> if <i>PARENT_DIR</i> is undefined.
In the location, you may use placeholders enclosed between '${' and '}' for the following properties: - the global property 'PARENT_DIR' for
In the location, you may use placeholders enclosed between <i>${</i> and <i>}</i> for the following properties:
<ul>
<li>the global property <i>PARENT_DIR</i> for
defining - in a generic way
- a path relative to the parent directory to the XML file where this is used; - Java system properties; - System environment variables.
- a path relative to the parent directory to the XML file where this is used;
</li>
<li>Java system properties;
</li>
<li>System environment variables.
</li>
</ul>
</p>
</documentation>
</annotation>
</element>
<element
name="rootPolicyRef"
type="tns:TopLevelPolicyElementRef"
minOccurs="0"
maxOccurs="1">
<annotation>
<documentation>
Identifies the root policy from which the policy evaluation begins. This identifier must be resolved by the Policy Provider configured previously (cf. 'policyProvider'
element). In case this is not specified, the policy returned by the PolicyProvider#getCandidateRootPolicy() method is used as root policy. Refer to the respective PolicyProvider's documentation for more information.
</documentation>
</annotation>
</element>
<element
name="decisionCache"
minOccurs="0"
maxOccurs="1"
type="authz-ext:AbstractDecisionCache">
<annotation>
<documentation>
Decision Result cache that, for a given request, provides the XACML policy evaluation result from a cache if there is a cached result for the given request. There must be
Identifies the root policy from which the policy evaluation begins. This identifier must be resolved by the Policy Provider configured previously (cf. <i>policyProvider</i>
element). In case this is not specified, the policy returned by the <i>PolicyProvider#getCandidateRootPolicy()</i> method is used as root policy. Refer to the respective PolicyProvider's documentation for more information.
Decision cache that, for a given request, provides the XACML policy evaluation result from a cache if there is a cached result for the given request. There must be
one and
only one Java class - say 'com.example.FooDecisionCacheFactory' - on the classpath implementing interface
'org.ow2.authzforce.core.pdp.api.DecisionCache.Factory<CONF_T>' with zero-arg
constructor, where CONF_T is the JAXB type bound to this XML element type.
</documentation>
</annotation>
</element>
<element
name="ioProcChain"
type="tns:InOutProcChain"
minOccurs="0"
maxOccurs="unbounded">
<annotation>
<documentation>
only one Java class on the classpath - say <i>com.example.FooDecisionCacheFactory</i> -implementing interface
<i>org.ow2.authzforce.core.pdp.api.DecisionCache.Factory<CONF_T></i> with zero-arg
constructor, where <i>CONF_T</i> is the JAXB type bound to this XML element type.
</p>
<p>More info about Decision Cache extensions is available on <ahref="https://github.com/authzforce/core/wiki/Decision-Caches">AuthzForce wiki</a>.</p>
I/O processing chains if specific processing before and/or after policy evaluation by the PDP engine is required. Each chain must handle a different input datatype. In
other words,
there is no more than one I/O processing chain per supported input type, e.g. one for XACML/XML input, another for XACML/JSON input.
</documentation>
</annotation>
</element>
</sequence>
<attribute
name="version"
type="token"
use="required">
<annotation>
<documentation>Version of the current schema for which the instance
document is valid. Must match the 'version' attribute value of the
<p>true iff we want strict Attribute Issuer matching and we require that all AttributeDesignators set the
Issuer field.</p>
<p>
"Strict Attribute Issuer matching" means that an AttributeDesignator without Issuer only match request
<i>Strict Attribute Issuer matching</i> means that an AttributeDesignator without Issuer matches only request
Attributes without Issuer. This mode is not fully compliant with XACML 3.0,
§5.29, in the
case that
...
...
@@ -335,11 +213,11 @@
it performs better and is recommended when all AttributeDesignators have an Issuer (best
practice). Indeed, the XACML 3.0
Attribute Evaluation section
§5.29 says: "If the Issuer is not present in the AttributeDesignator, then the matching of the
§5.29 says: <i>If the Issuer is not present in the AttributeDesignator, then the matching of the
attribute to the named
attribute SHALL be governed by AttributeId and
DataType attributes alone."
Therefore, if 'strictAttributeIssuerMatch' is false, since policies may use AttributeDesignators without
DataType attributes alone.</i>
Therefore, if <i>strictAttributeIssuerMatch</i> is false, since policies may use <i>AttributeDesignator</i>s without
Issuer,
if the requests are using matching Attributes but with
none, one or more different Issuers, this PDP
...
...
@@ -347,67 +225,53 @@
matching Category/AttributeId but
with any Issuer or no Issuer. Therefore, in order
to stay compliant with §5.29 and still enforce best
practice, when strictAttributeIssuerMatch =
true, we also require that all
practice, when <i>strictAttributeIssuerMatch =
true</i>, we also require that all
AttributeDesignators set the Issuer field.</p>
</documentation>
</annotation>
</attribute>
<attribute
name="maxIntegerValue"
type="positiveInteger"
use="optional"
default="2147483647">
<annotation>
<documentation> Maximum absolute integer value. This is the expected maximum absolute value for XACML attributes of standard type 'http://www.w3.org/2001/XMLSchema#integer' (requires
<xs:documentation> Maximum absolute integer value. This is the expected maximum absolute value for XACML attributes of standard type <i>http://www.w3.org/2001/XMLSchema#integer</i> (requires
<i>useStandardDatatypes
= true</i>). Decreasing this value as much
as
possible helps the PDP engine optimize the processing of integer
<xs:documentation>Level of verbosity of the error message trace returned in case of client request errors, e.g. invalid requests. Increasing this value