Sha256: c200304068fd656ddd82bf297e48287045794e31d5bf13cf30a6e0d35826f002
Contents?: true
Size: 522 Bytes
Versions: 3
Compression:
Stored size: 522 Bytes
Contents
module Auxilium module Grape class ParameterFilter class << self FILTER_REGEX = /password|token|api_key|Authorization/i def filter(hash, regex = FILTER_REGEX) hash = hash.dup hash.each do |k, v| hash[k] = '[FILTERED]' if k.to_s =~ FILTER_REGEX hash[k] = filter(v, regex) if v.is_a?(Hash) hash[k] = v.map { |v| v.is_a?(Hash) ? filter(v, regex) : v } if v.is_a?(Array) end hash end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
auxilium-3.0.31 | lib/auxilium/grape/parameter_filter.rb |
auxilium-3.0.30 | lib/auxilium/grape/parameter_filter.rb |
auxilium-3.0.24 | lib/auxilium/grape/parameter_filter.rb |