In my filter parameters initializer, I'm filtering out all password related parameters that matter already:
# config/initializers/filter_parameter_logging.rb
Rails.application.config.filter_parameters += [:password, :password_confirmation]
But more parameters are being filtered out than I'd expect. It looks like anything that has "password" in the name filtered from the logs.
{"password_invite_form"=>"[FILTERED]"}
Is there any way to prevent pattern matching for filtered parameters and match the precise parameters that I have set?
You can use a regular expression, rather than a string or symbol, if you want to explicitly control the pattern matching.
# config/initializers/filter_parameter_logging.rb
Rails.application.config.filter_parameters += [/^password$/, /^password_confirmation$/]
This will tell Rails to filter "password" and "password_confirmation" exactly, but not filter other parameters that contain "password" as a substring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With