Broker credential aliases in child environments (#40484)

## What changed

- Discover supported credentials inherited from the parent even when their canonical provider variable is filtered from the child environment.
- Replace matching values and credentials embedded in longer child environment values with broker dummies, then restore only aliases that the broker virtualized.
- Preserve provider and host bindings when selecting credentials for outbound requests, including GitHub Enterprise and custom OpenAI hosts.
- Expose helpers for identifying provider and binding variables, plus an API for virtualizing credential-bearing text before it is persisted.

## Testing

- Extend credential broker tests for filtered parent variables, exact and embedded aliases, text virtualization, user overrides, and host-bound GitHub and OpenAI credentials.

GitOrigin-RevId: 55d673911900470aab4e206d0f4f5e62ed3611ae
This commit is contained in:
Winston Howes
2026-08-24 22:10:44 +00:00
committed by copyberry
parent 4f6d43c267
commit 0280d73c1e
8 changed files with 566 additions and 42 deletions
+9
View File
@@ -1109,6 +1109,15 @@ impl NetworkProxy {
self.state.restore_child_credentials(env, command);
}
/// Replaces allowed credentials and removes credentials excluded from the environment.
pub fn virtualize_brokered_text(
&self,
text: &mut String,
env: &HashMap<String, String>,
) -> bool {
self.state.virtualize_brokered_text(text, env)
}
pub fn apply_to_env_for_environment(
&self,
env: &mut HashMap<String, String>,