Files
authentication_provider_pas…/lib/Module.php
T
Sebastian 3e921fc07e
Integration Tests / Integration Tests (pull_request) Successful in 52s
feat: pemissions
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-07-23 18:01:26 -04:00

94 lines
2.7 KiB
PHP

<?php
declare(strict_types=1);
namespace KTXM\AuthenticationProviderPassword;
use KTXC\Resource\ProviderManager;
use KTXF\Module\ModuleBrowserInterface;
use KTXF\Module\ModuleConsoleInterface;
use KTXF\Module\ModuleInstanceAbstract;
use KTXM\AuthenticationProviderPassword\Console\UserPasswordCommand;
/**
* Default Identity Provider Module
* Provides local database authentication
*/
class Module extends ModuleInstanceAbstract implements ModuleConsoleInterface, ModuleBrowserInterface
{
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'
],
'authentication_provider_password.admin.view' => [
'label' => 'View Password Status',
'description' => 'View whether another user has a password credential configured',
'group' => 'Authentication Providers'
],
'authentication_provider_password.admin.manage' => [
'label' => 'Manage User Passwords',
'description' => 'Set, reset, or remove password credentials for other users',
'group' => 'Authentication Providers'
],
];
}
public function boot(): void
{
$this->providerManager->register('authentication', 'password', Provider::class);
}
public function registerCI(): array
{
return [
UserPasswordCommand::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',
];
}
}