feat(postgres): derive listeners from control-plane sync section#171
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consumes a new top-level
postgresarray in the control plane sync response. Each entry carries a DSN (asecrets.Sourceblock) and optional role, keyed byforeign_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 theforeign_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 aforeign_idconflict. Listeners hot-reload through the existing managerReloadpath; an invalid sync payload is logged and the running listeners are preserved.