我已经制作了自己的 MongoDBPolicyProvider 并将其集成到 Authzforce 服务器中,但由于此异常,我无法启动 webapp(docker image fiware/authzforce-ce-server,release-8.1.0):
java.lang.RuntimeException: Invalid PDP configuration of domain 'YAT-5z9ZEemGyAJCrBEAAg' in file '/opt/authzforce-ce-server/data/domains/YAT-5z9ZEemGyAJCrBEAAg/pdp.xml': refPolicyProvider is not an instance of class org.ow2.authzforce.pap.dao.flatfile.xmlns.StaticFlatFileDAORefPolicyProvider as expected.
我认为它仍在尝试从StaticFlatFileDAORefPolicyProvider
策略提供者那里检索策略。
- 扩展的 .jar 在服务器的类路径中可见。
- 这是我的 pdp 配置文件:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<pdp
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://authzforce.github.io/core/xmlns/pdp/6.0"
xmlns:oa="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
version="6.0.0" enableXPath="false" strictAttributeIssuerMatch="false" maxVariableRefDepth="10" maxPolicyRefDepth="10">
<refPolicyProvider
id="refPolicyProvider"
xmlns:ext="PRP/mongoDB"
xsi:type="ext:MongoDBBasedPolicyProviderDescriptor"
serverHost="localhost" serverPort="27017" dbName="PRP" collectionName="policies" />
<rootPolicyProvider id="rootPolicyProvider" xsi:type="StaticRefBasedRootPolicyProvider">
<policyRef>root-rbac-policyset</policyRef>
</rootPolicyProvider>
</pdp>
- 这是 MongoDBBasedPolicyProviderDescriptor:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MongoDBBasedPolicyProviderDescriptor")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class MongoDBBasedPolicyProviderDescriptor extends AbstractPolicyProvider
{
@XmlAttribute(name = "serverHost", required = true)
protected String serverHost;
@XmlAttribute(name = "serverPort", required = true)
protected int serverPort;
@XmlAttribute(name = "dbName", required = true)
protected String dbName;
@XmlAttribute(name = "collectionName", required = true)
protected String collectionName;
}
我现在已经完成了两次整合PRP的过程,但我还没有成功。我将不胜感激这方面的任何帮助。