Map Function doesn't work with substring
Hi I write a rule that should apply a map to a bag and extract given substrings like this:
<Apply FunctionId="urn:oasis:names:tc:xacml:3.0:function:map">
<Function FunctionId="urn:oasis:names:tc:xacml:3.0:function:string-substring"/>
<AttributeDesignator AttributeId="subuser" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">0</AttributeValue>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">1</AttributeValue>
</Apply>
This lead to this error:
Caused by: java.lang.IllegalArgumentException: Function urn:oasis:names:tc:xacml:3.0:function:map: Invalid type (expected: primitive, actual: bag) of argument #1
Changing the code to:
<Apply FunctionId="urn:oasis:names:tc:xacml:3.0:function:map">
<Function FunctionId="urn:oasis:names:tc:xacml:3.0:function:string-substring"/>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">0</AttributeValue>
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#integer">1</AttributeValue>
<AttributeDesignator AttributeId="subuser" Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/>
</Apply>
Doesn't help either:
Caused by: java.lang.IllegalArgumentException: Function urn:oasis:names:tc:xacml:3.0:function:string-substring: Invalid number of args: expected: 3; actual: 2
For me this feels like a bug since the first snippet should work but not sure if I'm missing something. Help is appreciated