Sha256: cffa4d9ed8956687e1eaa41d39880d5c728f0c4bae6c8b10c5d0f1b3b8a8ae13

Contents?: true

Size: 615 Bytes

Versions: 88

Compression:

Stored size: 615 Bytes

Contents

require File.join(File.dirname(__FILE__), '../../../../../../lib/kafo/password_manager')
# Decrypts an encrypted password using $kafo_configure::password
#
# you can use this function in order to place passwords into your config files
# in form of a plain text
module Puppet::Parser::Functions
  newfunction(:decrypt, :type => :rvalue) do |args|
    encrypted = args[0]
    if encrypted =~ /\A\$1\$/
      PasswordManager.new.aes_decrypt(encrypted[3..-1], lookupvar('::kafo_configure::password'))
    else
      raise Puppet::ParseError, 'wrong format of encrypted string, should start with $1$'
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
kafo-0.3.9 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.8 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.7 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.6 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.5 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.4 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.3 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.2 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.2.2 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.1 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.3.0 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.2.1 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.2.0 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.1.0 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.0.17 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.0.16 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.0.15 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.0.14 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.0.13 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb
kafo-0.0.12 modules/kafo_configure/lib/puppet/parser/functions/decrypt.rb