fabro/lib/crates/fabro-cli/src/shared
Bryan Helmkamp b4bc9a0506
refactor(auth): extract ApiCredential::from_api_key
The "Anthropic uses x-api-key header, everyone else uses Bearer" logic
was written three times: env_source (env-based construction), resolve
(vault-based construction), and provider_auth (CLI key validation).
Any future header rename would need three edits.

Add ApiCredential::from_api_key(provider, key) as a canonical
constructor. Each callsite now builds via the helper and overrides only
the fields specific to its path (env base URLs, vault-sourced org/project
IDs, codex mode, etc.).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 09:05:54 -04:00
..
github.rs refactor(github): rename gh_cli strategy to token, GITHUB_CLI_TOKEN to GITHUB_TOKEN 2026-04-13 20:46:11 -04:00
mod.rs Add typed provider credential auth flow 2026-04-12 22:10:11 -04:00
provider_auth.rs refactor(auth): extract ApiCredential::from_api_key 2026-04-24 09:05:54 -04:00
repo.rs refactor(cli): make run-adjacent commands server-only 2026-04-06 06:12:16 -04:00
utilities.rs refactor(run-status): unify tagged lifecycle states 2026-04-22 17:15:13 -04:00