Puppet Function: htpasswd

Defined in:
modules/wmflib/lib/puppet/parser/functions/htpasswd.rb
Function type:
Ruby 3.x API

Overview

htpasswd()Any

Returns:

  • (Any)


13
14
15
16
17
18
19
# File 'modules/wmflib/lib/puppet/parser/functions/htpasswd.rb', line 13

newfunction(:htpasswd, :type => :rvalue, :arity => 2) do |args|
  if args[1].length != 8
    fail(ArgumentError, 'htpasswd(): salt must be 8 characters')
  end
  generator = PuppetX::Wmflib::Apr1Md5.new args[1]
  generator.encode args[0]
end