- 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.
42 lines
1.2 KiB
PHP
42 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Contracts\EnumMorphsToOptionsContract;
|
|
|
|
enum ApplicationTypeEnum: string implements EnumMorphsToOptionsContract
|
|
{
|
|
case Web = 'web';
|
|
case SPA = 'spa';
|
|
// case Machine = 'machine';
|
|
|
|
public static function asOptions(): array
|
|
{
|
|
return array_map(fn (self $enum) => [
|
|
'name' => $enum->toLabel(),
|
|
'value' => $enum->value,
|
|
'hint' => $enum->toHint(),
|
|
], self::cases());
|
|
}
|
|
|
|
public function toLabel(): string
|
|
{
|
|
return match ($this) {
|
|
self::Web => 'Web Applications',
|
|
self::SPA => 'Single Page Applications',
|
|
// self::Machine => 'Microservices',
|
|
};
|
|
}
|
|
|
|
public function toHint(): string
|
|
{
|
|
return match ($this) {
|
|
self::Web => 'Server-side rendered web application, where authentication is handled by the server.',
|
|
self::SPA => 'Single Page Application where client side framework e.g. React, Vue, Angular is used, and gets the authentication token from the server.',
|
|
// self::Machine => 'Application that runs on a machine, e.g. a serverless function, or a container.',
|
|
};
|
|
}
|
|
}
|