feat: add E2E test for Claude OAuth token flow#53
Merged
Conversation
- New oauth_e2e.rs: creates profile with OAuth token, persists, and probes Anthropic API using Authorization: Bearer header - Fix run_provider_probe to auto-detect OAuth tokens (sk-ant-oat* prefix) and use Bearer auth instead of x-api-key header - Update e2e.yml workflow to run both API key and OAuth token tests - Requires CLAUDE_OAUTH_TOKEN secret in GitHub environment - Test auto-skips when token is absent (safe for local cargo test)
Contributor
📊 Test Coverage Report
Coverage measured by |
Keith-CY
approved these changes
Mar 3, 2026
Collaborator
Keith-CY
left a comment
There was a problem hiding this comment.
Reviewed PR #53. No functional blockers found in the OAuth token E2E and probe/auth-header changes. Changes are consistent with existing profile_e2e patterns, and bearer-vs-x-api-key selection is correctly constrained to Anthropic token shape.
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
Add E2E test coverage for the Claude OAuth token authentication path.
Changes
clawpal-core/tests/oauth_e2e.rs— New E2E test that:claude setup-token)upsert_profile/list_profilesAuthorization: BearerheaderCLAUDE_OAUTH_TOKENis not setsrc-tauri/src/commands/mod.rs— Fixrun_provider_probeto auto-detect OAuth tokens (sk-ant-oat*/oauth_*prefix) and use Bearer auth instead of always usingx-api-keyheader for Anthropic.github/workflows/e2e.yml— Add OAuth test step withCLAUDE_OAUTH_TOKENsecretCI Configuration Required
In Settings → Environments →
development(and optionallyproduction):ANTHROPIC_API_KEYCLAUDE_OAUTH_TOKENclaude setup-token(Claude CLI) — token starts withsk-ant-oatBoth tests auto-skip when their respective secret is absent.