picoclaw/pkg/auth
BallerIsLeet 23abbb67ea
feat(auth): add Anthropic OAuth setup-token login (#926)
* feat(auth): add Anthropic OAuth setup-token login flow

Add support for Anthropic's OAuth-based setup tokens (sk-ant-oat01-*)
as an alternative to API keys. This includes:

- New `--setup-token` flag on `auth login` command
- Interactive login menu for Anthropic (setup token vs API key)
- Setup token validation and credential storage with oauth auth method
- Usage endpoint integration to show 5h/7d utilization in `auth status`
- Streaming support for OAuth tokens (required by Anthropic API)
- Model ID normalization (dots to hyphens) for API compatibility
- Remove .env.example (secrets should not be templated)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(auth):  update related functionality

* refactor(auth): organize constants and improve header casing in requests fo CI

* fix(auth): fix golint again

* fix(auth): handle nil arguments in tool calls for buildParams function

---------

Co-authored-by: Baller <sharonms3377@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 19:58:23 +08:00
..
anthropic_usage.go feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00
anthropic_usage_test.go feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00
oauth.go fix: handle ignored io.ReadAll errors across codebase 2026-03-05 20:56:38 +09:00
oauth_test.go feat: add picoclaw-launcher with web UI for configuration and gateway management (#904) 2026-02-28 18:38:38 +08:00
pkce.go feat(auth): add OAuth and token-based login for OpenAI and Anthropic 2026-02-11 11:41:13 -06:00
pkce_test.go feat(auth): add OAuth and token-based login for OpenAI and Anthropic 2026-02-11 11:41:13 -06:00
store.go feat: honor PICOCLAW_HOME env var for config, auth, and workspace paths 2026-03-05 22:08:37 +00:00
store_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
token.go feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00
token_test.go feat(auth): add Anthropic OAuth setup-token login (#926) 2026-03-06 19:58:23 +08:00