feat: add BlogBodySanitizer for HTML sanitization on article save

- Implemented BlogBodySanitizer to clean HTML content before saving articles, ensuring security against XSS attacks.
- Added tests for BlogBodySanitizer to verify that unsafe tags and attributes are stripped from the content.
- Introduced ApiLeastPrivilegeTest to ensure that unauthorized users cannot access sensitive API routes, maintaining strict access control.
This commit is contained in:
hamed
2026-08-07 21:13:38 +03:30
parent a4a24c51af
commit 6876135a53
114 changed files with 2067 additions and 269 deletions
+4 -1
View File
@@ -1,6 +1,9 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
# مقدارِ ثابت و آشکارا غیرعملیاتی: محیط تست هیچ‌وقت به داده یا کاربر واقعی وصل
# نمی‌شود، و همین شفافیت جلوی این را می‌گیرد که کسی این فایل را منبع یک secret
# واقعی بپندارد. secret واقعی فقط در `.env.local` و خارج از git است.
APP_SECRET='not-a-secret-test-env-only'
# Test DB: doctrine's when@test config appends the `_test` suffix (see
# config/packages/doctrine.yaml), so this base name `db` becomes `db_test`.