- 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
## 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
- 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.**
*`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`:
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
...
@@ -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).
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:
URI of an XACML attribute datatype to be added to supported datatypes. Policies require datatypes for function arguments and AttributeAssignment expressions. For every datatype,
zero-arg
constructor,
where
CONF_T is the JAXB type bound to
this
XML element type. This attribute
Provider may also depend on
previously defined
'attributeProviders', to find dependency
attributes, i.e.
attributes that
this
Provider does not support
itself, but requires to find its supported
attributes. Therefore, if
an 'attributeProvider' AFy
requires/depends on an
attribute
A that is
not to be provided
by the
PEP,
another 'attributeProvider' AFx
providing this attribute A must be
declared
before X.
</p>
<p>
Such configurations (XML instances of this schema)
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;
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,
there
there
must be one and only one Java class - say 'com.example.FooValueFactory' - on the classpath implementing interface
must be one and only one Java class on the classpath - say <i>com.example.FooValueFactory</i> - implementing interface
'org.ow2.authzforce.core.pdp.api.value.AttributeValueFactory' with zero-arg
<i>org.ow2.authzforce.core.pdp.api.value.AttributeValueFactory</i> with zero-arg
constructor, such that this URI equals: new com.example.FooValueFactory().getId().
constructor, and this URI must match the one returned by <i>new com.example.FooValueFactory().getId()</i>.
</documentation>
</p>
</annotation>
<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
<documentation>
<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
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
<i>com.example.FooFunction</i> - on the
'useStandardDatatypes' attribute, or custom ones declared in previous 'attributeDatatype' elements; and there must be one and only one Java class - say
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:
'com.example.FooFunction' - on the
<i>new com.example.FooFunction().getId()</i>.
classpath implementing interface 'org.ow2.authzforce.core.pdp.api.func.Function' with zero-arg constructor, such that this URI equals:
<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
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
classpath
classpath
implementing interface 'org.ow2.authzforce.core.pdp.api.combining.CombiningAlg' with zero-arg constructor, such that this URI equals: new
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().
com.example.FooCombiningAlg().getId()</i>.
</documentation>
<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
minOccurs="1"
<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
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
to this XML element type.
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>
<p>
Implementation classes can use org.ow2.authzforce.pd.api.EnvironmentProperties#replacePlaceholders() to replace ${property_name} placeholders with such properties. You
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 '!' as a
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.
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
<i>${PARENT_DIR!/home/foo/conf}</i> will be replaced with
'/home/foo/conf' if PARENT_DIR is undefined.
<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
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;
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>
maxOccurs="1">
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.
<annotation>
</xs:documentation>
<documentation>
</xs:annotation>
Identifies the root policy from which the policy evaluation begins. This identifier must be resolved by the Policy Provider configured previously (cf. 'policyProvider'
</xs:element>
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.
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
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
one and
one and
only one Java class - say 'com.example.FooDecisionCacheFactory' - on the classpath implementing interface
only one Java class on the classpath - say <i>com.example.FooDecisionCacheFactory</i> -implementing interface
'org.ow2.authzforce.core.pdp.api.DecisionCache.Factory<CONF_T>' with zero-arg
<i>org.ow2.authzforce.core.pdp.api.DecisionCache.Factory<CONF_T></i> with zero-arg
constructor, where CONF_T is the JAXB type bound to this XML element type.
constructor, where <i>CONF_T</i> is the JAXB type bound to this XML element type.
</documentation>
</p>
</annotation>
<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
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,
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.
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.
<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
use="optional"
<i>useStandardDatatypes
default="2147483647">
= true</i>). Decreasing this value as much
<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
useStandardDatatypes
= true). Decreasing this value as much
as
as
possible helps the PDP engine optimize the processing of integer
possible helps the PDP engine optimize the processing of integer