Class: ServiceSkeleton::ConfigVariable::URL
Instance Attribute Summary
#name, #value
Instance Method Summary
collapse
#initialize, #method_name
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
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
|