Files
authentication_provider_mail/lib/Module.php
T
2026-08-31 22:55:11 -04:00

70 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
namespace KTXM\AuthenticationProviderMail;
use KTXC\Resource\ProviderManager;
use KTXF\Module\Configuration\BrowserModuleContextInterface;
use KTXF\Module\Configuration\ModuleContextInterface;
use KTXF\Module\ModuleInstanceAbstract;
/**
* Email Challenge Authentication Provider Module
* Provides email-based OTP authentication
*/
class Module extends ModuleInstanceAbstract
{
public function __construct(
private readonly ProviderManager $providerManager,
) {}
public function handle(): string
{
return 'authentication_provider_mail';
}
public function label(): string
{
return 'Mail Authentication Provider';
}
public function author(): string
{
return 'Ktrix';
}
public function description(): string
{
return 'Ktrix Email Authentication Provider - authenticates users via one-time codes sent to their email address';
}
public function version(): string
{
return '0.0.1';
}
public function permissions(): array
{
return [
'authentication_provider_mail' => [
'label' => 'Access Mail Authentication Provider',
'description' => 'View and access the mail authentication provider module',
'group' => 'Authentication Providers'
],
];
}
public function boot(): void
{
$this->providerManager->register('authentication', 'mail', Provider::class);
}
public function configure(ModuleContextInterface $context): void
{
if ($context instanceof BrowserModuleContextInterface) {
$context->registerModule($this, 'AuthenticationProviderEmail');
}
}
}