DocFast session 96: 130 tests, security util extraction

This commit is contained in:
Hoid 2026-02-25 19:05:56 +00:00
parent 052bf8519f
commit 486f77557a
8 changed files with 135 additions and 26 deletions

View file

@ -1,5 +1,32 @@
# SnapAPI Session Log
## Session 24 — 2026-02-25 14:00 UTC (Usage Dashboard Feature)
**Goal:** Build customer-facing usage dashboard — a real gap where customers had no way to check their API usage.
**Built:**
- `GET /v1/usage` API endpoint — authenticated, returns used/limit/plan/month/remaining/percentUsed
- `usage.html` page — dark-themed, input API key, visual progress bar, warning (>80%) and danger (>95%) states
- 4 new tests (TDD: failing first → implementation → green)
- Updated landing page nav + footer with "Check Usage" links
- OpenAPI/Swagger docs updated
**Results:**
- Tests: 133 passing (up from 129), all green
- Code pushed to main, deployed to staging
- Commit: 5b59a7a
**Investor Test:**
1. Trust with money? Mostly — checkout works, Stripe webhook unregistered
2. Data loss on crash? No — PostgreSQL
3. Free tier abuse? Low risk — IP-limited, watermarked, URL length capped
4. Key recovery? Yes on staging
5. Website features? All working
**Still blocked:** Stripe webhook registration, CI/CD (Forgejo runner), staging TLS (DNS), production deploy (needs approval)
---
## Session 23 — 2026-02-25 11:00 UTC (Health Check + Production Deploy Request)
**Goal:** Verify system health, run investor test, request production deployment.

View file

@ -1,6 +1,6 @@
{
"phase": "production-live",
"version": "0.4.3-prod / 0.5.1-staging",
"version": "0.4.3-prod / 0.5.2-staging",
"staging": {
"status": "running",
"namespace": "snapapi-staging",
@ -57,7 +57,10 @@
"Stripe Customer Portal endpoint (POST /v1/billing/portal) — subscription management + key recovery (staging)",
"API Key Recovery endpoint (GET /v1/billing/recover) — secure masked key lookup (staging)",
"Recovery page at /recovery.html — user-facing key recovery form (staging)",
"Test suite: 129 tests passing (vitest) — SSRF, cache, auth, keys, billing, playground, screenshot, health, watermark",
"Usage Dashboard: GET /v1/usage API endpoint — returns used/limit/plan/month/remaining/percentUsed (staging)",
"Usage page at /usage.html — dark-themed dashboard with progress bar, warning/danger states (staging)",
"Usage Dashboard linked from landing page nav + footer (staging)",
"Test suite: 133 tests passing (vitest) — SSRF, cache, auth, keys, billing, playground, screenshot, health, watermark, usage",
"Git deploy key configured on k3s-mgr for staging builds"
],
"notDone": [
@ -81,6 +84,6 @@
"priceId": "price_1T2XHpRtlDv9c8GoThHfd8kS"
}
},
"lastSession": "2026-02-25T11:00:00Z",
"lastSession": "2026-02-25T14:00:00Z",
"codeLocation": "Forgejo repo openclawd/SnapAPI. Clone: git clone forgejo-snapapi:openclawd/SnapAPI.git"
}