- Implemented `EnumMorphsToOptionsContract` interface to enable enums with options and labels for dropdowns. - Created `SamlNameIdFormatEnum` and `SamlNameIdSourceEnum` for standardized SAML NameID configuration. - Added reusable `SAML Configuration` Blade component for easier integration into connected app forms. - Enabled custom SAML Attribute mapping with dynamic add/remove functionality and validation. - Improved `SamlIdpController` to enforce ACS URL matching and user authorization checks. - Refactored SAML-related tests and added scenarios for role-based SAML access and custom configurations.
35 lines
759 B
PHP
35 lines
759 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Contracts\EnumMorphsToOptionsContract;
|
|
|
|
enum SamlNameIdSourceEnum: string implements EnumMorphsToOptionsContract
|
|
{
|
|
case ImmutableId = 'immutable_id';
|
|
case UserIdLocal = 'id';
|
|
case Email = 'email';
|
|
|
|
public static function asOptions(): array
|
|
{
|
|
return array_map(
|
|
fn (self $enum) => [
|
|
'name' => $enum->toLabel(),
|
|
'value' => $enum->value,
|
|
],
|
|
self::cases()
|
|
);
|
|
}
|
|
|
|
public function toLabel(): string
|
|
{
|
|
return match ($this) {
|
|
self::ImmutableId => 'Immutable ID',
|
|
self::UserIdLocal => 'User ID (Local)',
|
|
self::Email => 'Email',
|
|
};
|
|
}
|
|
}
|