mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-10-06 02:48:25 +00:00
refactor(auth): inline ApiCredential construction in ApiKey arm
Collapse a struct-then-mutate into the constructor: extra_headers and base_url were initialized with placeholders and immediately overwritten. Matches the AwsSigv4/OAuth arms. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
879ac3ff8b
commit
c2cf1ccbf7
1 changed files with 11 additions and 10 deletions
|
|
@ -406,17 +406,18 @@ impl CredentialResolver {
|
|||
.ok_or_else(|| ResolveError::NotConfigured(provider_id.clone()))?;
|
||||
let auth_header = auth_header_for_catalog_provider(provider, key.clone())?;
|
||||
let mut cred = ApiCredential {
|
||||
provider: provider_id.clone(),
|
||||
auth_header: Some(auth_header),
|
||||
extra_headers: HashMap::new(),
|
||||
base_url: None,
|
||||
codex_mode: false,
|
||||
org_id: None,
|
||||
project_id: None,
|
||||
provider: provider_id.clone(),
|
||||
auth_header: Some(auth_header),
|
||||
extra_headers: self.resolved_extra_headers_for_catalog(
|
||||
vault,
|
||||
provider_id,
|
||||
catalog,
|
||||
)?,
|
||||
base_url,
|
||||
codex_mode: false,
|
||||
org_id: None,
|
||||
project_id: None,
|
||||
};
|
||||
cred.base_url = base_url;
|
||||
cred.extra_headers =
|
||||
self.resolved_extra_headers_for_catalog(vault, provider_id, catalog)?;
|
||||
if provider_id == &ProviderId::openai() {
|
||||
apply_openai_api_env_context(&mut cred, &*self.env_lookup);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue