Actions
Refactor #18664
closedIgnore missing actions in SmartProxyAuth calls to skip_before_action
Description
The SmartProxyAuth controller concern is designed to work on both the UI and API base controller and calls skip_before_action
to skip require_login
and set_taxonomy
action filters. These are only present on the UI base controller though, but under Rails 5.0 this raises an exception:
gems/ruby-2.3.0@foreman/gems/activesupport-5.0.0/lib/active_support/callbacks.rb:641:in `block (2 levels) in skip_callback': Before process_action callback :require_login has not been defined (ArgumentError)
from gems/activesupport-5.0.0/lib/active_support/callbacks.rb:637:in `each'
from gems/activesupport-5.0.0/lib/active_support/callbacks.rb:637:in `block in skip_callback'
from gems/activesupport-5.0.0/lib/active_support/callbacks.rb:568:in `block in _update_callbacks'
from gems/activesupport-5.0.0/lib/active_support/callbacks.rb:566:in `reverse_each'
from gems/activesupport-5.0.0/lib/active_support/callbacks.rb:566:in `_update_callbacks'
from gems/activesupport-5.0.0/lib/active_support/callbacks.rb:636:in `skip_callback'
from gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:210:in `block (3 levels) in <module:ClassMethods>'
from gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:93:in `block in _insert_callbacks'
from gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:92:in `each'
from gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:92:in `_insert_callbacks'
from gems/actionpack-5.0.0/lib/abstract_controller/callbacks.rb:209:in `block (2 levels) in <module:ClassMethods>'
from app/controllers/concerns/foreman/controller/smart_proxy_auth.rb:9:in `add_smart_proxy_filters'
I think it's harmless enough to pass the raise => false
argument in on these two filters and ignore errors if the filters are undefined, since the concern has good test coverage. The concern is used in plugins too, so refactoring it into separate UI/API concerns may be disruptive.
Updated by The Foreman Bot almost 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/4332 added
Updated by Dominic Cleal almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset ba8f06a4d93761a5e4184b643c39120638f27839.
Updated by Dominic Cleal almost 8 years ago
- Translation missing: en.field_release set to 209
Actions