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:
@@ -49,6 +49,14 @@ services:
|
||||
$baseUrl: '%env(default:default_api_ir_base_url:API_IR_BASE_URL)%'
|
||||
$token: '%env(default::API_IR_TOKEN)%'
|
||||
|
||||
App\Shared\Captcha\AltchaService:
|
||||
arguments:
|
||||
$hmacKey: '%env(ALTCHA_HMAC_KEY)%'
|
||||
$enabled: '%env(bool:ALTCHA_ENABLED)%'
|
||||
$maxNumber: '%env(int:ALTCHA_MAX_NUMBER)%'
|
||||
$expireSeconds: '%env(int:ALTCHA_EXPIRE_SECONDS)%'
|
||||
$altchaPool: '@altcha.pool'
|
||||
|
||||
# Persist warning+ logs to the app_log table while keeping stderr output.
|
||||
App\Shared\Logging\DbLogger:
|
||||
decorates: 'logger'
|
||||
|
||||
Reference in New Issue
Block a user