Implement ALTCHA captcha service with challenge generation and solution verification

- Added AltchaService class for managing ALTCHA captcha challenges and solutions.
- Created CaptchaController to handle API requests for generating challenges.
- Introduced CaptchaGuard for validating captcha solutions on public endpoints.
- Developed unit tests for AltchaService to ensure challenge creation and solution verification functionality.
- Implemented integration tests for the Captcha API endpoint and captcha bypass behavior when disabled.
- Added documentation for the Captcha API in the corresponding markdown file.
This commit is contained in:
hamed
2026-07-10 10:31:59 +03:30
parent 11efed4100
commit 10b0743d9a
43 changed files with 5586 additions and 1554 deletions
+62 -22
View File
@@ -450,8 +450,8 @@
"semantic_hash": ""
},
"composer.json": {
"mtime": 1783490678.46749,
"ast_hash": "af0a543bf9cbb00808c5dc8850ca273c",
"mtime": 1783666096.953897,
"ast_hash": "fcf018bd5c7fc59ecd3c76c463e7e9a8",
"semantic_hash": ""
},
"config/bundles.php": {
@@ -780,8 +780,8 @@
"semantic_hash": ""
},
"package.json": {
"mtime": 1783189109.134888,
"ast_hash": "f0b61dd4c429f6bceac993e60b933ab4",
"mtime": 1783666097.0063853,
"ast_hash": "218d7761b7559cdbae136d5d9d8204a8",
"semantic_hash": ""
},
"postcss.config.js": {
@@ -905,8 +905,8 @@
"semantic_hash": ""
},
"src/Auth/Controller/AuthController.php": {
"mtime": 1783071277.1970987,
"ast_hash": "b4778b795ee2d27f5e857a1967c337df",
"mtime": 1783666097.0093415,
"ast_hash": "39b0ff3917eea112c09e8a7b11d7ea1c",
"semantic_hash": ""
},
"src/Auth/Controller/NotificationMobileController.php": {
@@ -915,8 +915,8 @@
"semantic_hash": ""
},
"src/Auth/Controller/PreRegistrationController.php": {
"mtime": 1783238186.8425517,
"ast_hash": "69a551f873ff500c47fc880ea088be8b",
"mtime": 1783666097.0124094,
"ast_hash": "246de59bb3b7acb58a862b66341e0a15",
"semantic_hash": ""
},
"src/Auth/Entity/MobileVerificationOtp.php": {
@@ -1410,7 +1410,7 @@
"semantic_hash": ""
},
"src/Rating/Controller/RatingController.php": {
"mtime": 1782728407.1993864,
"mtime": 1783666764.412828,
"ast_hash": "19a05cd6788d427b52c6c2b604ec69af",
"semantic_hash": ""
},
@@ -1535,8 +1535,8 @@
"semantic_hash": ""
},
"src/Shared/Constant/ErrorCodes.php": {
"mtime": 1782728407.2028558,
"ast_hash": "6555622a4f54511406726cc156eac7aa",
"mtime": 1783666097.015498,
"ast_hash": "6ad487190ee8ba21689c31580d564a4b",
"semantic_hash": ""
},
"src/Shared/Controller/BaseController.php": {
@@ -2185,8 +2185,8 @@
"semantic_hash": ""
},
"README.MD": {
"mtime": 1782933937.9090674,
"ast_hash": "1da6a3afea0f626c55b6f7c1ff126b65",
"mtime": 1783666800.9005868,
"ast_hash": "b63e5ed1aa434fd429f8a04daae5335c",
"semantic_hash": ""
},
"TEST_USERS.md": {
@@ -2195,8 +2195,8 @@
"semantic_hash": ""
},
"config/packages/cache.yaml": {
"mtime": 1781010060.4718235,
"ast_hash": "7e97d477dade0fd454310d84c4a47237",
"mtime": 1783666096.9616337,
"ast_hash": "5a3d4a654c5cc1932cbaa77152f5e9c0",
"semantic_hash": ""
},
"config/packages/debug.yaml": {
@@ -2260,8 +2260,8 @@
"semantic_hash": ""
},
"config/packages/security.yaml": {
"mtime": 1783569345.7766566,
"ast_hash": "6d04ed4f39e92b722ac727559194623a",
"mtime": 1783666096.9829946,
"ast_hash": "7236c28a514152be0d7dbf02834096c4",
"semantic_hash": ""
},
"config/packages/twig.yaml": {
@@ -2300,8 +2300,8 @@
"semantic_hash": ""
},
"config/services.yaml": {
"mtime": 1783570481.7864468,
"ast_hash": "ed9215189d1b96849ae1e9f6dacdc266",
"mtime": 1783666096.987689,
"ast_hash": "92837e221e0914e026f4f79e8e8ee0b6",
"semantic_hash": ""
},
"docs/Architecture_Audit.md": {
@@ -2355,8 +2355,8 @@
"semantic_hash": ""
},
"docs/api/auth.md": {
"mtime": 1783072324.1093419,
"ast_hash": "fe76d2c41f7e9996751b1002edb50c6b",
"mtime": 1783666224.6876435,
"ast_hash": "10113c88f71bb74fb7d6dae80843c253",
"semantic_hash": ""
},
"docs/api/billing.md": {
@@ -2420,7 +2420,7 @@
"semantic_hash": ""
},
"docs/api/rating.md": {
"mtime": 1782728407.1106706,
"mtime": 1783666791.9281247,
"ast_hash": "ab1f1c46ee73542ebd50f8eddc428efb",
"semantic_hash": ""
},
@@ -3803,5 +3803,45 @@
"mtime": 1783570038.522232,
"ast_hash": "0bc13f299e24b463b720695195298c6a",
"semantic_hash": ""
},
"assets/admin/components/ui/Altcha.tsx": {
"mtime": 1783666097.1123717,
"ast_hash": "76bfa4d9d7c539585eb8b3836c81f3cb",
"semantic_hash": ""
},
"src/Shared/Captcha/AltchaService.php": {
"mtime": 1783666097.1130326,
"ast_hash": "432b4dd0304710632ba86b243e530a5b",
"semantic_hash": ""
},
"src/Shared/Captcha/CaptchaController.php": {
"mtime": 1783666097.1135097,
"ast_hash": "e6fccf870e0891e4d836baf6c27aa958",
"semantic_hash": ""
},
"src/Shared/Captcha/CaptchaGuard.php": {
"mtime": 1783666097.1140714,
"ast_hash": "a84bc84f26a9296f39d446336abd45d5",
"semantic_hash": ""
},
"tests/Shared/Captcha/AltchaServiceTest.php": {
"mtime": 1783666097.1154962,
"ast_hash": "f6a6ca5f5ccaa6fb6cbf811f1e91dc0b",
"semantic_hash": ""
},
"tests/Shared/Captcha/CaptchaFlowTest.php": {
"mtime": 1783666097.1165395,
"ast_hash": "86aa236ea6e3bb4067b6511b7161661f",
"semantic_hash": ""
},
".claude/prompt/altcha-captcha-integration.md": {
"mtime": 1783666097.111438,
"ast_hash": "312b9b9b16b99ac3550f2911e34619e8",
"semantic_hash": ""
},
"docs/api/captcha.md": {
"mtime": 1783666775.6831665,
"ast_hash": "4796a4acacfaba72c1e4b741b234c96f",
"semantic_hash": ""
}
}