-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Study the feasibility of removing all XPath-related features from the core spec and move them to a new profile, e.g. XPath Profile.
Rationale:
- Simplify the core spec, esp. for implementers that have no interest in supporting XPath or XML Content at all, and similarly for policy writers that have no interest in using XPath expressions either.
- Simplify the core XACML schema: move XPath-related XSD elements/types, to separate XSD if possible
- Make the core spec more digestible as a general goal.
A significant part of the core XACML 3.0 spec is about XPath-related features which are all optional though. So for the reasons above, they could be moved out to a new profile. Here is the list:
- Schema element (§10.2.1) to be removed:
xacml:XPathVersion
- Schema elements (§10.2.1) to be either removed or changed to abstract types (see last paragraph down below):
xacml:AttributeSelector
,xacml:PolicyDefaults
,xacml:PolicySetDefaults
,xacml:RequestDefaults
- Data-type (cf. §10.2.7)
urn:oasis:names:tc:xacml:3.0:data-type:xpathExpression
- Functions (cf. §10.2.8)
urn:oasis:names:tc:xacml:3.0:function:xpath-node-count
,urn:oasis:names:tc:xacml:3.0:function:xpath-node-equal
,urn:oasis:names:tc:xacml:3.0:function:xpath-node-match
- Sections to be removed: 2.7, 4.2, 5.4, 5.5, 5.15, 5.30, 5.43, 6, A.3.15.
- Sections to be reduced/simplified: 2.5, 2.11, 3.2, 3.3.1.1, 4.2.4 (rewrite the examples without AttributeSelector and xpath function / expression), 5.42, 7.3.1, 7.3.2, 7.3.4, 7.3.7, 7.20, 10.2.1, 10.2.7, 10.2.8, A.2, B.3.
Downside: this requires some effort to rewrite examples in 4.2.4 using XPath.
Instead of simply removing the schema elements xacml:AttributeSelector
, xacml:PolicyDefaults
, xacml:PolicySetDefaults
, xacml:RequestDefaults
from the core schema, we can keep them but make the definitions more generic / not XPath-specific, i.e. usable for any structured data-type (XML, JSON or whatever), and leave the datatype-specific definitions to separate XACML profiles (e.g. JSON Profile, XPath profile).
What does it mean exactly in terms of XML schema ? Here is a proposal:
Change the AttributeSelectorType and DefaultsType to abstract types in the core XACML schema (remove XPath specifics):
<xs:complexType name=”DefaultsType” abstract="true" />
<xs:complexType name="AttributeSelectorType" abstract="true">
<xs:complexContent>
<xs:extension base="xacml:ExpressionType">
<xs:attribute name="Category" type="xs:anyURI" use="required"/>
<!-- ContextSelectorId removed because XPath-specific (?) -->
<!-- Remove the Path attribute? or consider this generic, i.e. applicable to any structured data type (XML has XPath, JSON has JSONPath, what else?) -->
<xs:attribute name="Path" type="xs:string" use="required"/>
<xs:attribute name="DataType" type="xs:anyURI" use="required"/>
<xs:attribute name="MustBePresent" type="xs:boolean" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
Then in the new XPath profile, we would have:
<!-- Maybe it's time to use a XML enumeration type instead of anyURI! -->
<xs:element name="XPathVersion" type="xs:anyURI"/>
<xs:element name="XPathAttributeSelector" type="xacml:XPathAttributeSelectorType" substitutionGroup="xacml:AttributeSelector"/>
<xs:complexType name="XPathAttributeSelectorType">
<xs:complexContent>
<xs:extension base="xacml:AttributeSelectorType">
<xs:attribute name="ContextSelectorId" type="xs:anyURI" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="PolicyXPathDefaults" type="xacml:XPathDefaultsType" substitutionGroup="xacml:PolicyDefaults"/>
<xs:element name="RequestXPathDefaults" type="xacml:XPathDefaultsType" substitutionGroup="xacml:RequestDefaults"/>
<xs:complexType name="XPathDefaultsType">
<xs:complexContent>
<xs:sequence>
<xs:choice>
<xs:element ref="xacml:XPathVersion"/>
</xs:choice>
</xs:sequence>
</xs:complexContent>
</xs:complexType>
Then in the JSON profile, we would have:
<!-- Maybe it's time to use a enumeration type instead of anyURI! -->
<xs:element name="JSONPathVersion" type="xs:anyURI"/>
<xs:element name="JSONPathAttributeSelector" type="xacml:JSONPathAttributeSelectorType" substitutionGroup="xacml:AttributeSelector"/>
<xs:complexType name="JSONPathAttributeSelectorType">
<xs:complexContent>
<xs:extension base="xacml:AttributeSelectorType">
<!-- Any parameter specific to JSONPath evaluation goes here -->
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="PolicyJSONPathDefaults" type="xacml:JSONPathDefaultsType" substitutionGroup="xacml:PolicyDefaults"/>
<xs:element name="RequestJSONPathDefaults" type="xacml:JSONPathDefaultsType" substitutionGroup="xacml:RequestDefaults"/>
<xs:complexType name="JSONPathDefaultsType">
<xs:complexContent>
<xs:sequence>
<xs:choice>
<xs:element ref="xacml:JSONPathVersion"/>
</xs:choice>
</xs:sequence>
</xs:complexContent>
</xs:complexType>
Not sure this is all valid XSD. To be checked.
Regarding AttributeSelector, there is also the question whether we still need it in XACML 4.0 or we could remove it completely, and instead, use XACML functions for XML/JSON parsing and XPath/JSONPath evaluation (to be defined in XPath / JSON profiles).