Skip to content

Conversation

@deric
Copy link
Collaborator

@deric deric commented Nov 25, 2025

Summary

I'm getting a strange error when passing Deferred object to password_hash or password:

parameter 'password_hash' expects a value of type Boolean, String, or Sensitive[String], got Sensitive

Changes done in #1611 weren't enough.

Additional Context

Tested on Puppet 8.10.0, I'm unable to compile catalog with Deferred secret returned from a function.

I have a function that returns Deferred object

function vault::kv(String $key, Hash $opts = {}) >> Deferred {
  Deferred(
    'vault_lookup::lookup',
    ["kv/data/${key}", $_opts]
  )
}

Since it's not possible to specify type for Deferred object, like Deferred[String] or Deferred[Sensitive[String]] to only workaround remains relaxing Sensitive[String] to Sensitive

    postgresql::server::db { 'mydb':
      user     => 'dbuser',
      password => vault::kv('db/password'),
    }

Related Issues (if any)

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

@deric deric marked this pull request as draft November 26, 2025 09:34
@deric deric marked this pull request as ready for review November 26, 2025 16:18
@deric
Copy link
Collaborator Author

deric commented Nov 26, 2025

Test failures seems to be unrelated. Upstream fixtures modules doesn't seem to support Puppet 7 anymore.

@jiayuchen888
Copy link

Maybe you can define your password type Sensitive[String] ?

@deric
Copy link
Collaborator Author

deric commented Dec 9, 2025

@jiayuchen888 Password is defined as Sensitive[String], yet it doesn't work. As you can see currently there is no test for passing Sensitive[String].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants