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

Chore: avoid misleading "Unpermitted parameters: xxx" message log #15664

Merged
merged 4 commits into from
May 27, 2024

Conversation

cbliard
Copy link
Member

@cbliard cbliard commented May 24, 2024

When PermittedParams#settings was called, it was not permitting any params, which lead to "Unpermitted parameters: ..." messages being logged, and then merged the resulting empty params with the controller params after having filtered them manually. It was ok-ish but the logged error message was misleading.

The #settings method was refactored to permit params that are allowed in a single step and avoid the misleading log messages.

The rubocop linting has been put in a separate commit for easier reviewing.

cbliard added 2 commits May 24, 2024 17:42
When `PermittedParams#settings` was called, it was not permitting any
params, which lead to "Unpermitted parameters: ..." messages being
logged, and then merged the resulting empty params with the controller
params after having filtered them manually. It was ok-ish but the logged
error message was misleading.

The `#settings` method was refactored to permit params that are allowed
in a single step and avoid the misleading log messages.
@cbliard cbliard requested a review from ulferts May 24, 2024 15:56
cbliard and others added 2 commits May 27, 2024 09:10
`ActionController::Parameters#permit` takes a list of filters. There is
no kwargs argument.

Co-authored-by: Klaus Zanders <k.zanders@openproject.com>
"attachment_whitelist" is normally permitted as an array parameter, but
the form passes it as a string parameter to be split. This commit adds a
way to also permit parameters such as "attachment_whitelist" as a string
parameter.
@cbliard cbliard force-pushed the fix/avoid_unpermitted_errors_logged branch from 84a4a9d to b2f0a33 Compare May 27, 2024 07:55
@cbliard cbliard merged commit 2c06ed3 into dev May 27, 2024
9 checks passed
@cbliard cbliard deleted the fix/avoid_unpermitted_errors_logged branch May 27, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants