Merge branch 'review-pr-595'

This commit is contained in:
elky
2026-05-30 21:25:39 +08:00
3 changed files with 87 additions and 6 deletions
@@ -60,11 +60,13 @@ pub(super) fn should_try_same_format_provider_oauth_auth(
behavior: &SameFormatProviderRequestBehavior,
transport: &GatewayProviderTransportSnapshot,
family: LocalSameFormatProviderFamily,
provider_api_format: &str,
) -> bool {
should_try_same_format_provider_oauth_auth_impl(
behavior,
transport,
same_format_provider_family(family),
provider_api_format,
)
}
@@ -72,11 +74,13 @@ pub(super) fn resolve_same_format_provider_direct_auth(
behavior: &SameFormatProviderRequestBehavior,
transport: &GatewayProviderTransportSnapshot,
family: LocalSameFormatProviderFamily,
provider_api_format: &str,
) -> Option<(String, String)> {
resolve_same_format_provider_direct_auth_impl(
behavior,
transport,
same_format_provider_family(family),
provider_api_format,
)
}
@@ -92,8 +92,12 @@ pub(super) async fn prepare_local_same_format_provider_candidate(
} else {
None
};
let should_try_oauth_auth =
should_try_same_format_provider_oauth_auth(&behavior, &transport, spec.family);
let should_try_oauth_auth = should_try_same_format_provider_oauth_auth(
&behavior,
&transport,
spec.family,
provider_api_format,
);
let oauth_auth = if should_try_oauth_auth {
resolve_candidate_oauth_auth(
planner_state,
@@ -118,7 +122,12 @@ pub(super) async fn prepare_local_same_format_provider_candidate(
{
Some((name.clone(), value.clone()))
} else {
resolve_same_format_provider_direct_auth(&behavior, &transport, spec.family)
resolve_same_format_provider_direct_auth(
&behavior,
&transport,
spec.family,
provider_api_format,
)
};
let (auth_header, auth_value) = match auth {
Some((name, value)) => (Some(name), Some(value)),