Skip to content

feat: add Cloudflare Worker security proxy - #15

Merged
neuromechanist merged 5 commits into
mainfrom
feature/security-worker
Jan 9, 2026
Merged

neuromechanist merged 5 commits into
mainfrom
feature/security-worker

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

  • Add OSA Cloudflare Worker with multi-layer security
  • Implement visible Turnstile for bot protection
  • Add IP-based rate limiting (10/min, 100/hour for prod)
  • Support BYOK mode for CLI users (skip Turnstile with own API key)
  • Document security architecture

Security Layers

  1. Turnstile - Visible widget for web clients
  2. Rate Limiting - IP-based, per-minute and per-hour
  3. CORS Validation - Allowlist of origins
  4. API Key Auth - Worker injects key for backend

Files

  • workers/osa-worker/ - Worker implementation
  • .context/security-architecture.md - Security documentation
  • .gitignore - Node.js entries for worker

Test plan

  • Deploy worker to Cloudflare
  • Set up Turnstile widget
  • Test from allowed origin with Turnstile
  • Test BYOK mode with X-OpenRouter-Key header
  • Verify rate limits work correctly

- Add OSA Cloudflare Worker with Turnstile verification (visible)
- Implement IP-based rate limiting (10/min, 100/hour)
- Add CORS validation for allowed origins
- Support BYOK mode for CLI/programmatic access
- Document security architecture in .context/
- Add worker setup instructions and README
- Config now uses API_KEYS (comma-separated) and REQUIRE_API_AUTH
- HED /ask and /chat endpoints now require authentication
- Updated tests for new auth configuration
@neuromechanist
neuromechanist merged commit 5d12358 into main Jan 9, 2026
@neuromechanist
neuromechanist deleted the feature/security-worker branch January 9, 2026 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant