feat: Make the used password algorithm configurable#78
Open
ZPascal wants to merge 2 commits into
Open
Conversation
Jobsby
reviewed
Jul 24, 2025
There was a problem hiding this comment.
Pull request overview
This PR makes the PostgreSQL password hashing/authentication algorithm configurable across the BOSH release instead of being hard-coded to md5. A new databases.password_authentication_algorithm property (default scram-sha-256) is introduced and threaded into both postgresql.conf (as password_encryption) and pg_hba.conf (as the local/host auth method).
Changes:
- Add a new spec property
databases.password_authentication_algorithmdefaulting toscram-sha-256. - Render
password_encryptioninpostgresql.conf.erbfrom the new property. - Replace the hard-coded
md5auth methods inpg_hba.conf.erbwith the new property.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| jobs/postgres/spec | Declares the new password_authentication_algorithm property and its default. |
| jobs/postgres/templates/postgresql.conf.erb | Sets password_encryption from the new property. |
| jobs/postgres/templates/pg_hba.conf.erb | Replaces the two hard-coded md5 auth methods with the property. |
Comments suppressed due to low confidence (2)
jobs/postgres/spec:74
- Reusing a single property
databases.password_authentication_algorithmfor bothpostgresql.conf'spassword_encryptionsetting andpg_hba.conf's authentication method conflates two different concerns.password_encryptiononly acceptsmd5orscram-sha-256, whereas the pg_hba auth-method column legitimately supports other values likepassword,cert,peer,trust, etc. Operators who want, for example,scram-sha-256storage withpassword(cleartext-over-TLS) auth — a valid combination — cannot express it. Consider splitting into two properties (e.g.password_encryptionandhost_auth_method) or documenting explicitly that only the two enum values are supported.
databases.password_authentication_algorithm:
description: "Defines the central algorithm for encrypting passwords e.g. md5 or scram-sha-256"
default: "scram-sha-256"
jobs/postgres/spec:74
- The property name
password_authentication_algorithmis misleading: in postgresql.conf this controls the password storage/hashing algorithm (password_encryption), not the authentication algorithm itself. A name likepassword_encryption(matching the postgres setting) would be clearer and more discoverable for operators familiar with PostgreSQL.
databases.password_authentication_algorithm:
description: "Defines the central algorithm for encrypting passwords e.g. md5 or scram-sha-256"
default: "scram-sha-256"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Alphasite
previously approved these changes
May 13, 2026
6980d14 to
31fc749
Compare
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.
Description:
The PR makes
password_encryptionmethod centrally configurable within the Bosh releaseTODO: