Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize the "env" data with Rails env data #15

Open
mnoack opened this issue Jan 25, 2018 · 0 comments
Open

Customize the "env" data with Rails env data #15

mnoack opened this issue Jan 25, 2018 · 0 comments

Comments

@mnoack
Copy link

mnoack commented Jan 25, 2018

Hi, I'm looking at using rest-client-components so we can filter out params which are sensitive (e.g. password). This is not to be confused with the "username:password@host" type thing which rest-client already does.

We figured the most logical approach is to hook into Rails's param filter (http://api.rubyonrails.org/classes/ActionDispatch/Http/ParameterFilter.html)

Given logging is middleware and this gem is recommended by rest-client for middleware I was looking at how to implement it.

It seems to be fairly logical BUT ParameterFilter relies on an @env variable called 'action_dispatch.parameter_filter' being setup. This exists globally in Rails.application.env_config

Having a look at how this gem sets up env:
https://github.com/crohr/rest-client-components/blob/master/lib/restclient/components.rb#L102

There's no real room to get your apps existing env and make that the default or override this default, etc.

Do you have any opinion on the ability for me to "merge" this env into your default env or how I would best go about this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant