Routes define which outbound requests cordon intercepts and what credentials to inject. Each route matches on a destination hostname and specifies an auth type.Documentation Index
Fetch the complete documentation index at: https://docs.codezero.io/llms.txt
Use this file to discover all available pages before exploring further.
Route structure
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Identifier for the route (used in logs). |
match.host | string | Yes | Hostname to match (case-insensitive). |
auth.type | string | Yes | bearer, basic, or api_key. |
auth.username | string | basic only | Username for HTTP Basic authentication. |
auth.header_name | string | api_key only | Custom header name for API key injection. |
auth.secret | object | Yes | Secret source reference. See Secret Sources. |
Auth types
Bearer token
Injects anAuthorization: Bearer <secret> header.
Basic auth
Injects anAuthorization: Basic <base64(username:secret)> header.
API key header
Injects a custom header with the secret value.How matching works
- Cordon matches on the hostname of the outbound request (case-insensitive)
- For matched routes, cordon strips any existing auth header and replaces it with the real credential
- Unmatched requests are forwarded without modification
- Routes are evaluated in order; the first match wins
Multiple routes
You can configure multiple routes for different APIs:PostgreSQL listeners
For database connections, cordon can inject credentials at the wire protocol level. PostgreSQL listeners are configured as[[listeners]] entries — separate from HTTP routes — with port (local port) and upstream (upstream host and port).
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Identifier for the listener (used in logs). |
port | integer | Yes | Local port to listen on. |
upstream | string | Yes | Upstream database host and port (e.g. db.example.com:5432). |
auth.type | string | Yes | Auth type. Currently password. |
auth.username | string | Yes | Username to authenticate as. |
auth.secret | object | Yes | Secret source reference. See Secret Sources. |
localhost:15432 instead of the upstream database. Cordon injects the password during the PostgreSQL authentication handshake.