singleloginsystem/app/Enums/ConnectionProtocolEnum.php
= 7f02209631 Feat: Add OIDC app creation feature with access URL support, Hide SAML, Microservice
- Introduced tests for OIDC app creation, including validation for access URL formatting.
- Updated enums and services to streamline application type and protocol handling.
- Added `accessUrl` support across backend, services, and UI to enhance app functionality and user accessibility.
- Refactored and commented out unused enum values and providers to improve maintainability.
2026-06-22 05:54:36 +00:00

45 lines
1.3 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. E.g. Keka, Outlook, etc.',
};
}
}