Loheide-eu-mitarbeiterplatt.../app/Filament/Resources/IdentityProviders/Pages/TestMapping.php
Friederich Loheide 4fcc41ed30
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m41s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m48s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m15s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m17s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m48s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m26s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m59s
Phase 6 (Teil 2): OpenID Connect, LDAP/AD und SAML 2
- Gemeinsamer Treiber-Unterbau (App\Identity\IdentityDriver, IdentityDrivers,
  IdentityLogin, AttributeProfile); Entra ID nutzt ihn ebenfalls
- Plugins oidc, ldap und saml mit Profil- und Gruppen-Zuordnung
- Admin: Verfahren wählen, Formular je Verfahren, zuletzt empfangene Angaben
- onelogin/php-saml als neue Abhängigkeit

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 12:38:32 +00:00

51 lines
1.5 KiB
PHP

<?php
namespace App\Filament\Resources\IdentityProviders\Pages;
use App\Filament\Resources\IdentityProviders\IdentityProviderResource;
use App\Identity\Entra\MappingTester;
use App\Models\IdentityProvider;
use Filament\Resources\Pages\Concerns\InteractsWithRecord;
use Filament\Resources\Pages\Page;
use Throwable;
/**
* „Mapping testen“: zeigt für eine Person, welche Gruppen und App-Rollen Entra
* liefert und welche Rollen im Portal daraus entstehen.
*/
class TestMapping extends Page
{
use InteractsWithRecord;
protected static string $resource = IdentityProviderResource::class;
protected string $view = 'filament.pages.identity-test-mapping';
protected static ?string $title = 'Mapping testen';
public string $person = '';
/** @var array<string, mixed>|null */
public ?array $result = null;
public ?string $error = null;
public function mount(int|string $record): void
{
$this->record = $this->resolveRecord($record);
abort_unless($this->record->type === IdentityProvider::ENTRA, 404);
}
public function test(MappingTester $tester): void
{
$this->validate(['person' => ['required', 'string', 'max:255']], attributes: ['person' => 'E-Mail-Adresse']);
$this->result = null;
$this->error = null;
try {
$this->result = $tester->test($this->record, trim($this->person));
} catch (Throwable $e) {
$this->error = $e->getMessage();
}
}
}