-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle non-permitted params when comparing rules to request body #1
base: master
Are you sure you want to change the base?
Conversation
@@ -25,10 +25,25 @@ | |||
end | |||
|
|||
context "when the request body does not adhere to the rules format" do | |||
let(:name) { 1_000 } | |||
context "when a non-specified parameter is included in the request body" do | |||
let(:params) { { name: "M@", email: "[email protected]" } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kurko do you think 'extra' params should simply be ignored, or should we actually mark the request as being invalid (this is what we're doing now).
Example:
Rules = { data: Hash }
# the `foo` param is not whitelisted
param = { data: {}, foo: "bar" }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignored, I think. strong parameters does that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The two examples below represent (1) ignoring them, not adding an error but filtering out the non-permitted param, or (2) adding an error as we do now in OTX.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kurko spoke with Jake about this: https://zipmark.slack.com/archives/C32CZ771B/p1490814011401531
No description provided.