在WSO2 XML編輯器內部遇到與XACML Version 3語法驗證程序有關的問題,該編輯器拒絕插入語句。我計劃添加一個屬性列表來代替單個屬性檢查。下面是得到由XACML語法驗證拒絕報表的打印輸出:WSO2身份驗證XACML - 支持條件聲明?
這個簡單的條件有「串袋」拋出一個模式錯誤:
<xacml3:Condition>
<xacml3:Apply functionid="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of">
<xacml3:Apply functionid="urn:oasis:names:tc:xacml:1.0:function:string-bag">
<xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Curitiba</xacml3:AttributeValue>
<xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Bahia</xacml3:AttributeValue>
<xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Belem</xacml3:AttributeValue>
</xacml3:Apply>
<xacml3:AttributeDesignator Category=" urn:oasis:names:tc:xacml:3.0:attribute-category:environment" AttributeId="urn:oasis:names:tc:xacml:1.0:environment:environment-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></xacml3:AttributeDesignator>
</xacml3:Apply>
</xacml3:Condition>
顯示錯誤消息是:
使用Entitlement policy is not updated. Error is :Invalid Entitlement Policy. Policy is not valid according to XACML schema
此條件的 「或」 邏輯運算符工作正常:
<xacml3:Condition>
<xacml3:Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:or">
<xacml3:Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in">
<xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Curitiba</xacml3:AttributeValue>
<xacml3:AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment" AttributeId="urn:oasis:names:tc:xacml:1.0:environment:environment-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></xacml3:AttributeDesignator>
</xacml3:Apply>
<xacml3:Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-is-in">
<xacml3:AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">Brasilia</xacml3:AttributeValue>
<xacml3:AttributeDesignator Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment" AttributeId="urn:oasis:names:tc:xacml:1.0:environment:environment-id" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></xacml3:AttributeDesignator>
</xacml3:Apply>
</xacml3:Apply>
</xacml3:Condition>
如上所示,描述條件的語句恰好作爲該規則的最後一部分插入。
WSO2 PAP是否支持使用屬性列表,以及大小寫是否可以通過語法構造中的錯誤來解釋此錯誤?
在Web上尋找公共語法和模式驗證程序,這是一種實用工具,可以幫助您調試與XACML V3語法合規性類似的問題。
今天發現了一個在線的XML(XACML)驗證工具,效果很好。它可以通過以下URL訪問:http://www.freeformatter.com/xml-validator-xsd.html,它可以直接從OASIS源代碼下載XSD(模式)文件:http://docs.oasis-open。組織/ XACML/3.0/XACML核心-V3型模式-WD-17.xsd。這有助於調試源的正確性,主要針對測試用例。 –