Module: Puppet::Network::Uri

Included in:
ModuleTool::Applications::Installer
Defined in:
lib/puppet/network/uri.rb

Overview

This module holds funtions for network URI's

Instance Method Summary collapse

Instance Method Details

#mask_credentials(uri) ⇒ String

Mask credentials in given URI or address as string. Resulting string will contain '***' in place of password. It will only be replaced if actual password is given.


9
10
11
12
13
14
15
16
17
# File 'lib/puppet/network/uri.rb', line 9

def mask_credentials(uri)
  if uri.is_a? URI
    uri = uri.dup
  else
    uri = URI.parse(uri)
  end
  uri.password = '***' unless uri.password.nil?
  uri.to_s
end