Skip to content
AliSaleh07Public

About

A secure, production-grade task management REST API built with FastAPI, SQLite, and PBKDF2/JWT.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

TaskForge

Defensive task management REST API implementing zero-trust tenant boundaries and custom cryptographic primitives.

CI Live API

Live Deployment

Core Engineering

  • Tenant Isolation: Tasks are strictly partitioned by authenticated user ID. Cross-tenant access attempts return 404 to avoid leaking resource existence.
  • Cryptographic Security: PBKDF2-HMAC-SHA256 password hashing (600,000 iterations, 32-byte salt). HMAC-SHA256 JWT validation using constant-time comparison.
  • Defensive HTTP Headers: Enforces HSTS, CSP, and strict framing policies (DENY, nosniff).
  • Input Sanitization: Parameterized SQLite queries and strict Pydantic schemas.
  • Production Validation: Fails fast at startup if TASKFORGE_SECRET_KEY is missing, short, or matches insecure defaults; enforces non-localhost CORS origins in production.
flowchart LR
    Client -->|HTTP / Bearer| MW[Security Headers Middleware]
    MW --> Auth[Auth & JWT Verification]
    Auth --> CRUD[Task Service]
    CRUD --> DB[(SQLite Database)]
Loading

Quickstart

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
uvicorn taskforge.main:app --reload

Running Tests

pytest -v tests/

Production Docker Deployment

docker build -t taskforge:latest .
docker run -d \
  -p 8000:8000 \
  -e TASKFORGE_ENV=production \
  -e TASKFORGE_SECRET_KEY="<cryptographically-secure-32+-char-secret>" \
  -e TASKFORGE_ALLOWED_ORIGINS="https://dashboard.salehsec.dev,https://salehsec.dev" \
  -e TASKFORGE_DATABASE_PATH="/app/data/taskforge.db" \
  -v taskforge_data:/app/data \
  taskforge:latest

Endpoints

  • GET / - Service welcome and documentation discovery
  • GET /healthz - Liveness and readiness health probe
  • POST /api/v1/auth/register - Create account (enforces complexity rules)
  • POST /api/v1/auth/login - Obtain signed JWT
  • GET /api/v1/auth/me - Profile lookup
  • GET /api/v1/tasks - List tasks (supports status, priority, search, pagination)
  • POST /api/v1/tasks - Create task
  • GET /api/v1/tasks/{id} - Fetch single task
  • PUT /api/v1/tasks/{id} - Update task details
  • DELETE /api/v1/tasks/{id} - Delete task
  • GET /api/v1/tasks/stats/summary - Aggregate metrics

About

A secure, production-grade task management REST API built with FastAPI, SQLite, and PBKDF2/JWT.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages