74 lines
1.8 KiB
PHP
74 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXM\AuthenticationProviderPassword;
|
|
|
|
use KTXC\Resource\ProviderManager;
|
|
use KTXF\Module\ModuleInstanceAbstract;
|
|
|
|
/**
|
|
* Default Identity Provider Module
|
|
* Provides local database authentication
|
|
*/
|
|
class Module extends ModuleInstanceAbstract
|
|
{
|
|
public function __construct(
|
|
private readonly ProviderManager $providerManager,
|
|
) {}
|
|
|
|
public function handle(): string
|
|
{
|
|
return 'authentication_provider_password';
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return 'Password Authentication Provider';
|
|
}
|
|
|
|
public function author(): string
|
|
{
|
|
return 'Ktrix';
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'Ktrix Password Authentication Provider - authenticates users against credentials stored in the database';
|
|
}
|
|
|
|
public function version(): string
|
|
{
|
|
return '0.0.1';
|
|
}
|
|
|
|
public function permissions(): array
|
|
{
|
|
return [
|
|
'authentication_provider_password' => [
|
|
'label' => 'Access Password Authentication Provider',
|
|
'description' => 'View and access the password authentication provider module',
|
|
'group' => 'Authentication Providers'
|
|
],
|
|
];
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->providerManager->register('authentication', 'password', Provider::class);
|
|
}
|
|
|
|
public function registerBI(): array
|
|
{
|
|
return [
|
|
'handle' => $this->handle(),
|
|
'namespace' => 'AuthenticationProviderPassword',
|
|
'version' => $this->version(),
|
|
'label' => $this->label(),
|
|
'author' => $this->author(),
|
|
'description' => $this->description(),
|
|
'boot' => 'static/module.mjs',
|
|
];
|
|
}
|
|
}
|