refactor: align GP profile and packaging flow

Main changes:

- Refactor connect/auth flows around a single OS profile and host identity model, including gateway fallback and cookie-on-stdin handling.

- Align request parameters, HIP host-id propagation, SAML webview user-agent behavior, and portal default-browser handling with observed official client behavior.

- Add opt-in cookie cache support and Microsoft Defender HIP reporting while keeping host-id validation explicit.

- Add BSD build, packaging, release artifact, and provenance support with FreeBSD/OpenBSD path and dependency cleanup.

- Update NixOS install documentation and dependency compatibility fixes.
This commit is contained in:
Kevin Yue committed 2026-06-19 21:23:29 +08:00
1 parent f98e0336dc
commit 888dc93643
92 files changed
+9847 -2868

No files matched your search

+25 -1
View File
@@ -1,7 +1,8 @@
use anyhow::bail;
use block2::RcBlock;
use log::warn;
use objc2::runtime::AnyObject;
use objc2_foundation::{NSError, NSString, NSURL, NSURLRequest};
use objc2_foundation::{NSError, NSObject, NSObjectNSKeyValueCoding, NSString, NSURL, NSURLRequest};
use objc2_web_kit::WKWebView;
use tauri::webview::PlatformWebview;
@@ -13,6 +14,29 @@ impl PlatformWebviewExt for PlatformWebview {
Ok(())
}
fn user_agent(&self) -> anyhow::Result<String> {
unsafe {
let wv: &NSObject = &*self.inner().cast();
let Some(value) = wv.valueForKey(&NSString::from_str("userAgent")) else {
bail!("Failed to get webview user agent");
};
let Some(user_agent) = value.downcast_ref::<NSString>() else {
bail!("Webview user agent is not a string");
};
Ok(user_agent.to_string())
}
}
fn set_user_agent(&self, user_agent: &str) -> anyhow::Result<()> {
unsafe {
let wv: &WKWebView = &*self.inner().cast();
wv.setCustomUserAgent(Some(&NSString::from_str(user_agent)));
}
Ok(())
}
fn load_url(&self, url: &str) -> anyhow::Result<()> {
unsafe {
let wv: &WKWebView = &*self.inner().cast();