Phase 0: Fundament für Inhaus
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 1m14s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 1m12s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 1m7s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 1m19s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 1m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 1m22s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 1m32s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 1m35s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m7s

- Laravel 13 mit Filament 5 (Admin), Inertia 3 + Vue 3 + Vuetify 4 (Material 3)
- Anmeldung über Fortify (Login, Passwort vergessen/ändern), keine Selbstregistrierung
- Profil mit Profilbild (WebP in festen Größen), Personenseiten, Header mit Avatar-Menü
- Material-3-Farbschema aus der Primärfarbe, hell/dunkel/System pro Person
- Basis-Branding (Portalname, Logo, Primärfarbe) im Admin unter „Erscheinungsbild“
- Benutzerverwaltung im Admin, Zugang vorläufig über is_admin
- vendor/ (ohne Dev-Pakete) und Frontend-Build mitversioniert, Dev-Pakete in vendor-dev/
- PHPUnit-Tests gegen MySQL/MariaDB, Forgejo-CI-Matrix, Docker-Entwicklungsumgebung
- VERSION, CHANGELOG.md und CONTRIBUTING.md mit Release-Ablauf

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-25 20:35:30 +00:00
parent 7197eaebf2
commit 9c0f8de791
15771 changed files with 1564103 additions and 5 deletions

View file

@ -0,0 +1,55 @@
<?php
declare(strict_types=1);
namespace Laravel\Passkeys\Support;
/**
* AAGUID to authenticator name mapping.
*
* @see https://github.com/passkeydeveloper/passkey-authenticator-aaguids
*/
class Aaguids
{
/**
* The cached AAGUID to name mapping.
*
* @var array<string, string>|null
*/
protected static ?array $aaguids = null;
/**
* Get the authenticator label for the given AAGUID.
*/
public static function labelFor(string $aaguid): ?string
{
return static::all()[$aaguid] ?? null;
}
/**
* Get the unknown AAGUID value.
*/
public static function unknown(): string
{
return '00000000-0000-0000-0000-000000000000';
}
/**
* Get all AAGUID to name mappings.
*
* @return array<string, string>
*/
public static function all(): array
{
/** @var array<string, string> */
return static::$aaguids ??= require __DIR__.'/../../resources/aaguids.php';
}
/**
* Flush the cached AAGUIDs.
*/
public static function flush(): void
{
static::$aaguids = null;
}
}

View file

@ -0,0 +1,151 @@
<?php
declare(strict_types=1);
namespace Laravel\Passkeys\Support;
use Laravel\Passkeys\Passkeys;
use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\SerializerInterface;
use UnexpectedValueException;
use Webauthn\AttestationStatement\AttestationStatementSupportManager;
use Webauthn\AttestationStatement\NoneAttestationStatementSupport;
use Webauthn\AuthenticatorAssertionResponseValidator;
use Webauthn\AuthenticatorAttestationResponseValidator;
use Webauthn\CeremonyStep\CeremonyStepManagerFactory;
use Webauthn\Denormalizer\WebauthnSerializerFactory;
/**
* This class provides a static interface to the webauthn-lib package, handling
* serialization, deserialization, and validation of WebAuthn ceremonies.
*/
final class WebAuthn
{
/**
* The cached serializer instance.
*/
private static ?SerializerInterface $serializer = null;
/**
* The cached attestation statement support manager.
*/
private static ?AttestationStatementSupportManager $attestationStatementSupportManager = null;
/**
* Serialize data to JSON.
*/
public static function toJson(mixed $data): string
{
return self::serializer()->serialize($data, 'json');
}
/**
* Serialize data to a browser-facing array, omitting null values.
*
* @return array<array-key, mixed>
*/
public static function toBrowserArray(mixed $data): array
{
$serializer = self::serializer();
assert($serializer instanceof NormalizerInterface);
$normalized = $serializer->normalize($data, 'json', [
AbstractObjectNormalizer::SKIP_NULL_VALUES => true,
]);
if (! is_array($normalized)) {
throw new UnexpectedValueException('Serialized WebAuthn data must normalize to an array.');
}
return $normalized;
}
/**
* Deserialize JSON to a specific class.
*
* @template T of object
*
* @param class-string<T> $class
* @return T
*/
public static function fromJson(string $json, string $class): mixed
{
return self::serializer()->deserialize($json, $class, 'json');
}
/**
* Create the attestation response validator for registration ceremonies.
*/
public static function attestationValidator(): AuthenticatorAttestationResponseValidator
{
return AuthenticatorAttestationResponseValidator::create(
ceremonyStepManager: self::ceremonyStepManagerFactory()->creationCeremony()
);
}
/**
* Create the assertion response validator for verification ceremonies.
*/
public static function assertionValidator(): AuthenticatorAssertionResponseValidator
{
return AuthenticatorAssertionResponseValidator::create(
ceremonyStepManager: self::ceremonyStepManagerFactory()->requestCeremony()
);
}
/**
* Get or create the ceremony step manager factory.
*/
private static function ceremonyStepManagerFactory(): CeremonyStepManagerFactory
{
$factory = new CeremonyStepManagerFactory;
$factory->setAllowedOrigins(Passkeys::allowedOrigins());
$factory->setAttestationStatementSupportManager(
self::attestationStatementSupportManager()
);
return $factory;
}
/**
* Get or create the attestation statement support manager.
*
* Only "none" attestation is registered, so we accept passkeys without
* verifying hardware attestation certificates from the authenticator.
*/
private static function attestationStatementSupportManager(): AttestationStatementSupportManager
{
if (! self::$attestationStatementSupportManager instanceof AttestationStatementSupportManager) {
self::$attestationStatementSupportManager = AttestationStatementSupportManager::create();
self::$attestationStatementSupportManager->add(NoneAttestationStatementSupport::create());
}
return self::$attestationStatementSupportManager;
}
/**
* Get or create the serializer instance.
*/
private static function serializer(): SerializerInterface
{
if (! self::$serializer instanceof SerializerInterface) {
self::$serializer = (new WebauthnSerializerFactory(
self::attestationStatementSupportManager()
))->create();
}
return self::$serializer;
}
/**
* Reset the cached instances (useful for testing).
*/
public static function flush(): void
{
self::$serializer = null;
self::$attestationStatementSupportManager = null;
}
}