magento / security-package

Magento Security Extensions
Open Software License 3.0
73 stars 69 forks source link

Unable to Plugin to \Magento\TwoFactorAuth\Observer\ControllerActionPredispatch #296

Closed NathanDayFE closed 3 years ago

NathanDayFE commented 3 years ago

Preconditions (*)

  1. Magento 2.4

Steps to reproduce (*)

  1. Attempt to plugin to \Magento\TwoFactorAuth\Observer\ControllerActionPredispatch::execute will not work due to \Magento\TwoFactorAuth\TestFramework\ControllerActionPredispatch being a preference of it
  2. Attempt to plugin to \Magento\TwoFactorAuth\TestFramework\ControllerActionPredispatch will work in dev mode as interceptors are generated on the fly
  3. Switch to production mode and run setup:di:compile
  4. No interceptor is generated for \Magento\TwoFactorAuth\TestFramework\ControllerActionPredispatch becuase it has <VENDOR_MODULE>/Test in its filepath (excluded in \Magento\Setup\Module\Di\Code\Reader\ClassesScanner::extract)

Expected result (*)

  1. should be able to plugin to \Magento\TwoFactorAuth\Observer\ControllerActionPredispatch::execute

Actual result (*)

  1. Unable to plugin to method due to preference

Suggested solution

m2-assistant[bot] commented 3 years ago

Hi @NathanDayFE. Thank you for your report. To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


nathanjosiah commented 3 years ago

@magento export issue to Jira project MC as Bug

github-jira-sync-bot commented 3 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/MC-42905 is successfully created for this GitHub issue.

fredden commented 3 years ago

This has been fixed in https://github.com/magento/security-package/pull/297