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

Handle non-permitted params when comparing rules to request body #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mecampbellsoup
Copy link
Contributor

No description provided.

@@ -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]" } }
Copy link
Contributor Author

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" }

Copy link

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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