Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>As I understand your requirement, you need to apply XACML policy based on the xml schema as described above. The sample xml needed to be in XACML request else if you are planning to read from xml as repository you may need to write a custom PIP.</p> <p>You can achieve the XPath based policy design for the same, provided that the xml input for the client details is available in XACML request inside element as below sample:</p> <pre><code>&lt;Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"&gt; &lt;Content&gt; &lt;client id="xxxx"&gt; &lt;sales id="yyyy"&gt; &lt;value&gt;1234&lt;/value&gt; &lt;/sales&gt; &lt;/client&gt; &lt;/Content&gt; &lt;/Attributes&gt; </code></pre> <p>Then you can create the policy based for your use case as below sample:</p> <pre><code>&lt;Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" xmlns:xacml="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="sample-xpath-policy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0"&gt; &lt;Description&gt;Sample XPath policy&lt;/Description&gt; &lt;PolicyDefaults&gt; &lt;XPathVersion&gt;http://www.w3.org/TR/1999/REC-xpath-19991116&lt;/XPathVersion&gt; &lt;/PolicyDefaults&gt; &lt;Rule Effect="Permit" RuleId="Rule-1"&gt; &lt;Target&gt; &lt;AnyOf&gt; &lt;AllOf&gt; &lt;Match MatchId="urn:oasis:names:tc:xacml:1.0:function:integer-less-than"&gt; &lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer"&gt;10000&lt;/AttributeValue&gt;&lt;AttributeSelector MustBePresent="false" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource" Path="/client/sales/value/text()" DataType="http://www.w3.org/2001/XMLSchema#integer"/&gt; &lt;/Match&gt; &lt;/AllOf&gt; &lt;/AnyOf&gt; &lt;/Target&gt; &lt;/Rule&gt; &lt;Rule RuleId="rule2" Effect="Deny"&gt; &lt;Description&gt;Deny rule&lt;/Description&gt; &lt;/Rule&gt; &lt;/Policy&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload