Class Index [+]

Quicksearch

ActionDispatch::Http::FilterParameters

Allows you to specify sensitive parameters which will be replaced from the request log by looking in all subhashes of the param hash for keys to filter. If a block is given, each key and value of the parameter hash and all subhashes is passed to it, the value or key can be replaced using String#replace or similar method.

Examples:

  env["action_dispatch.parameter_filter"] = [:password]
  => replaces the value to all keys matching /password/i with "[FILTERED]"

  env["action_dispatch.parameter_filter"] = [:foo, "bar"]
  => replaces the value to all keys matching /foo|bar/i with "[FILTERED]"

  env["action_dispatch.parameter_filter"] = lambda do |k,v|
    v.reverse! if k =~ /secret/i
  end
  => reverses the value to all keys matching /secret/i

Public Instance Methods

filtered_env() click to toggle source

Return a hash of request.env with all sensitive data replaced.

    # File lib/action_dispatch/http/filter_parameters.rb, line 37
37:       def filtered_env
38:         @filtered_env ||= env_filter.filter(@env)
39:       end
filtered_parameters() click to toggle source

Return a hash of parameters with all sensitive data replaced.

    # File lib/action_dispatch/http/filter_parameters.rb, line 32
32:       def filtered_parameters
33:         @filtered_parameters ||= parameter_filter.filter(parameters)
34:       end

Protected Instance Methods

env_filter() click to toggle source
    # File lib/action_dispatch/http/filter_parameters.rb, line 47
47:       def env_filter
48:         parameter_filter_for(Array.wrap(@env["action_dispatch.parameter_filter"]) << /RAW_POST_DATA/)
49:       end
parameter_filter() click to toggle source
    # File lib/action_dispatch/http/filter_parameters.rb, line 43
43:       def parameter_filter
44:         parameter_filter_for(@env["action_dispatch.parameter_filter"])
45:       end
parameter_filter_for(filters) click to toggle source
    # File lib/action_dispatch/http/filter_parameters.rb, line 51
51:       def parameter_filter_for(filters)
52:         @@parameter_filter_for[filters] ||= ParameterFilter.new(filters)
53:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.