Repository navigation
feat(db): make the database password optional - #850
Merged
Merged
Conversation
`db.password` was required, so a database that asks for none still needed one in the config, and a placeholder secret to go with it. That is the case behind the Cloud SQL Auth Proxy with automatic IAM database authentication, where the proxy's identity stands in for a password, and for a local database that trusts its clients. `db.password` can now be left out, and dipper then sends none; where it is set, nothing changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review found the change claimed dipper then sends no password, which is not quite so: the Postgres driver still looks for one in `PGPASSWORD` and `~/.pgpass`, and answers a server that asks for one with an empty password, which the server reports only as a failed password check. The field's documentation now says so, dipper logs at startup that it connects without a password of its own, and a refused password check (28P01) with no `db.password` set says that the password was left out. The test connecting without a password ran against a server that trusts every local client, so it would pass with a password set as well. A second test runs a server that checks SCRAM passwords over TCP: without the password it fails with the explanation, and with it it gets in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t-a-password # Conflicts: # bin/dipper-service/Cargo.toml
…t-a-password # Conflicts: # bin/dipper-service/src/config.rs
cjorge-thegraph
marked this pull request as ready for review
November 19, 2026 20:14
cjorge-thegraph
added a commit
that referenced
this pull request
Nov 19, 2026
…res-and-iisa-at-start Resolves db.rs against #847 and #850. The startup probe now fails before the pool does, so a refused password check gets #850's explanation there as well, and the TLS tests, whose stub drops each connection after its handshake, set a 1s connect wait instead of waiting 120s out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
db.passwordwas required, so a database that asks the client for no password still needed one in the config, along with a placeholder secret to deliver it. That is the case behind the Cloud SQL Auth Proxy with automatic IAM database authentication (--auto-iam-authn): the proxy's ephemeral certificate carries the identity, and dipper connects to it on localhost with only a username. It is also the case for a local database that trusts its clients.DbConfig.passwordis nowOption<Hidden<String>>with#[serde(default)]. When it's left out, dipper sets no password of its own. The Postgres driver may still take one fromPGPASSWORDor~/.pgpass, and answers a server that asks for one with an empty password. When it's set, nothing changes.k8s/README.mdmentions it under the prerequisites.Running the proxy and granting the identity is the deployment's business, not dipper's; this only lets dipper connect without inventing a password.
Tests:
db_config_may_leave_the_password_outfailed onmain(missing field `password`) and passes now.it_connects_without_a_password_where_the_server_asks_for_noneconnects to a pgtemp server, which trusts local connections, and runsSELECT 1. pgtemp is newly a dev-dependency of dipper-service, as it already is of dipper-pgmq and dipper-pgregistry.just fmt-check,just check,just test-unitand dipper-service'sit_tests pass locally.Changes after review
db.passwordis not set, the error says the password was left out. The server's own message ("password authentication failed") doesn't.hba_file). Without the password it fails with the explanation, and with it it gets in.🤖 Generated with Claude Code