Add CorsRegexEnvProcessor and corresponding tests

- Implemented CorsRegexEnvProcessor to build CORS origin regex from a comma-separated host list (ALLOWED_FRONTEND_HOSTS).
- Added tests for CorsRegexEnvProcessor to validate regex generation and matching behavior.
- Created JSON files for AST representation of the new classes and tests.
This commit is contained in:
hamed
2026-07-07 14:58:41 +03:30
parent 4ee1524f31
commit 87f4d1695f
18 changed files with 2536 additions and 1343 deletions
+2 -2
View File
@@ -22,8 +22,8 @@ JWT_PASSPHRASE=CHANGE_ME_STRONG_PASSPHRASE
###< lexik/jwt-authentication-bundle ###
###> nelmio/cors-bundle ###
# regex است (origin_regex: true). همهٔ دامنه‌های عمومی چند-شهری «<city>-nobat.ir» و پنل «clinic-pro.ir» را پوشش می‌دهد.
CORS_ALLOW_ORIGIN='^https://([a-z0-9-]+\.)*([a-z0-9-]+-nobat\.ir|clinic-pro\.ir)$'
# رجکسِ CORS در PHP از روی ALLOWED_FRONTEND_HOSTS ساخته می‌شود (CorsRegexEnvProcessor).
# CORS_ALLOW_ORIGIN دیگر استفاده نمی‌شود — ست نکن.
###< nelmio/cors-bundle ###
###> symfony/messenger ###