Skip to content

Fix local API service auth file for access-token-only bindings#994

Open
luoyanglang wants to merge 1 commit into
jlcodes99:mainfrom
luoyanglang:wolf/local-access-auth-file
Open

Fix local API service auth file for access-token-only bindings#994
luoyanglang wants to merge 1 commit into
jlcodes99:mainfrom
luoyanglang:wolf/local-access-auth-file

Conversation

@luoyanglang
Copy link
Copy Markdown

Summary

  • keep the local API service takeover profile on API-key auth when its bound OAuth account has no id_token
  • preserve the existing OAuth auth projection when the bound OAuth account has a non-empty id_token
  • add regression coverage for both access-token-only and full OAuth binding cases

Root Cause

Access-token-only OAuth imports can have an empty id_token. When the local API service runtime API-key account was bound to one of those OAuth accounts, the shared bundle writer wrote an OAuth-shaped auth.json first and then applied the local provider override.

That could leave the takeover profile with OPENAI_API_KEY: null and tokens.id_token: "", which the client rejects as an invalid ID token.

Validation

  • cargo fmt -p cockpit-tools
  • cargo test -p cockpit-tools --lib api_key_bundle_bound -- --nocapture
  • cargo test -p cockpit-tools --lib build_auth_file_value -- --nocapture
  • cargo test -p cockpit-tools --lib api_key_config_toml -- --nocapture
  • cargo test -p cockpit-tools --lib codex_account -- --nocapture
  • cargo test -p cockpit-tools --lib local_access_profile -- --nocapture
  • cargo check -p cockpit-tools
  • npm run typecheck

No user-facing configuration changed, so no public docs were updated.

Related

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