singleloginsystem/app/Enums/ConnectionProtocolEnum.php
= a04bb5d7d1 Feat: Add modular application types, connection protocols, and dynamic app creation modal
- Introduced `ApplicationTypeEnum` and updated `ConnectionProtocolEnum` with labeled options, hints, and implementations for enhanced flexibility.
- Modularized the `apps` routes into a separate file for improved structure and maintainability.
- Added `CreateAppSelectionForm` Livewire component to handle app creation flows with dynamic protocol and type selection.
- Enhanced `connected-apps` UI with a modal-based app creation mechanism.
2026-06-17 12:46:25 +00:00

45 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Enums;
use App\Concerns\EnumValuesAsArray;
use App\Contracts\EnumMorphsToOptionsContract;
enum ConnectionProtocolEnum: string implements EnumMorphsToOptionsContract
{
use EnumValuesAsArray;
case OIDC = 'oidc';
case SAML = 'saml';
case URL = 'url';
public static function asOptions(): array
{
return array_map(fn (self $enum) => [
'name' => $enum->toLabel(),
'value' => mb_strtolower($enum->name),
'hint' => $enum->toHint(),
], self::cases());
}
public function toLabel(): string
{
return match ($this) {
self::OIDC => 'OIDC - OpenID Connect',
self::SAML => 'SAML 2.0',
self::URL => 'Redirect URL',
};
}
public function toHint(): string
{
return match ($this) {
self::OIDC => 'Modern authentication protocol built on OAuth 2.0 for secure user sign-in across web, mobile, and API-based applications.',
self::SAML => 'XML-based Single Sign-On (SSO) protocol commonly used by enterprise applications and identity providers',
self::URL => 'Simple URL that will redirect the user to the authentication page.',
};
}
}