mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 06:26:14 -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
@@ -4,8 +4,6 @@ use chrono::{Local, TimeZone};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use specta::Type;
|
||||
|
||||
use crate::gp_params::ClientOs;
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
pub struct SessionWarning {
|
||||
pub prior_secs: u32,
|
||||
@@ -16,9 +14,6 @@ pub struct SessionWarning {
|
||||
pub struct SessionRequestArgs {
|
||||
cookie: String,
|
||||
user_agent: Option<String>,
|
||||
os: Option<ClientOs>,
|
||||
os_version: Option<String>,
|
||||
client_version: Option<String>,
|
||||
certificate: Option<String>,
|
||||
sslkey: Option<String>,
|
||||
key_password: Option<String>,
|
||||
@@ -30,9 +25,6 @@ impl SessionRequestArgs {
|
||||
Self {
|
||||
cookie,
|
||||
user_agent: None,
|
||||
os: None,
|
||||
os_version: None,
|
||||
client_version: None,
|
||||
certificate: None,
|
||||
sslkey: None,
|
||||
key_password: None,
|
||||
@@ -45,21 +37,6 @@ impl SessionRequestArgs {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_os<T: Into<Option<ClientOs>>>(mut self, os: T) -> Self {
|
||||
self.os = os.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_os_version<T: Into<Option<String>>>(mut self, os_version: T) -> Self {
|
||||
self.os_version = os_version.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_client_version<T: Into<Option<String>>>(mut self, client_version: T) -> Self {
|
||||
self.client_version = client_version.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_certificate<T: Into<Option<String>>>(mut self, certificate: T) -> Self {
|
||||
self.certificate = certificate.into();
|
||||
self
|
||||
@@ -88,18 +65,6 @@ impl SessionRequestArgs {
|
||||
self.user_agent.clone()
|
||||
}
|
||||
|
||||
pub fn os(&self) -> Option<ClientOs> {
|
||||
self.os.clone()
|
||||
}
|
||||
|
||||
pub fn os_version(&self) -> Option<String> {
|
||||
self.os_version.clone()
|
||||
}
|
||||
|
||||
pub fn client_version(&self) -> Option<String> {
|
||||
self.client_version.clone()
|
||||
}
|
||||
|
||||
pub fn certificate(&self) -> Option<String> {
|
||||
self.certificate.clone()
|
||||
}
|
||||
@@ -299,4 +264,11 @@ mod tests {
|
||||
fn reschedule_after_extension_requires_lifetime() {
|
||||
assert!(SessionInfo::default().rescheduled_after_extension().is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn with_user_agent_sets_session_user_agent() {
|
||||
let args = SessionRequestArgs::new("cookie".to_string()).with_user_agent("agent/1.0".to_string());
|
||||
|
||||
assert_eq!(args.user_agent(), Some("agent/1.0".to_string()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user