feat: add AuthData::BearerToken for OAuth Bearer auth#5
Merged
AlexMikhalev merged 1 commit intomainfrom Feb 8, 2026
Merged
Conversation
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
added a commit
that referenced
this pull request
Mar 16, 2026
AuthData::None now returns an empty string from single_key_value() instead of erroring, matching the behaviour of RequestOverride for no-auth providers. Added tests for None variant and MultiKeys error case. Refs #5 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AlexMikhalev
added a commit
that referenced
this pull request
Mar 16, 2026
AlexMikhalev
added a commit
that referenced
this pull request
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BearerToken(String)variant toAuthDataenum for OAuth Bearer token authenticationBearerToken, it usesAuthorization: Bearerheader instead ofx-api-keyChanges
src/resolver/auth_data.rs: AddBearerTokenvariant, handle insingle_key_value()andDebugimpl, add 4 unit testssrc/adapter/adapters/anthropic/adapter_impl.rs: Match onBearerTokento switch auth header formatTest plan
cargo checkpassesCloses terraphim/terraphim-llm-proxy#97
Generated with Claude Code