Commit graph

3 commits

Author SHA1 Message Date
cda259a3c6 Add comprehensive test framework with vitest and TDD tests
Some checks failed
Build & Deploy to Staging / Build & Deploy to Staging (push) Has been cancelled
- Set up vitest test framework with proper configuration
- Added test scripts to package.json (test, test:watch, test:ui)
- Created comprehensive SSRF validation tests (30 tests)
  - Tests for protocol validation (HTTP/HTTPS only)
  - Private IP blocking (127.x, 10.x, 172.16-31.x, 192.168.x, 169.254.x)
  - Kubernetes service DNS blocking (.svc, .cluster.local, etc.)
  - URL length validation (max 2048 chars)
  - DNS resolution error handling
  - Edge cases with ports, query params, userinfo
- Created cache service tests (19 tests)
  - Cache hit/miss operations
  - Deterministic key generation
  - TTL expiry behavior
  - Size limits and LRU eviction
  - Cache bypass logic
  - Statistics tracking
- Created integration test suite (marked as skip for CI)
  - Health endpoint tests
  - Playground endpoint tests with rate limiting
  - Authentication tests for screenshot endpoints
  - CORS header validation
  - Error handling and security headers
- All unit tests pass (49 total tests)
- Following strict Red/Green TDD methodology
2026-02-24 16:23:06 +00:00
SnapAPI CEO
713cc30ac7 fix: code-driven OpenAPI docs — replace static JSON with swagger-jsdoc
Some checks failed
Deploy to Staging / build-and-deploy (push) Failing after 10m13s
BREAKING: OpenAPI spec is now generated from JSDoc annotations on route
handlers at startup, eliminating drift between code and documentation.

What was wrong:
- Static public/openapi.json was manually maintained and could drift
- Missing endpoints: signup, billing (checkout/success/webhook)
- Signup route was imported but never mounted (dead code)

What was fixed:
- Added swagger-jsdoc to generate OpenAPI spec from JSDoc on route files
- Every route handler now has @openapi JSDoc annotation as source of truth
- Spec served dynamically at GET /openapi.json (no static file)
- Deleted public/openapi.json
- Documented all missing endpoints (signup, billing x3)
- Mounted /v1/signup route
- All 9 screenshot params documented with types, ranges, defaults
2026-02-20 07:32:37 +00:00
b58f634318 feat: initial codebase v0.4.1
Some checks failed
Deploy to Staging / build-and-deploy (push) Failing after 9m44s
- Extract complete codebase from running staging pod
- Add Dockerfile with multi-stage build for Node.js + Puppeteer
- Configure CI/CD workflows for staging and production deployment
- Include all source files, configs, and public assets
2026-02-19 17:05:16 +00:00