Skip to content

Apply #whitelist_payload_shape and #filter_parameters at the same time#136

Merged
UberMouse merged 1 commit intoMindscapeHQ:masterfrom
blacklane:filter_parameters_and_whitelist
Dec 17, 2018
Merged

Apply #whitelist_payload_shape and #filter_parameters at the same time#136
UberMouse merged 1 commit intoMindscapeHQ:masterfrom
blacklane:filter_parameters_and_whitelist

Conversation

@lipanski
Copy link
Contributor

@lipanski lipanski commented Dec 14, 2018

We have a use case where we'd like to apply both whitelist_payload_shape and the filter_parameters at the same time: we use whitelist_payload_shape to filter out the Authorization header from requests, while we use filter_parameters for regular form & query fields.

As a workaround, we extended our whitelist_payload_shape to also filter out form & query fields but it looks pretty ugly, especially because we have to copy over the filter_params_with_blacklist and filter_params_with_array logic into our code base. I was wondering why the two configurations are mutually exclusive and I couldn't see a reason why, hence my PR.

What do you think?

@UberMouse
Copy link
Contributor

I'm sitting here racking my brain trying to remember why I implemented it this way, but I can't think of any reason to keep the current behavior. It does make more sense to give you the option to filter using both methods, so I'll be merging this. Thanks for bringing it to my attention.

@UberMouse UberMouse merged commit 455eb41 into MindscapeHQ:master Dec 17, 2018
@lipanski
Copy link
Contributor Author

@UberMouse thanks! will you make a gem release any time soon?

@UberMouse
Copy link
Contributor

I made the gem release yesterday. I bumped it to 3.0.0 as it's technically a breaking change

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

Successfully merging this pull request may close these issues.

2 participants