Project

General

Profile

Bug #21176

Plugin#parameter_filter doesn't work properly with block argument

Added by Ivan Necas about 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

In plugin api for rex, we had

parameter_filter(Nic::Interface, :execution)

This didn't work, because the filter works only for non-nested params (which nic isn't).
Therefore, we needed to use block instead.

parameter_filter Nic::Interface do |ctx|
  ctx.permit :execution      
end

The problem is, we're using filter.pop
https://github.com/theforeman/foreman/blob/616669d83b0f568bbe0bf13013de042bbf4f3951/app/services/foreman/parameter_filter.rb#L19
which leads to the rules to loosing the saved block at the first call, and leads to the rules to not actually apply.


Related issues

Blocks Foreman Remote Execution - Bug #21178: unable to set non-primary remote execution interfaceClosed2017-10-03

Associated revisions

Revision 44e3d9fe (diff)
Added by Ivan Necas about 3 years ago

Fixes #21176 - don't modify strong param filter rules

History

#1 Updated by The Foreman Bot about 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4886 added

#2 Updated by Ivan Necas about 3 years ago

  • Related to Bug #21178: unable to set non-primary remote execution interface added

#3 Updated by Ivan Necas about 3 years ago

  • Related to deleted (Bug #21178: unable to set non-primary remote execution interface)

#4 Updated by Ivan Necas about 3 years ago

  • Blocks Bug #21178: unable to set non-primary remote execution interface added

#5 Updated by Ivan Necas about 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Daniel Lobato Garcia about 3 years ago

  • Legacy Backlogs Release (now unused) set to 296

1.16 candidate?

Also available in: Atom PDF