Skip to content

feat: user API keys + developer docs page#42

Merged
VibeCodingScientist merged 1 commit intomainfrom
feat/user-api-keys-developer-docs
Feb 17, 2026
Merged

feat: user API keys + developer docs page#42
VibeCodingScientist merged 1 commit intomainfrom
feat/user-api-keys-developer-docs

Conversation

@VibeCodingScientist
Copy link
Owner

Summary

  • User API Keys: Full CRUD backend (UserApiKey model, migration 011, /api/user/api-keys endpoints) with clab_user_ prefix, max 10 per user, soft-revoke, expiry support
  • Auth extension: get_current_user now accepts both JWT and clab_user_ API keys (prefix lookup + constant-time hash compare + expiry + last_used_at debounce)
  • Settings page rewrite: Replaced mock data with real create/revoke/list, token reveal with copy-to-clipboard, loading/error states
  • Developer Docs page (/developers): Public page with "no browser automation needed" hero, auth guide (3 token types), quick starts for humans + agents, endpoint table, Python/JS/curl examples, headless/CI section
  • Sidebar nav: Added "Developers" link with Code icon
  • skill.md update: Human Developer Access section added to agent protocol

Motivation

Forum feedback: researchers were resorting to browser automation (Xvfb, headless Chrome, browser gateway services) because they didn't know the REST API existed and had no long-lived credentials. JWT tokens expire in 60 min, making scripting impractical.

Test plan

  • Run migration 011 on server (alembic upgrade head)
  • Create user, login, Settings > API Keys > Create Key — see raw token
  • Use token: curl -H "Authorization: Bearer clab_user_xxx" .../api/security/users/me — returns user
  • Revoke key — same curl returns 401
  • /developers page loads without auth, shows all sections
  • Sidebar shows "Developers" link
  • npm run build passes with zero type errors (verified)

🤖 Generated with Claude Code

External researchers were resorting to browser automation (Xvfb, headless
Chrome) because they didn't know a REST API existed and had no way to get
long-lived credentials. This PR fixes that by:

- Adding real API key management (UserApiKey model, migration 011, CRUD
  endpoints at /api/user/api-keys with max 10 keys, soft-revoke)
- Extending get_current_user to accept clab_user_ prefixed tokens
  alongside JWT, with constant-time hash comparison and expiry checks
- Replacing the mock ApiKeys settings page with real create/revoke/list
  functionality including token reveal and copy-to-clipboard
- Adding a public /developers page with API overview, auth guide, quick
  starts for humans and agents, endpoint table, code examples, and a
  prominent no browser automation needed banner
- Updating skill.md with human developer access instructions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@VibeCodingScientist VibeCodingScientist merged commit efd63d6 into main Feb 17, 2026
1 of 3 checks passed
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