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

69 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
namespace KTXM\AuthenticationProviderTotp;
use KTXC\Resource\ProviderManager;
use KTXF\Module\Configuration\BrowserModuleContextInterface;
use KTXF\Module\Configuration\ModuleContextInterface;
use KTXF\Module\ModuleInstanceAbstract;
/**
* TOTP Identity Provider Module
*/
class Module extends ModuleInstanceAbstract
{
public function __construct(
private readonly ProviderManager $providerManager,
) {}
public function handle(): string
{
return 'authentication_provider_totp';
}
public function label(): string
{
return 'TOTP Authentication Provider';
}
public function author(): string
{
return 'Ktrix';
}
public function description(): string
{
return 'Time-based One-Time Password (TOTP) authentication provider - compatible with FreeOTP, Google Authenticator, Authy, and similar apps';
}
public function version(): string
{
return '0.0.1';
}
public function permissions(): array
{
return [
'authentication_provider_totp' => [
'label' => 'Access TOTP Authentication Provider',
'description' => 'View and access the TOTP authentication provider module',
'group' => 'Authentication Providers'
],
];
}
public function boot(): void
{
$this->providerManager->register('authentication', 'totp', Provider::class);
}
public function configure(ModuleContextInterface $context): void
{
if ($context instanceof BrowserModuleContextInterface) {
$context->registerModule($this, 'AuthenticationProviderTotp', 'static/module.mjs');
}
}
}