Enable Discovery debug logging for production troubleshooting
- Add DISCOVERY_LOG_LEVEL=debug - Add DISCOVERY_SHOW_PROGRESS=true - Temporary changes for debugging InitializerProcessor fixes on production
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* ULID Validation Rule - Verwendungsbeispiele
|
||||
*
|
||||
* Die ULID Validation Rule verwendet den bestehenden UlidValidator
|
||||
* für konsistente ULID-Validierung nach dem offiziellen Standard.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Framework\Validation\Rules\Ulid;
|
||||
|
||||
// Basis ULID-Validierung
|
||||
class EntityRequest
|
||||
{
|
||||
public function __construct(
|
||||
#[Ulid]
|
||||
public readonly string $id,
|
||||
|
||||
#[Ulid]
|
||||
public readonly string $parentId,
|
||||
|
||||
#[Ulid(message: 'Die Benutzer-ID muss eine gültige ULID sein.')]
|
||||
public readonly string $userId,
|
||||
) {}
|
||||
}
|
||||
|
||||
// Verwendungsbeispiele:
|
||||
|
||||
// ✅ Gültige ULIDs
|
||||
$validExamples = [
|
||||
'id' => '01ARZ3NDEKTSV4RRFFQ69G5FAV',
|
||||
'parentId' => '01BX5ZZKBKACTAV9WEVGEMMVRY',
|
||||
'userId' => '01CA2ZZKBKACTAV9WEVGEMMVRY',
|
||||
];
|
||||
|
||||
// ❌ Ungültige ULIDs
|
||||
$invalidExamples = [
|
||||
'id' => '01ARZ3NDEKTSV4RRFFQ69G5F', // Zu kurz (25 statt 26 Zeichen)
|
||||
'parentId' => '01ARZ3NDEKTSV4RRFFQ69G5FAVX', // Zu lang (27 Zeichen)
|
||||
'userId' => '01ARZ3NDEKTSV4RRFFQ69G5FIV', // Enthält 'I' (nicht erlaubt)
|
||||
];
|
||||
|
||||
/**
|
||||
* ULID (Universally Unique Lexicographically Sortable Identifier) Standard:
|
||||
*
|
||||
* Format: 26 Zeichen in Crockford Base32 Encoding
|
||||
* - Erste 10 Zeichen: Zeitstempel (48-bit Unix-Zeit in Millisekunden)
|
||||
* - Letzte 16 Zeichen: Zufälliger Teil (80-bit Entropie)
|
||||
*
|
||||
* Erlaubte Zeichen (Crockford Base32):
|
||||
* 0123456789ABCDEFGHJKMNPQRSTVWXYZ
|
||||
*
|
||||
* Nicht erlaubte Zeichen (um Verwechslungen zu vermeiden):
|
||||
* - I (sieht wie 1 aus)
|
||||
* - L (sieht wie 1 aus)
|
||||
* - O (sieht wie 0 aus)
|
||||
* - U (kann wie V aussehen)
|
||||
*
|
||||
* Eigenschaften von ULIDs:
|
||||
* ✅ Lexikographisch sortierbar (chronologische Ordnung)
|
||||
* ✅ URL-sicher (keine Sonderzeichen)
|
||||
* ✅ Case-insensitive (obwohl üblicherweise Großbuchstaben verwendet werden)
|
||||
* ✅ Monotonisch (innerhalb derselben Millisekunde aufsteigend)
|
||||
* ✅ Kompakt (26 Zeichen vs. 36 für UUID mit Bindestrichen)
|
||||
*
|
||||
* Validierungsregeln:
|
||||
* - Exakt 26 Zeichen
|
||||
* - Nur Crockford Base32 Zeichen
|
||||
* - Keine Leer- oder Sonderzeichen
|
||||
* - Case-sensitive (üblicherweise Großbuchstaben)
|
||||
*
|
||||
* Beispiele für gültige ULIDs:
|
||||
* - 01ARZ3NDEKTSV4RRFFQ69G5FAV (Standard-Format)
|
||||
* - 00000000000000000000000000 (Minimum ULID)
|
||||
* - 7ZZZZZZZZZZZZZZZZZZZZZZZZZ (Maximum timestamp)
|
||||
* - GGGGGGGGGGGGGGGGGGGGGGGGGG (Alle G's - technisch gültig)
|
||||
*/
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* URL Validation Rule - Verwendungsbeispiele
|
||||
*
|
||||
* Die URL Validation Rule verwendet das bestehende Url Value Object
|
||||
* für konsistente und umfassende URL-Validierung.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use App\Framework\Validation\Rules\Url;
|
||||
|
||||
// Basis URL-Validierung
|
||||
class UserProfileRequest
|
||||
{
|
||||
public function __construct(
|
||||
#[Url]
|
||||
public readonly string $website,
|
||||
|
||||
#[Url(requireSecure: true)]
|
||||
public readonly string $secureUrl,
|
||||
|
||||
#[Url(allowLocal: false)]
|
||||
public readonly string $publicUrl,
|
||||
|
||||
#[Url(autoAddProtocol: true)]
|
||||
public readonly string $flexibleUrl,
|
||||
|
||||
#[Url(
|
||||
requireSecure: true,
|
||||
allowLocal: false,
|
||||
message: 'Bitte geben Sie eine gültige HTTPS-URL ein, die öffentlich erreichbar ist.'
|
||||
)]
|
||||
public readonly string $strictUrl,
|
||||
) {}
|
||||
}
|
||||
|
||||
// Verwendungsbeispiele:
|
||||
|
||||
// ✅ Gültige URLs
|
||||
$validExamples = [
|
||||
'website' => 'https://example.com',
|
||||
'secureUrl' => 'https://secure.example.com',
|
||||
'publicUrl' => 'https://public.example.com',
|
||||
'flexibleUrl' => 'example.com', // Wird zu https://example.com
|
||||
'strictUrl' => 'https://production.example.com',
|
||||
];
|
||||
|
||||
// ❌ Ungültige URLs
|
||||
$invalidExamples = [
|
||||
'website' => 'not-a-url', // Kein gültiges URL-Format
|
||||
'secureUrl' => 'http://insecure.com', // Nicht HTTPS
|
||||
'publicUrl' => 'https://localhost', // Lokale URL nicht erlaubt
|
||||
'flexibleUrl' => 'ftp://files.com', // FTP nicht HTTP/HTTPS
|
||||
'strictUrl' => 'http://localhost', // Nicht sicher UND lokal
|
||||
];
|
||||
|
||||
/**
|
||||
* Die URL Validation Rule unterstützt verschiedene Konfigurationen:
|
||||
*
|
||||
* @param bool $requireSecure - Nur HTTPS URLs erlauben
|
||||
* @param bool $allowLocal - Lokale URLs (localhost, 192.168.x.x) erlauben
|
||||
* @param bool $autoAddProtocol - Automatisch https:// hinzufügen wenn fehlt
|
||||
* @param string|null $message - Benutzerdefinierte Fehlermeldung
|
||||
*
|
||||
* Validierungsregeln des Url Value Objects:
|
||||
* - Gültiges URL-Format (parse_url() erfolgreich)
|
||||
* - Scheme und Host erforderlich
|
||||
* - Unterstützte Schemes: http, https, ftp, ftps, ssh, file, data
|
||||
* - Host max. 253 Zeichen
|
||||
* - Keine ungültigen Zeichen im Host: Leerzeichen, <, >, ", '
|
||||
* - Keine aufeinanderfolgenden Punkte im Host
|
||||
* - Host darf nicht mit Punkt oder Bindestrich beginnen/enden
|
||||
* - IP-Adressen werden validiert (filter_var FILTER_VALIDATE_IP)
|
||||
* - Ports müssen zwischen 1-65535 liegen
|
||||
* - Keine Leer-URLs (nur Schema ohne Host)
|
||||
* - Keine führenden/nachgestellten Leerzeichen
|
||||
* - Max. 2048 Zeichen Gesamtlänge
|
||||
*/
|
||||
Reference in New Issue
Block a user