Commit Graph

15 Commits

Author SHA1 Message Date
Alexander a7b583839d feat(logging): add zerolog + lumberjack structured logging package 2026-04-10 18:15:49 +02:00
Alexander c5f6962104 Package proxy with nix 2026-04-10 14:44:07 +02:00
Alexander 5ec0004e4c Update example rules 2026-04-10 14:36:59 +02:00
Alexander bf68a0fbeb Update flake deps 2026-04-10 14:33:11 +02:00
Alexander e3c4854be0 fix(auth): bind callback server to localhost for IPv4/IPv6 compat, fix nil deref 2026-04-10 14:30:23 +02:00
Alexander 8b7d9bfff9 docs: update README and config for self-managed authentication 2026-04-10 14:17:46 +02:00
Alexander 65e843f57a feat: wire OAuth login into startup, auto-detect credentials 2026-04-10 14:17:46 +02:00
Alexander 9858530ff6 fix(auth): handle credential file creation in persistCredential 2026-04-10 14:14:42 +02:00
Alexander 21176949a6 feat(auth): add OAuth PKCE login flow with browser + manual fallback 2026-04-10 14:14:42 +02:00
Alexander 945a865bbe refactor(config): remove claude_credentials, add default credential path 2026-04-10 14:14:38 +02:00
Alexander 17cde479c3 Remove dead code, secure debug endpoints, fix encapsulation 2026-04-10 13:07:26 +02:00
Alexander 4abd4e68dc Fixes, readme
Drop cli-proxy-api token handling, use only native Claude credentials.
Simplify refresh to single endpoint (platform.claude.com) with scope.
Add debug/refresh and debug/shutdown endpoints. Graceful shutdown.
2026-04-10 12:56:42 +02:00
Alexander f22765d8f0 Fixes, readme 2026-04-09 23:06:17 +02:00
Alexander 909c8b1894 Add request sanitizer, background token refresh, and OpenCode support
Sanitizer renames tool names and replaces system prompt patterns
that Anthropic fingerprints to detect non-Claude-Code clients.
Lowercase tool names (bash, read, glob, etc.) combined together
trigger rejection — renaming to PascalCase bypasses this.
Configurable via YAML sanitize rules for tools, system, and body.

Background OAuth token refresh every 30s with 5-minute pre-expiry
lead. Uses Chrome TLS fingerprint for refresh endpoint too.

Adds /messages route (without /v1 prefix) for OpenCode compat.
2026-04-09 22:52:43 +02:00
Alexander c4c1d4daa4 Anthropic API proxy with OAuth credential rotation and Claude Code fingerprinting
Sniffs a real Claude Code request on startup to capture exact HTTP headers,
then replays them for all proxied requests. Injects the billing header with
per-request SHA256 fingerprint into the system prompt. Uses utls with Chrome
TLS fingerprint to pass Cloudflare's bot detection on api.anthropic.com.

Supports both streaming (SSE) and non-streaming modes, round-robin credential
selection with automatic failover, and loading OAuth tokens from both
cli-proxy-api auth files and native ~/.claude/.credentials.json.
2026-04-09 21:05:32 +02:00