Skip to content

feat(platform): developer portal UI, TypeScript client SDK, API key lifecycle, and canary fix - #52

Merged
abhirajadhikary06 merged 4 commits into
OBLIQ-in:mainfrom
abhirajadhikary06:dev/fixes
Nov 17, 2026
Merged

abhirajadhikary06 merged 4 commits into
OBLIQ-in:mainfrom
abhirajadhikary06:dev/fixes

Conversation

@abhirajadhikary06

Copy link
Copy Markdown
Member

Summary

This PR delivers the complete developer dashboard experience, official TypeScript client SDK, enhanced API key lifecycle management, and fixes the synthetic canary monitor on serverless Hugging Face infrastructure.

Closes #48
Closes #50
Closes #51


Key Changes by Area

1. Synthetic Canary SLA & Cold-Start Fix (Fixes #50)

  • Engine vs. End-to-End Latency Decoupling: Evaluates --max-latency 4.0 against the true per-page OCR processing latency (processing_time_ms) rather than raw public internet upload and queuing wall-clock time.
  • Serverless Warm-Up Probe: Added a pre-benchmark ping against GET /ready (45s timeout) in scripts/canary.py to wake sleeping Hugging Face Spaces prior to timing execution.
  • Workflow Update: Added --max-e2e-latency 30.0 in .github/workflows/canary.yml.

2. API Key Lifecycle, Scopes & Rate Limiting (Closes #48)

  • Model & Migrations: Added scopes (default ["ocr:read", "ocr:write"]) and expires_at to api_keys with Alembic migration 002_api_key_scopes_and_expiry.py.
  • Zero-Downtime Rotation: Added POST /v1/keys/{key_id}/rotate supporting configurable overlap grace periods (default: 24h).
  • Scope Enforcement: Implemented require_scope(...) dependency enforcing ocr:write on document submission and ocr:read on status/results.
  • Per-Key Rate Limiting: Enforces key:<id>:req limits in Redis with standard 429 and Retry-After headers.
  • Granular Usage Analytics: Added key-filtering to GET /v1/dashboard/usage/daily and added GET /v1/dashboard/usage/hourly for recent 24-hour operations.

3. Official TypeScript Client SDK (Closes #51)

  • @obliq/client: Added typed isomorphic SDK under packages/client/ running in Node.js 18+, Bun, browsers, and Next.js (Server & Client Components).
  • Features: Native fetch, automatic exponential backoff with jitter on 429/503 errors, typed error hierarchy (AuthenticationError, ForbiddenError, RateLimitError, ServerError, etc.), and ergonomic jobs.poll(...) helper with live progress callbacks.

4. Built-in Developer Portal & Interactive Client Docs

Served natively by FastAPI under /dashboard using modern dark/slate styling (Tailwind CDN) and pure inline vanilla JS (zero extra hosting or build step required):

  • /dashboard/keys: Key management dashboard with status badges, Create Key modal, Copy-Once Secret Reveal modal, Rotate/Revoke modals, and offline detection banner (window.addEventListener('offline')).
  • /dashboard/usage: Live telemetry dashboard with Chart.js time-series charts (daily volume, pages extracted, hourly trends).
  • /dashboard/docs: Interactive multi-language client documentation with copyable snippets for TypeScript (@obliq/client), Python (httpx), and cURL.

5. Deployment Governance

  • Documented the required reviewers (@abhirajadhikary06, @Naman-iitm) and single-review approval gate policy for the production environment in docs/deployment/handover-guide.md and docs/deployment/environments-and-secrets.md.

Type of Change

  • feat: New feature or capability
  • fix: Bug fix
  • docs: Documentation updates

Testing & Verification

  • pytest tests/unit/: All 10 unit tests passing in 2.87s.
  • ruff check .: 100% clean across all 64 files.
  • ruff format --check .: All files cleanly formatted.
  • Verified /dashboard, /dashboard/keys, /dashboard/usage, and /dashboard/docs render status 200/307.
  • Verified scripts/canary.py --help formats correctly without argparse format errors.

Architectural & Security Checklist

  • No plaintext API keys or credentials stored in the database (BLAKE2b hash + prefix only).
  • Plaintext secrets shown only once upon creation/rotation.
  • Strict tenant isolation maintained (organisation_id scoping).
  • Rate limiting enforced at both organization and key levels.

@github-actions github-actions Bot added ci CI/CD and workflow changes documentation Improvements or additions to documentation or runbooks test Adding or updating test suites and test fixtures api Endpoints, request and response contract, versioning security Authentication, secrets and security concerns labels Nov 17, 2026
@abhirajadhikary06
abhirajadhikary06 merged commit 0ec5df3 into OBLIQ-in:main Nov 17, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Endpoints, request and response contract, versioning ci CI/CD and workflow changes documentation Improvements or additions to documentation or runbooks security Authentication, secrets and security concerns test Adding or updating test suites and test fixtures

Projects

None yet

1 participant