Require auth managers to receive routing configuration (#34650)

## Why

Auth managers should use the application's resolved HTTP client factory instead
of silently falling back to the transport's default proxy behavior.

## What changed

- Make `AuthRouteConfig` required when constructing an `AuthManager` or
  `AuthConfig`.
- Pass each production caller's resolved routing configuration through without
  wrapping it in an optional value.
- Add a test helper that explicitly selects the transport-default proxy policy
  for callers that do not exercise custom routing.

GitOrigin-RevId: d89a3b1f8b5d4007650cdac0aae241c94d598580
This commit is contained in:
Michael Bolin authored and copyberry committed 2026-07-22 01:35:06 +00:00
1 parent f899a79c03
commit a26bc337cf
19 files changed
+75 -53

No files matched your search

+8 -8
View File
@@ -933,7 +933,7 @@ async fn unauthorized_recovery_reports_mode_and_step_names() {
/*forced_chatgpt_workspace_id*/ None,
/*chatgpt_base_url*/ None,
AuthKeyringBackendKind::default(),
/*auth_route_config*/ None,
crate::test_support::transport_default_auth_route_config(),
)
.await;
let managed = UnauthorizedRecovery {
@@ -1123,7 +1123,7 @@ async fn external_auth_provider_can_install_headers() {
/*forced_chatgpt_workspace_id*/ None,
/*chatgpt_base_url*/ None,
AuthKeyringBackendKind::default(),
/*auth_route_config*/ None,
crate::test_support::transport_default_auth_route_config(),
)
.await;
@@ -1344,7 +1344,7 @@ async fn build_config(
forced_login_method,
forced_chatgpt_workspace_id,
chatgpt_base_url: None,
auth_route_config: None,
auth_route_config: crate::test_support::transport_default_auth_route_config(),
}
}
@@ -1529,7 +1529,7 @@ async fn auth_manager_rejects_env_personal_access_token_workspace_mismatch() {
Some(vec![WORKSPACE_ID_ALLOWED.to_string()]),
/*chatgpt_base_url*/ None,
AuthKeyringBackendKind::default(),
/*auth_route_config*/ None,
crate::test_support::transport_default_auth_route_config(),
)
.await;
@@ -1581,7 +1581,7 @@ async fn auth_manager_rejects_stored_personal_access_token_workspace_mismatch()
Some(vec![WORKSPACE_ID_ALLOWED.to_string()]),
/*chatgpt_base_url*/ None,
AuthKeyringBackendKind::default(),
/*auth_route_config*/ None,
crate::test_support::transport_default_auth_route_config(),
)
.await;
@@ -1615,7 +1615,7 @@ async fn personal_access_token_does_not_offer_unauthorized_recovery() {
/*forced_chatgpt_workspace_id*/ None,
/*chatgpt_base_url*/ None,
AuthKeyringBackendKind::default(),
/*auth_route_config*/ None,
crate::test_support::transport_default_auth_route_config(),
)
.await,
);
@@ -1757,7 +1757,7 @@ async fn enforce_login_restrictions_logs_out_for_personal_access_token_workspace
forced_login_method: None,
forced_chatgpt_workspace_id: Some(vec![WORKSPACE_ID_ALLOWED.to_string()]),
chatgpt_base_url: None,
auth_route_config: None,
auth_route_config: crate::test_support::transport_default_auth_route_config(),
};
let err = super::enforce_login_restrictions(&config)
@@ -1881,7 +1881,7 @@ async fn enforce_login_restrictions_logs_out_for_agent_identity_workspace_mismat
forced_login_method: None,
forced_chatgpt_workspace_id: Some(vec![WORKSPACE_ID_ALLOWED.to_string()]),
chatgpt_base_url: Some(chatgpt_base_url),
auth_route_config: None,
auth_route_config: crate::test_support::transport_default_auth_route_config(),
};
let err = super::enforce_login_restrictions_with_agent_identity_authapi_base_url(