- Issue created by @altcom_neil
We use the Key module → to store authentication outside of the config, this feature adds support for using it in place of the key in config.
If the Key module is installed the api_key textfield in the admin is replace by the Key modules key_select element.
When the api_key is then used in calls to Mailgun\Mailgun:create it is first (if Key module installed) retrieved from the key entity.
There are two different methods in the code that are making calls to Mailgun\Mailgun:create, \Drupal\mailgun\MailgunFactory::create and \Drupal\mailgun\MailgunHandler::validateMailgunApiKey. Ideally there should be a single method that is making the create call - I guess logically it should be the MailgunFactory class?
If the Key module is installed the admin form shows Key's select field in place of the textfield.
The same config name is used 'api_key' and the code will fallback to just passing the api_key through if a Key entity cannot be loaded - this will allow the module to be updated for someone with the Key module but not suddenly stop the Mailgun API from connecting.
Active
2.0
Code