Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-4908

pw_hash does not support Sensitive data type

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • None
    • None
    • stdlib
    • None
    • Needs Assessment

    Description

      The pw_hash function only accepts strings as inputs. This means that if you are using the Sensitive data type for passing passwords around (e.g. from hiera-eyaml), they need to be unwrapped before passing to pw_hash.

      This code:

      $password = Sensitive.new('hunter2')
      $salt     = Sensitive.new('wubbalubbadubdub')
      pw_hash($password,'SHA-512',$salt)
      

      Gives me this error:

      Error: Evaluation Error: Error while evaluating a Function Call, pw_hash(): first argument must be a string at /home/centos/test.pp:3:1 on node master.prod.puppet.com
      

      I would expect that it should just work™

      Attachments

        Activity

          People

            eric.putnam Eric Putnam
            dylan.ratcliffe Dylan Ratcliffe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support