Configuration #

Swagger/OpenAPI #

Most settings for routing, validation and CORS can be set in swagger.yaml. See OpenAPI Integrations for detailed information.

Dynamic Configuration #

If you need to define configuration settings dynamically, you can use the conf/config.xml file. It supports the same settings as in swagger.yaml. The difference is, that you may dynamically evaluate attributes at runtime (via "{…}") and use if attributes as in the flow (but no control structures!):

<config>
  <flat>
    <definition src="schema.yaml"/>

    <validation request="true"        if="$server/role = 'dev'"/>
    <validation request="report-only" if="$server/role = 'prod'"/>

    <cors allowed-origins="{$env/ALLOWED_ORIGINS}"/>
  </flat>
</config>

LDAP #

LDAP TLS Configuration #

If you use the ldap-lookup() or ldap-query() function and connect to the LDAP server via TLS (ldaps://... URL), you may have to provide the corresponding CA certificate using the following setting in your conf/config.xml:

<config>
  <flat>
    <ldap cacert-src="path/to/ca-certificate.pem"/>
  </flat>
</config>

The path is resolved relative to the config.xml file.

LDAP Timeout #

LDAP requests via ldap-lookup() or ldap-query() use $FLAT_MAX_TIMEOUT as the default timeout. If you want to set a lower timeout for LDAP requests, use the setting below in your conf/config.xml:

<config>
  <flat>
    <ldap timeout="3"/>
  </flat>
</config>