class Pact::Hal::AuthorizationHeaderRedactor

Attributes

redactions[R]

Public Instance Methods

<<(*args) click to toggle source
# File lib/pact/hal/authorization_header_redactor.rb, line 14
def <<(*args)
  __getobj__().send(:<<, *redact_args(args))
end
print(*args) click to toggle source
puts(*args) click to toggle source
# File lib/pact/hal/authorization_header_redactor.rb, line 6
def puts(*args)
  __getobj__().puts(*redact_args(args))
end

Private Instance Methods

redact(string) click to toggle source
# File lib/pact/hal/authorization_header_redactor.rb, line 26
def redact(string)
  return string unless string.is_a?(String)
  string.gsub(/Authorization: .*\\r\\n/, "Authorization: [redacted]\\r\\n")
end
redact_args(args) click to toggle source
# File lib/pact/hal/authorization_header_redactor.rb, line 22
def redact_args(args)
  args.collect{ | s| redact(s) }
end