JSON Parser Schema
The schema definition for the attribute connector configuration is available below in XML, and JSON/YAML format.
- XML
- JSON/YAML
json-parser.config.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.axiomatics.com/attributeconnector/parser/json/configuration"
xmlns:tns="http://www.axiomatics.com/attributeconnector/parser/json/configuration"
elementFormDefault="qualified">
<xs:element name="configuration" type="tns:configurationType"/>
<xs:complexType name="configurationType">
<xs:sequence>
<xs:element name="source" type="tns:sourceType"/>
<xs:element name="mapping" type="tns:mapping" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="identifier" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>The globally unique identifier for this configuration.
The identifier is used to generate unique identifiers for the mappings.
Each mapping must have a globally unique deterministic identifier for
attribute caching to work correctly.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="mapping">
<xs:sequence>
<xs:element name="xacmlAttribute" type="tns:xacmlAttributeType">
<xs:annotation>
<xs:documentation>This is the XACML attribute e.g. user.department the PDP is looking for.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="jsonPath" type="xs:string">
<xs:annotation>
<xs:documentation>This is the JSONPath expression that will be used to select values from the source JSON document.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="key" type="tns:keyType" maxOccurs="25" minOccurs="0">
<xs:annotation>
<xs:documentation>The keys represent the variable parts inside the JSONPath expression.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
<xs:attribute name="collate" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>This flag determines whether to return all the values found as a single value in a XACML bag
or as separate values in a XACML bag.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="delimiter" type="xs:string" default=",">
<xs:annotation>
<xs:documentation>If collate is true, then the delimiter is used between attribute values.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="keyType">
<xs:sequence>
<xs:element name="xacmlAttribute" type="tns:xacmlAttributeType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="xacmlAttributeType">
<xs:attribute name="Category" type="xs:string" use="required"/>
<xs:attribute name="AttributeId" type="xs:string" use="required"/>
<xs:attribute name="DataType" type="xs:string" use="required"/>
<xs:attribute name="Issuer" type="xs:string"/>
</xs:complexType>
<xs:complexType name="sourceType">
<xs:choice>
<xs:element name="xacmlAttribute" type="tns:xacmlAttributeType"/>
<xs:element name="json" type="tns:jsonType"/>
</xs:choice>
<xs:attribute name="encoded" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>
Indicates whether the contents of the payload are to be base64-decoded.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="jsonType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="src" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:schema>
json.parser.config.json
{
"$schema" : "https://json-schema.org/draft/2020-12/schema",
"$defs" : {
"NamedAttribute" : {
"type" : "object",
"properties" : {
"attributeId" : {
"type" : "string"
},
"category" : {
"type" : "string"
},
"datatype" : {
"type" : "string"
},
"issuer" : {
"type" : "string"
}
}
}
},
"type" : "object",
"properties" : {
"identifier" : {
"type" : "string"
},
"mappings" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"attributeName" : {
"type" : "string",
"description" : "The name of the attribute to be mapped to the full attribute definition from the dictionary. This is the recommended way to to define an attribute. Alternatively, xacmlAttribute can be used"
},
"collate" : {
"type" : "boolean",
"description" : ""
},
"delimiter" : {
"type" : "string",
"description" : ""
},
"jsonPath" : {
"type" : "string",
"description" : ""
},
"keys" : {
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"attributeName" : {
"type" : "string",
"description" : "The name of the attribute to be mapped to the full attribute definition from the dictionary. This is the recommended way to to define an attribute. Alternatively, xacmlAttribute can be used"
},
"xacmlAttribute" : {
"$ref" : "#/$defs/NamedAttribute"
}
}
}
},
"xacmlAttribute" : {
"$ref" : "#/$defs/NamedAttribute"
}
},
"required" : [ "jsonPath" ]
}
},
"source" : {
"type" : "object",
"properties" : {
"attributeName" : {
"type" : "string"
},
"encoded" : {
"type" : "boolean"
},
"json" : {
"type" : "object",
"properties" : {
"src" : {
"type" : "string"
},
"value" : {
"type" : "string"
}
}
},
"xacmlAttribute" : {
"$ref" : "#/$defs/NamedAttribute"
}
}
}
},
"required" : [ "identifier", "mappings", "source" ]
}