feat: render password_hash for users - #132
Open
ariel-lahiany wants to merge 1 commit into
Open
Conversation
users.toml supports password_hash, a PostgreSQL SCRAM verifier used to validate client logins without storing the plaintext password. The chart documents users as supporting all users.toml arguments in camelCase, but the template had no branch for it, so passwordHash was silently dropped. PgDog requires the backend connection to authenticate without a password when password_hash is set (e.g. serverAuth: rds_iam), so this pairs with serverUser/serverAuth rather than replacing serverPassword. Rendered independently of password/passwords: PgDog accepts both and prefers the hash, so the chart stays a faithful renderer of the config. Co-Authored-By: Claude Opus 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.
What
users.tomlsupportspassword_hash— a PostgreSQL SCRAM verifier (the value inpg_authid.rolpassword) used to validate client logins without keeping the plaintext password in the file. The chart'susersdocumentation says it "supports all arguments from users.toml", but the template has no branch for it, sopasswordHashis silently dropped from the rendered file and the user ends up with no credential at all.This adds the missing branch, documents the key in
values.yaml, and covers it in the test suite.Why it renders independently of
password/passwordsPgDog accepts both a plaintext password and a hash on the same user, and
Server::newprefers the hash:So
passwordHashgets its ownifrather than joining thepassword/passwordschain — the chart stays a faithful renderer of the config surface rather than imposing an ordering PgDog doesn't have.Pairing
PgDog requires the backend hop to authenticate without a password when
password_hashis set, which the schema states explicitly: "Server authentication must use RDS IAM or some other passwordless authentication." So this pairs withserverUser/serverAuth, and is not a replacement forserverPassword. The new fixture reflects that.Testing
helm lintcleantest/values-*.yamlfixtures still rendertest/values-password-hash.yaml, picked up automatically bytest.sh's globpasswordline is emitted for a hash-only userusers.tomlverified to parse as TOMLkubeconformwasn't available locally, so CI will be the first to run that step. The diff only changes the contents of a Secret'sdatavalue, so it shouldn't affect schema conformance.Rendered output:
Unrelated observation
While validating, I noticed
test/values-full.yamlusesusername:andpoolMode:instead ofname:andpoolerMode:. It renders syntactically invalid TOML —name =with no value — onmaintoday. CI passes becausekubeconformvalidates the Kubernetes Secret, not the TOML inside it. Happy to send that as a separate PR if useful; I left it out to keep this one focused.