Skip to content

fix(role): preserve SCRAM password verifiers - #831

Merged
damacus merged 2 commits into
mainfrom
fix/scram-verifier-support
Jul 30, 2026
Merged

damacus merged 2 commits into
mainfrom
fix/scram-verifier-support

Conversation

@damacus

@damacus damacus commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve pre-computed SCRAM-SHA-256 verifiers verbatim through the Ruby pg connection
  • quote plaintext and encrypted password values with libpq's connection-aware literal escaping
  • prevent password-bearing SQL and query results from being written to debug logs
  • document creation and rotation semantics for encrypted role passwords
  • remove the obsolete ChefSpec Berkshelf plugin required by the v9 lint workflow

Testing

  • cookstyle .
  • yamllint .
  • markdownlint-cli2 '**/*.md'
  • RSpec: 67 examples, 0 failures
  • access-15-ubuntu-2404: 36 successful, 0 failures
  • access-16-ubuntu-2404: 36 successful, 0 failures
  • access-17-ubuntu-2404: 36 successful, 0 failures
  • access-17-almalinux-9: 36 successful, 0 failures

Closes #703.
Replaces #797, whose shell-specific dollar-sign escaping is no longer valid after the cookbook moved SQL execution to PG::Connection.

@damacus
damacus requested a review from a team as a code owner July 30, 2026 09:49
@damacus damacus added the Release: Patch Release to Chef Supermarket as a version patch when merged label Jul 30, 2026
@github-actions

Copy link
Copy Markdown

Slowest examples

Top 10 slowest examples (0.01 seconds, 37.93% of total time)
Example Description Time in seconds
spec/libraries/helpers_spec.rb:19 PostgreSQL::Cookbook::Helpers#data_dir(version) with rhel family and Postgres 11 from repo returns the correct path 0.00635
spec/libraries/helpers_spec.rb:132 PostgreSQL::Cookbook::Helpers#dnf_module_platform? returns false on RHEL 7 0.00114
spec/libraries/helpers_spec.rb:81 PostgreSQL::Cookbook::Helpers#conf_dir(version) with debian family and Postgres 11 from os returns the correct path 0.00054
spec/libraries/role_spec.rb:18 PostgreSQL::Cookbook::SqlHelpers::Role#role_password_sql quotes a SCRAM-SHA-256 verifier without modifying dollar signs 0.0005
spec/libraries/helpers_spec.rb:65 PostgreSQL::Cookbook::Helpers#conf_dir(version) with rhel family and Postgres 13 from os returns the correct path 0.00048
spec/libraries/helpers_spec.rb:43 PostgreSQL::Cookbook::Helpers#data_dir(version) with debian family and Postgres 11 from os returns the correct path 0.00047
spec/libraries/helpers_spec.rb:119 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with debian family and Postgres 11 from os returns the correct service name 0.00046
spec/libraries/helpers_spec.rb:95 PostgreSQL::Cookbook::Helpers#default_platform_service_name(version) with rhel family and Postgres 12 from repo returns the correct service name 0.00042
spec/libraries/role_spec.rb:27 PostgreSQL::Cookbook::SqlHelpers::Role#role_password_sql uses connection-aware quoting for a plaintext password 0.00042
spec/libraries/helpers_spec.rb:150 PostgreSQL::Cookbook::Helpers#dnf_module_platform? returns false on RHEL 10 0.00041

@damacus
damacus merged commit 27c5f41 into main Jul 30, 2026
165 checks passed
@damacus
damacus deleted the fix/scram-verifier-support branch July 30, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Release: Patch Release to Chef Supermarket as a version patch when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCRAM-SHA-256 documentation

1 participant