The client-side auth headers: the SAME attach_identity resolution the local bodies run (identity store + config reads + token minting — none of it redb), extracted from the built config.
(remote_url: &str, identity: Option<&str>)
| 5266 | /// local bodies run (identity store + config reads + token minting — none |
| 5267 | /// of it redb), extracted from the built config. |
| 5268 | fn sync_auth_headers(remote_url: &str, identity: Option<&str>) -> HashMap<String, String> { |
| 5269 | let rt = tokio::runtime::Runtime::new() |
| 5270 | .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to create async runtime: {}", e))) |
| 5271 | .ok(); |
| 5272 | let Some(rt) = rt else { return HashMap::new() }; |
| 5273 | let config = rt.block_on(atomic_remote::auth::attach_identity( |
| 5274 | atomic_remote::HttpRemoteConfig::new(), |
| 5275 | remote_url, |
| 5276 | identity, |
| 5277 | )); |
| 5278 | config.extra_headers.into_iter().collect() |
| 5279 | } |
| 5280 | |
| 5281 | /// Map the handler's structured sync error (stage + variant + the local |
| 5282 | /// body's composed message) back to the exact CLI error the local body |
no test coverage detected