mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-20 06:56:17 -05:00
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:
92 files changed
+9847
-2868
No files matched your search
+10
-3
@@ -1,7 +1,7 @@
|
||||
use anyhow::bail;
|
||||
use gpapi::{
|
||||
gp_params::GpParams,
|
||||
portal::{Prelogin, prelogin},
|
||||
portal::{Prelogin, PreloginOptions, prelogin},
|
||||
};
|
||||
|
||||
#[cfg(feature = "browser-auth")]
|
||||
@@ -15,8 +15,15 @@ mod webview;
|
||||
#[cfg(feature = "webview-auth")]
|
||||
pub use webview::*;
|
||||
|
||||
pub async fn auth_prelogin(server: &str, gp_params: &GpParams) -> anyhow::Result<String> {
|
||||
match prelogin(server, gp_params).await? {
|
||||
pub async fn auth_prelogin(
|
||||
server: &str,
|
||||
gp_params: &GpParams,
|
||||
external_browser_requested: bool,
|
||||
) -> anyhow::Result<String> {
|
||||
// gpauth only performs the initial portal/gateway prelogin. Portal policy is
|
||||
// not available here, so gateway prelogin stays on the embedded value.
|
||||
let options = PreloginOptions::default().external_browser_requested(external_browser_requested);
|
||||
match prelogin(server, gp_params, options).await? {
|
||||
Prelogin::Saml(prelogin) => Ok(prelogin.saml_request().to_string()),
|
||||
Prelogin::Standard(_) => bail!("Received non-SAML prelogin response"),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user