Class: ServiceSkeleton::ConfigVariable::URL

Inherits:
ServiceSkeleton::ConfigVariable show all
Defined in:
lib/service_skeleton/config_variable/url.rb

Instance Attribute Summary

Attributes inherited from ServiceSkeleton::ConfigVariable

#name, #value

Instance Method Summary collapse

Methods inherited from ServiceSkeleton::ConfigVariable

#initialize, #method_name

Constructor Details

This class inherits a constructor from ServiceSkeleton::ConfigVariable

Instance Method Details

#redact!(env) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/service_skeleton/config_variable/url.rb', line 10

def redact!(env)
  if env.has_key?(@name.to_s)
    super
    uri = URI(env[@name.to_s])
    if uri.password
      uri.password = "*REDACTED*"
      env[@name.to_s] = uri.to_s
    end
  end
end

#redact?(env) ⇒ Boolean

Returns:



6
7
8
# File 'lib/service_skeleton/config_variable/url.rb', line 6

def redact?(env)
  !!(env.has_key?(@name.to_s) && (@opts[:sensitive] || URI(env[@name.to_s] || "").password))
end