Fix passing deferred password - #1651
Conversation
|
Test failures seems to be unrelated. Upstream fixtures modules doesn't seem to support Puppet 7 anymore. |
|
Maybe you can define your password type Sensitive[String] ? |
|
@jiayuchen888 Password is defined as |
There was a problem hiding this comment.
Pull request overview
Updates password parameter types to support deferred secrets resolving to Sensitive.
Changes:
- Broadens database and role password types.
- Updates deferred-password acceptance coverage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
manifests/server/db.pp |
Accepts generic sensitive passwords. |
manifests/server/role.pp |
Broadens role password-hash input type. |
spec/acceptance/db_deferred_spec.rb |
Tests a deferred sensitive password. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@jst-cyr could you have a look at this, please? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
lib/puppet/functions/postgresql/prepend_sql_password.rb:13
- Doubling apostrophes is not sufficient when PostgreSQL runs with
standard_conforming_strings = off: a password such as\'; SUPERUSER; --can use the backslash to escape the first doubled quote and terminate the literal at the second. Build the literal with the existing dollar-quotingpostgresql::postgresql_escapefunction (handling the currently supported empty string explicitly), or use anE''literal and escape both backslashes and apostrophes; add a backslash-plus-quote regression case.
"ENCRYPTED PASSWORD '#{password.gsub("'", "''")}'"
|
Running CI tests for this PR here: #1699 |
|
@deric : Engineering will need to review when it comes up in the priority queue, but I'm happy to kick off some acceptance tests so that we can get some feedback and see how it runs on the different platforms. |
|
**Acceptance test results: ** https://github.com/puppetlabs/puppetlabs-postgresql/actions/runs/32730002205?pr=1699 All failures (Debian-13, CentOS-7, Scientific-7, OracleLinux-7, SLES-12) match pre-existing failures already on main. Mostly a systemd/D-Bus environment issue unrelated to this change. No new regressions introduced. All other platforms passed. So this PR doesn't seem to be introducing new issues, but this still requires an engineering review. |
Summary
I'm getting a strange error when passing
Deferredobject topassword_hashorpassword:Changes done in #1611 weren't enough.
Additional Context
Tested on Puppet
8.10.0, I'm unable to compile catalog withDeferredsecret returned from a function.I have a function that returns
DeferredobjectSince it's not possible to specify type for
Deferredobject, likeDeferred[String]orDeferred[Sensitive[String]]to only workaround remains relaxingSensitive[String]toSensitiveRelated Issues (if any)
Checklist
puppet apply)