[Action Cable] Add parameter filtering to logging#25090
[Action Cable] Add parameter filtering to logging#25090maclover7 wants to merge 1 commit intorails:masterfrom maclover7:jm-fix-25088
Conversation
maclover7
commented
May 21, 2016
- Reuses most of the architecture that Action Pack uses :)
- Fixes [ActionCable] No way to filter out any sensitive data which may be passed as an argument to the remote procedure over ws protocol.. #25088
|
This would be useful to have |
|
Sorry for my delay here -- updated my PR, and build should hopefully be passing now 👍 |
- Reuses most of the architecture that Action Pack uses :) - Fixes #25088
|
👍 Build is passing |
|
@maclover7 That's what I was looking for, do you think this is going to be merged in? @rafaelfranca cascasca 🍷 😂 |
rafaelfranca
left a comment
There was a problem hiding this comment.
I like the idea but I think a better direction is to make the ActionDispatch parameter filter generic enough to not need to not use the env object and headers so we don't need this data wrapper class.
A good design would have a object that given a hash and a list of keys to be filtered return the filtered hash.
|
Facing an issue similiar to #25088, I came up with a solution using Following @rafaelfranca suggestion, this implementation does not depend on a data wrapper class, the filter class used is generic enough and it is already part of Rails 😄. module ApplicationCable
class Channel < ActionCable::Channel::Base
def action_signature(action, data)
signature = "#{self.class.name}##{action}"
if (arguments = data.except('action')).any?
filter = ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters)
signature += "(#{filter.filter(arguments).inspect})"
end
signature
end
end
end |
|
Do you agree with @arthurdandrea 's approach to addressing #25088 ? I will be happy to volunteer / submit a PR for the same. Thanks. |
|
Howdy all :) do we have any thoughts on this on moving forward with the PR? |
|
What is the status of this PR? Rails has had ActionCable for a year now, but it still doesn't support filtering. |
|
Any update as of January 10th, 2018 ? |
|
Hi @maclover7 I realize this is old, but the first step to potentially getting this merged is cleaning up the merge conflicts so this can be viewed against latest master and discussed. Thanks for the PR 💝 |
|
Would love to see an update on this! |
|
Feel free to take over this PR and implement it. Now we are a generic parameter filter at |
|
I'm closing this since it is not going to be updated. |
|
@rafaelfranca Is this worth re-submitting? seems to still be an issue |