Skip to content

feat(postgres): derive listeners from control-plane sync section#171

Merged
mslipper merged 1 commit into
mainfrom
feat/postgres-sync-listeners
Jun 2, 2026
Merged

feat(postgres): derive listeners from control-plane sync section#171
mslipper merged 1 commit into
mainfrom
feat/postgres-sync-listeners

Conversation

@mslipper

@mslipper mslipper commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Consumes a new top-level postgres array in the control plane sync response. Each entry carries a DSN (a secrets.Source block) and optional role, keyed by foreign_id. The proxy turns each granted entry into a running listener by reading the listen address and client credentials from standardized env vars derived from the foreign_id (IRON_PROXY_PG_<FOREIGN_ID>_{LISTEN,CLIENT_USER,CLIENT_PASSWORD}).

Entries whose required env vars are unset are skipped with a log line, so a proxy granted a secret it isn't meant to serve locally just ignores it. The existing local-YAML postgres: block keeps working for self-managed proxies and wins on a foreign_id conflict. Listeners hot-reload through the existing manager Reload path; an invalid sync payload is logged and the running listeners are preserved.

Consume a new top-level `postgres` array in the control plane sync
response. Each entry carries a DSN (a secrets.Source) and optional role,
keyed by foreign_id. The proxy turns each granted entry into a running
listener by reading the listen address and client credentials from
standardized env vars derived from the foreign_id
(IRON_PROXY_PG_<FOREIGN_ID>_{LISTEN,CLIENT_USER,CLIENT_PASSWORD}).

Entries whose required env vars are unset are skipped with a log line,
so a proxy granted a secret it isn't meant to serve locally ignores it.
The local YAML postgres: block keeps working and wins on foreign_id
conflict. Listeners hot-reload via the existing manager Reload path.
@mslipper mslipper merged commit cfa25af into main Jun 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant