refactor(module): register integrations through runtime contexts

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-08-31 22:40:52 -04:00
parent d98a05be19
commit 724d3fd4b8
+7 -11
View File
@@ -5,14 +5,15 @@ declare(strict_types=1);
namespace KTXM\AuthenticationProviderMail; namespace KTXM\AuthenticationProviderMail;
use KTXC\Resource\ProviderManager; use KTXC\Resource\ProviderManager;
use KTXF\Module\ModuleBrowserInterface; use KTXF\Module\Configuration\BrowserModuleContextInterface;
use KTXF\Module\Configuration\ModuleContextInterface;
use KTXF\Module\ModuleInstanceAbstract; use KTXF\Module\ModuleInstanceAbstract;
/** /**
* Email Challenge Authentication Provider Module * Email Challenge Authentication Provider Module
* Provides email-based OTP authentication * Provides email-based OTP authentication
*/ */
class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface class Module extends ModuleInstanceAbstract
{ {
public function __construct( public function __construct(
private readonly ProviderManager $providerManager, private readonly ProviderManager $providerManager,
@@ -59,15 +60,10 @@ class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
$this->providerManager->register('authentication', 'mail', Provider::class); $this->providerManager->register('authentication', 'mail', Provider::class);
} }
public function registerBI(): array public function configure(ModuleContextInterface $context): void
{ {
return [ if ($context instanceof BrowserModuleContextInterface) {
'handle' => $this->handle(), $context->registerModule($this, 'AuthenticationProviderEmail');
'namespace' => 'AuthenticationProviderEmail', }
'version' => $this->version(),
'label' => $this->label(),
'author' => $this->author(),
'description' => $this->description(),
];
} }
} }