feat: collect native HIP facts and log redacted XML responses

This commit is contained in:
Kevin Yue committed 2026-11-18 13:56:12 +08:00
1 parent f2ca674b88
commit bde11186f8
26 files changed
+1567 -206

No files matched your search

+1 -3
View File
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use anyhow::bail;
use log::{debug, info, warn};
use log::{info, warn};
use reqwest::{Client, StatusCode};
use serde::Serialize;
use specta::Type;
@@ -232,7 +232,6 @@ pub async fn retrieve_config(
bail!(PortalError::ConfigError("Empty portal config response".to_string()))
}
debug!("Portal config response received: {} bytes", res_xml.len());
let root = Element::parse(res_xml.as_bytes()).map_err(|e| PortalError::ConfigError(e.to_string()))?;
if csc::is_config_criteria(&root) {
@@ -247,7 +246,6 @@ pub async fn retrieve_config(
_ = cancellation.cancelled() => bail!("Portal configuration cancelled"),
result = retrieve_csc_config(&client, &portal, &root, cred.username(), gp_params) => result?,
};
debug!("Portal CSC config response received: {} bytes", csc_xml.len());
let root = Element::parse(csc_xml.as_bytes()).map_err(|e| PortalError::ConfigError(e.to_string()))?;
return parse_portal_policy(&server, cred, root, cancellation).await;
}
+2 -4
View File
@@ -1,5 +1,5 @@
use anyhow::{anyhow, bail};
use log::{debug, info, warn};
use log::{info, warn};
use reqwest::{Client, StatusCode};
use serde::Serialize;
use specta::Type;
@@ -174,10 +174,8 @@ pub async fn prelogin(portal: &str, gp_params: &GpParams, options: PreloginOptio
Err(anyhow!(PortalError::PreloginError(err.reason)))
})?;
debug!("Prelogin response XML: {}", res_xml);
let prelogin = parse_prelogin_response(&res_xml, is_gateway).map_err(|err| {
warn!("Parse response error, response: {}", res_xml);
warn!("Failed to parse prelogin response: {err}");
PortalError::PreloginError(err.to_string())
})?;