From 8b30f8161cc30f67b8ba8aae765eea7cf765fc28 Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Tue, 10 Feb 2026 20:02:11 -0500 Subject: [PATCH] Initial commit --- lib/Module.php | 69 ++++++++++++++++---------------------------------- 1 file changed, 22 insertions(+), 47 deletions(-) diff --git a/lib/Module.php b/lib/Module.php index fac7551..0f4e0aa 100644 --- a/lib/Module.php +++ b/lib/Module.php @@ -5,19 +5,19 @@ declare(strict_types=1); namespace KTXM\AuthenticationProviderOidc; use KTXC\Resource\ProviderManager; -use DI\Attribute\Inject; +use KTXF\Module\ModuleBrowserInterface; use KTXF\Module\ModuleInstanceAbstract; /** * OpenID Connect Identity Provider Module * Provides SSO authentication via OIDC protocol */ -class Module extends ModuleInstanceAbstract +class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface { public function __construct( private readonly ProviderManager $providerManager, - #[Inject('rootDir')] private readonly string $rootDir, ) {} + public function handle(): string { return 'authentication_provider_oidc'; @@ -40,50 +40,7 @@ class Module extends ModuleInstanceAbstract public function version(): string { - return '1.0.0'; - } - - public function boot(): void - { - // Register the provider with the provider manager - $this->providerManager->register('authentication', 'oidc', Provider::class); - } - - public function install(): void - { - // Create cache directory for OIDC state - $cacheDir = $this->rootDir . '/var/cache/oidc_state'; - if (!is_dir($cacheDir)) { - mkdir($cacheDir, 0755, true); - } - } - - public function uninstall(): void - { - // Optionally clean up cache - } - - public function enable(): void - { - // Provider is registered on boot - } - - public function disable(): void - { - // Nothing to do - provider not registered when module is disabled - } - - public function bootUi(): array - { - return [ - 'handle' => $this->handle(), - 'namespace' => 'AuthenticationProviderOidc', - 'version' => $this->version(), - 'label' => $this->label(), - 'author' => $this->author(), - 'description' => $this->description(), - 'boot' => 'static/module.mjs', - ]; + return '0.0.1'; } public function permissions(): array @@ -96,4 +53,22 @@ class Module extends ModuleInstanceAbstract ], ]; } + + public function boot(): void + { + $this->providerManager->register('authentication', 'oidc', Provider::class); + } + + public function registerBI(): array + { + return [ + 'handle' => $this->handle(), + 'namespace' => 'AuthenticationProviderOidc', + 'version' => $this->version(), + 'label' => $this->label(), + 'author' => $this->author(), + 'description' => $this->description(), + 'boot' => 'static/module.mjs', + ]; + } }