# Configuration

## Swagger/OpenAPI

Most settings for routing, validation and CORS can be set in `swagger.yaml`. See [OpenAPI Integrations](/flat/reference/openapi.md) 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`:

```markup
<config>
  <flat>
    <definition src="swagger.yaml"/>
    <validation request="true" response="report-only"/>
    <cors allowed-origins="http://localhost:9000" allow-credentials="true"/>
  </flat>
</config>
```

The difference is, that you may use *Dynamic Attribute Values* and if-clauses as in the [flow](/flat/reference/flow.md):

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

## LDAP TLS Configuration

If you use the [`ldap-lookup()`](/flat/reference/functions/ldap-lookup.md) or [`ldap-query()`](/flat/reference/functions/ldap-query.md) function and connect to the LDAP server via TLS (`ldaps://...` URL), you may have to provide the corresponding CA certificate using the following config setting in your config file:

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

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

## LDAP Timeout

LDAP requests via [`ldap-lookup()`](/flat/reference/functions/ldap-lookup.md) or [`ldap-query()`](/flat/reference/functions/ldap-query.md) 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 config file:

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sevenval.gitbook.io/flat/reference/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
