Skip to main content

The most recent patch for this version is 1.0.2.  Learn more  

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.

note

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.

Important

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 the jsonPath and xPath elements in the JSON and XML parsers, respectively.

    note

    In 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 and xacmlAttribute elements remain the same as in the old format.

Examples

<?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/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>