MAESTRO: add captcha verification flow

This commit is contained in:
Mariusz Banach
2026-02-18 04:12:02 +01:00
parent 28658c4a87
commit 98f2f8a656
8 changed files with 352 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import annotations
import json
import secrets
from functools import lru_cache
from typing import Any
@@ -30,6 +31,20 @@ class Settings(BaseSettings):
ge=1,
description="Rate limit window in seconds.",
)
captcha_secret: str = Field(
default_factory=lambda: secrets.token_urlsafe(32),
description="Secret used to sign CAPTCHA bypass tokens.",
)
captcha_challenge_ttl_seconds: int = Field(
default=300,
ge=60,
description="Seconds until CAPTCHA challenges expire.",
)
captcha_bypass_ttl_seconds: int = Field(
default=300,
ge=60,
description="Seconds until CAPTCHA bypass tokens expire.",
)
analysis_timeout_seconds: int = Field(
default=30,
ge=1,