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>)
| 5306 | /// local bodies run (identity store + config reads + token minting — none |
| 5307 | /// of it redb), extracted from the built config. |
| 5308 | fn sync_auth_headers(remote_url: &str, identity: Option<&str>) -> HashMap<String, String> { |
| 5309 | let rt = tokio::runtime::Runtime::new() |
| 5310 | .map_err(|e| CliError::Internal(anyhow::anyhow!("Failed to create async runtime: {}", e))) |
| 5311 | .ok(); |
| 5312 | let Some(rt) = rt else { return HashMap::new() }; |
| 5313 | let config = rt.block_on(atomic_remote::auth::attach_identity( |
| 5314 | atomic_remote::HttpRemoteConfig::new(), |
| 5315 | remote_url, |
| 5316 | identity, |
| 5317 | )); |
| 5318 | config.extra_headers.into_iter().collect() |
| 5319 | } |
| 5320 | |
| 5321 | /// Map the handler's structured sync error (stage + variant + the local |
| 5322 | /// body's composed message) back to the exact CLI error the local body |
no test coverage detected