Skip to content

Plugin for MagentoSetupModelConfigOptionsList::validate

Is it possible to make a plugin for MagentoSetupModelConfigOptionsList::validate()?
This function checks the validity of connection to DB and since I am dynamically generating password for DB, I need to intercept the $options argument and pass my own password.
I tried doing it the normal way:

<type name="MagentoSetupModelConfigOptionsList">
        <plugin name="vendor_dynamic_password_plugin" sortOrder="1" type="VendorModulePluginDynamicPasswordPlugin"/>
</type>

The plugin:

public function beforeValidate(ConfigOptionsList $subject, array $options, DeploymentConfig $deploymentConfig)
    {
        dd('it works!');
        return [$options, $deploymentConfig];
    }

But unfortunately this doesn’t work. This will not even generate the interceptor. I know I could use the --skip-db-validation argument, but I don’t want to bypass the internal DB validation.
Thank you