Configuration format
With the release of Parser Attribute Connectors 1.0.0, Axiomatics introduced a new configuration format that provides simpler and clearer style and structure.
The old configuration format is not compatible with version 1.0.0 and only works with older versions of the Parser ACs. In order to upgrade to version 1.0.0, you should convert your configuration files to use the new format.
It is possible to use your existing older Parser ACs version and configuration along with a deployment of the new version that leverages the new configuration format.
The old configuration format is deprecated and no longer maintained. Switching to the new format is recommended.
Prior to their inclusion in the Parser Attribute Connectors bundle, JSON and XML parsers relied on a different configuration format. Below, you'll find the key differences between the old and new formats.
Old format
In the old format, a single payload
element defined both the string source and its expected format for parsing. This element could be specified at the overall configuration level or individually for each mapping. When absent in a mapping, the configuration-wide payload
element applied. While all payload
elements were optional, having none at all triggered an error.
Essentially, one configuration could handle data from diverse sources and formats, though this approach isn't recommended as the best practice.
New format
The new format requires each configuration to specify a single source for parsing using the source
element. This source applies to all mappings and cannot be overridden. Additionally, each configuration can only parse one format: JSON, XML, or JWT.
Instead of the payload
element, the expected source format is now defined by the xmlns
attribute within the configuration
element. The valid options are:
"http://www.axiomatics.com/attributeconnector/parser/json/configuration"
"http://www.axiomatics.com/attributeconnector/parser/jwt/configuration"
"http://www.axiomatics.com/attributeconnector/parser/xml/configuration"
The mapping
element structure remains mostly unchanged. However, the following modifications apply:
The
payload
element is no longer used.The
expression
element, holding either a JSONPath or XPath expression, now corresponds to thejsonPath
andxPath
elements in the JSON and XML parsers, respectively.noteIn this release, the JWT parser does not allow for JSONPath expressions. Instead, use the
claim
element to get the value of a claim by name.The
key
andxacmlAttribute
elements remain the same as in the old format.
Examples
- Old format (XML)
- New format (XML)
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://www.axiomatics.com/parser.config"
identifier="my-xml-ac-id">
<mapping>
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.status"
DataType="http://www.w3.org/2001/XMLSchema#string" />
<expression>/class/student[1]/lastname/text()</expression>
<payload jwt="false"
contentType="XML">
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.payload"
DataType="http://www.w3.org/2001/XMLSchema#string" />
</payload>
</mapping>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://www.axiomatics.com/attributeconnector/parser/xml/configuration"
identifier="my-xml-ac-id">
<source>
<xacmlAttribute AttributeId="pip.payload"
DataType="http://www.w3.org/2001/XMLSchema#string"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" />
</source>
<mapping>
<xacmlAttribute AttributeId="pip.status"
DataType="http://www.w3.org/2001/XMLSchema#string"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" />
<xPath>/class/student[1]/lastname/text()</xPath>
</mapping>
</configuration>
- Old format (JSON)
- New format (JSON)
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://www.axiomatics.com/parser.config"
identifier="my-json-ac-id">
<mapping>
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.status"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
<expression>$.authorizations[?(@.id=='##1##')].status</expression>
<payload jwt="false" contentType="JSON">
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.payload"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</payload>
<key>
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.username"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</key>
</mapping>
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://www.axiomatics.com/attributeconnector/parser/json/configuration"
identifier="my-json-ac-id">
<source>
<xacmlAttribute AttributeId="pip.payload"
DataType="http://www.w3.org/2001/XMLSchema#string"
Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject" />
</source>
<mapping>
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.status"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
<jsonPath>$.authorizations[?(@.id=='##1##')].status</jsonPath>
<key>
<xacmlAttribute Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"
AttributeId="pip.username"
DataType="http://www.w3.org/2001/XMLSchema#string"/>
</key>
</mapping>
</configuration>