Skip to content

Conversation

@AlexMikhalev
Copy link

Summary

  • Add BearerToken(String) variant to AuthData enum for OAuth Bearer token authentication
  • When the Anthropic adapter sees a BearerToken, it uses Authorization: Bearer header instead of x-api-key
  • Enables terraphim-llm-proxy to use Claude OAuth tokens for Anthropic API requests while reusing all format conversion and streaming logic

Changes

  • src/resolver/auth_data.rs: Add BearerToken variant, handle in single_key_value() and Debug impl, add 4 unit tests
  • src/adapter/adapters/anthropic/adapter_impl.rs: Match on BearerToken to switch auth header format

Test plan

  • 4 new unit tests for BearerToken variant (single_key_value, debug redaction, existing key/override behavior)
  • cargo check passes
  • All existing tests unaffected

Closes terraphim/terraphim-llm-proxy#97

Generated with Claude Code

Add BearerToken(String) variant to AuthData enum to support OAuth
Bearer token authentication. When the Anthropic adapter sees a
BearerToken, it uses Authorization: Bearer header instead of x-api-key.

This enables terraphim-llm-proxy to use Claude OAuth tokens for
Anthropic API requests while reusing all format conversion and
streaming logic.

Changes:
- auth_data.rs: Add BearerToken variant, handle in single_key_value()
  and Debug impl, add 4 unit tests
- adapter_impl.rs: Match on BearerToken to use Bearer auth header

Closes terraphim/terraphim-llm-proxy#97

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AlexMikhalev AlexMikhalev merged commit 433e559 into main Feb 8, 2026
1 check failed
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