Skip to content

feat(managed-bootstrap): the migration owner declares its identity and its server's authority - #207

Merged
antoinetoussaint-byte merged 2 commits into
mainfrom
feat/managed-bootstrap-declares-its-identity
Oct 29, 2026
Merged

antoinetoussaint-byte merged 2 commits into
mainfrom
feat/managed-bootstrap-declares-its-identity

Conversation

@antoinetoussaint-byte

Copy link
Copy Markdown
Contributor

The follow-up #205 named and deliberately left undone.

#205 gave bootstrap.Options an external-identity declaration and a server trust anchor, but cmd/managed-bootstrap could not see them: the root module pins a published libs/go rather than replacing it with the tree, and adding a replace would make the root build against local sources while its release builds against the pin — two states nobody can reproduce. #206 is on main, so the pin moves and the command reads the declarations.

Why it matters now

This is what lets migrations run against a managed server at all. A managed database can exist with no schema and no application roles, and creating a login in the cloud grants CONNECT and nothing else — infra's own module says so explicitly: the in-database roles and grants are the cluster interior's job. That job is this command.

The two reads

o.ExternalIdentity = os.Getenv("CODEFLY_POSTGRES_EXTERNAL_IDENTITY")
o.ServerTrustAnchorPEM = os.Getenv("CODEFLY_POSTGRES_SERVER_AUTHORITY_PEM")

Configuration beside the connection they describe, never flags. A Job's command line is readable by anything in its pod. Neither value is a secret — an issuer names who mints the credential, and a certificate authority is public information — while a credential minted from the issuer is, which is why it appears nowhere here and is fetched per connection instead. Absent means the password-authenticated behaviour every existing deployment has.

Classification

Fix, completing #205 at the place that owns it, with no new mechanism: the resolution table and the anchor parse are the library's, exported for this caller in #205 precisely so there would be one vocabulary rather than a copy here.

Verified

Root module builds and vets. The bootstrap parity suite passes against a real Postgres.

One of its four parallel subtests failed on the first run with Error response from daemon: all predefined address pools have been fully subnetted — this machine had 30 Docker networks from concurrent worktrees. The subtest passes alone. That flake is the environment, not this change, and it is worth knowing about because a reviewer on a busy machine will hit it too.

Not verified

No migration has run against a managed instance. The path from here is an identity for the migration owner in the target cell and a Job that carries these two values.

antoinetoussaint-byte and others added 2 commits October 28, 2026 23:05
…d its server's authority

The follow-up #205 named and deliberately left: bootstrap.Options grew an
external-identity declaration and a server trust anchor, but the command could
not see them, because the root module pins a published libs/go rather than
replacing it with the tree. #206 is on main, so the pin moves and the command
reads the two declarations.

Delivered as configuration beside the connection they describe, never as flags.
A Job's command line is readable by anything in its pod, and these two are the
deployment's statement about where this database is. Neither is a secret — an
issuer names who mints the credential, and a certificate authority is public
information — while a credential minted from the issuer is, which is why it
never appears here and is fetched per connection instead. Absent means the
password-authenticated behaviour every existing deployment has.

This is what lets migrations run against a managed server at all: the database
exists but its schema and its application roles do not, and creating a login in
the cloud grants CONNECT and nothing else — the in-database roles and grants are
the migration owner's work.

Verified: the root module builds and vets, and the bootstrap parity suite passes
against a real Postgres. One of its four parallel subtests failed first on
`all predefined address pools have been fully subnetted` — this machine had 30
Docker networks from concurrent worktrees, and the subtest passes alone. That
flake is the environment, not this change.

Not verified: no migration has run against a managed instance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
`go get` adds the new version's hashes without removing the old module
version's, and CI's tidiness gate runs `go mod tidy` and compares — so the
commit has to carry what tidy produces, not what go get leaves. Three stale
lines for the previous libs/go pseudo-version.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte enabled auto-merge (squash) October 29, 2026 03:47
@antoinetoussaint-byte
antoinetoussaint-byte merged commit d61195b into main Oct 29, 2026
3 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