Problem configuring PDP to use StaticRefPolicyProvider
Created by: jpcampb2
I am using the springboot example in this repo to experiment with a microservice-based PDP.
I am running into trouble when I try to modify the pdp.xml file to load additional policies and use the PolicySetIdReference feature. I have tried following the documentation here: https://github.com/authzforce/core/wiki/Policy-Providers
I note that the example pdp.xml says, "You may customize this PDP configuration except 'rootPolicyProvider' and 'refPolicyProvider' elements." but I don't know why or what exactly that means (there is no refPolicyProvider element in the example).
The configuration I am trying to use looks like the following:
<refPolicyProvider id="refPolicyProvider" xsi:type="StaticRefPolicyProvider" policyLocation="policies/*.xml" />
<rootPolicyProvider id="rootPolicyProvider" xsi:type="StaticRefBasedRootPolicyProvider">
<policyRef>root</policyRef>
</rootPolicyProvider>
The error I am getting is the following:
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'pdpEngineConf' defined in class path resource [cxf-pdp-service.xml]:
Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [org.ow2.authzforce.core.pdp.impl.PdpEngineConfiguration]:
Factory method 'getInstance' threw exception; nested exception is java.lang.IllegalArgumentException:
Invalid PDP configuration file
...
Caused by: org.xml.sax.SAXParseException;
systemId: file:/opt/authzforce/pdp.xml; lineNumber: 3; columnNumber: 115;
cvc-complex-type.3.2.2:
Attribute 'policyLocation' is not allowed to appear in element 'refPolicyProvider'.
I'm sure I'm missing some configuration setting and would love your insight.