7 Commits

Author SHA1 Message Date
0439811613 Sync legacy api_keys row when the single legacy key is regenerated
regenerate_api_key() only updated users.api_key_hash/prefix, leaving the
backfilled 'Default (legacy)' row in api_keys stale after rotation — not a
security issue (the old hash was still correctly rejected) but the Tokens
page would show a wrong/orphaned prefix for a key that no longer works.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-02 00:31:14 +05:30
05babc6d99 Add password reset, revocable API keys, usage analytics, and admin panel
Adds forgot/reset password flow with dev-mode email logging, multiple
named/revocable API keys per user (replacing the single legacy key model
while keeping it working), per-tool-call usage analytics recorded from the
MCP call_tool handler, and a separate admin API (auth/queries/routes) for
managing all users and viewing system-wide analytics — authenticated via a
hardcoded operator identity, fully isolated from regular user auth.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 17:05:01 +05:30
198b5f1b90 Migrate MCP transport to Streamable HTTP, add session sweeper, CORS, public URL config
Replaces the old SseServerTransport (broken against current MCP clients —
405s on POST, session-id redirects, no protocol negotiation) with
StreamableHTTPServerTransport. Adds an idle-session sweeper to prevent
abandoned client connections from leaking memory indefinitely, CORS
middleware for browser-based frontend access, and PUBLIC_URL/CORS_ORIGINS
settings so signup responses show the correct connection URL instead of a
placeholder.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-01 13:43:34 +05:30
fc6d7c8ca6 Replace passlib with bcrypt directly — fixes bcrypt 5.0 compatibility 2026-06-29 10:06:21 +05:30
3eb9f83853 Fix missing email-validator dep and bad config import 2026-06-29 09:25:17 +05:30
ff8b8995c1 Fix bad import in auth/service.py 2026-06-29 09:20:20 +05:30
b2ca96066b fixed known bugs_new 2026-06-29 09:10:05 +05:30