itsmrop/innovative-project
0
Innovative Samples Backend
REST API for the link-based captcha and sentence classification project.
Endpoints
GET /— health checkGET /api/session— returns a random captcha image and sentencePOST /api/submit— validates captcha and classification, stores response
Security
- Signed, expiring, one-time session tokens (HMAC-SHA256)
- Per-IP rate limiting on session creation and submission
- Session lockout after repeated failed captcha attempts
- Security headers (nosniff, frame denial, no-store cache)
- Configurable CORS via
ALLOWED_ORIGINS
Environment variables
Local development
pip install -r requirements.txt
uvicorn app:app --reload --port 7860Docker
docker build -t innovative-samples-api .
docker run -p 7860:7860 innovative-samples-api