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
Generated
+50 -2
View File
@@ -4,8 +4,55 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "e8ccf55959566a5f4e99d0965b1c988a",
"content-hash": "9cc89627fd2cff50402b8c5e93a9efee",
"packages": [
{
"name": "altcha-org/altcha",
"version": "v2.0.3",
"source": {
"type": "git",
"url": "https://github.com/altcha-org/altcha-lib-php.git",
"reference": "8b02ad2c9b82998613bac4d093517d457061cbbe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/altcha-org/altcha-lib-php/zipball/8b02ad2c9b82998613bac4d093517d457061cbbe",
"reference": "8b02ad2c9b82998613bac4d093517d457061cbbe",
"shasum": ""
},
"require": {
"php": ">=8.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.72",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-phpunit": "^2.0",
"phpunit/phpunit": "^10.5 || ^11.5"
},
"type": "library",
"autoload": {
"psr-4": {
"AltchaOrg\\Altcha\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Daniel Regeci",
"email": "536331+ovx@users.noreply.github.com"
}
],
"description": "A lightweight PHP library for creating and verifying ALTCHA challenges.",
"support": {
"issues": "https://github.com/altcha-org/altcha-lib-php/issues",
"source": "https://github.com/altcha-org/altcha-lib-php/tree/v2.0.3"
},
"time": "2026-07-02T16:36:58+00:00"
},
{
"name": "doctrine/collections",
"version": "2.6.0",
@@ -9689,7 +9736,8 @@
"platform": {
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*"
"ext-iconv": "*",
"ext-soap": "*"
},
"platform-dev": {},
"plugin-api-version": "2.9.0"