Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this example the maintenance team for x509 servers need only deliver XML snippets with name and listen address – the rest of the portal protect configuration file is provided for example by the PortalProtect administration team. The x509 maintenance team does not even need to know which abstract definition their servers are extending.


JSON Configuration

Some elements of Ceptor use configuration in JSON format - these properties are still stored within the XML file, but with names ending with _JSON_ - example:

Code Block
<server name="apimanagement" type="abstract" description="Settings for API management" extends="">
  <group name="_JSON_" description="JSON configuration">
	<property name="apimanagement_JSON_" description="API management related configuration and metadata">
<![CDATA[{
  "environments": [
    {
      "name": "Sandbox",
    ....
}]]></property>
  </group>
</server

This naming convention is recognized by the console, which allows you to edit the JSON directly using a JSON editor with syntax hiliting.

Inheritance

Inheritance works differently for JSON that it does for regular properties. For regular properties, the value overrides any eventual value defined in a parent, but this does not make as much sense for JSON, where there is a need for more structure in the values.

By default, inheritance works in this way.

Given 2 server entries, parent and child, we start with the parents object, then for each top-level attribute in the child JSON it overrides the corresponding value in the parent with one exception - if the object is an array, the two elements are merged so the childs array contents are added to the parent.

Take this example:

Code Block
titleParent
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "a",
    "b",
  ]
}


Code Block
titleParent
{
  "key1": "1",
  "key3": [
    "c"
  ],
  "key4": "d"
}

The result is then:

Code Block
{
  "key1": "1",
  "key2", "b",
  "key3": [
    "a",
    "b",
    "c"
  ],
  "key4": "d"
}


But, it is also possible to change this behavior - if the child contains the array json.config.override  then the behavior changes and instead we start with the parent but then completely override the specified elements, adding any new elements - meaning the result becomes like this:


Code Block
titleParent
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "a",
    "b",
  ]
}


Code Block
titleParent
{
  "config.override": [
    "key3"
  ],
  "key1": "1",
  "key3": [
    "c"
  ],
  "key4": "d"
}

The result is then:

Code Block
{
  "key1": "a",
  "key2", "b",
  "key3": [
    "c"
  ],
  "key4": "d"
}