Merge remote-tracking branch 'origin/main' into feat/auth-callback-handler

# Conflicts:
#	apps/gpclient/src/cli.rs
#	apps/gpclient/src/connect/args.rs
This commit is contained in:
Kevin Yue committed 2026-09-28 20:15:05 +08:00
commit 00a92dabeb
3 files changed
+57

No files matched your search

+27
View File
@@ -149,6 +149,14 @@ pub(crate) struct ConnectArgs {
#[arg(long, help = "Listen on this IP address when using '--browser remote'")]
pub(super) browser_listen: Option<IpAddr>,
#[arg(
long,
help = "Authenticate and print the gateway cookie to stdout, then exit without starting the \
VPN tunnel. Outputs two lines: COOKIE='<value>' and HOST='<gateway>'. Combine with \
--cookie-cache to avoid re-authenticating when the portal session is still valid."
)]
pub(super) cookie_only: bool,
}
pub(super) fn build_os_profile(args: &ConnectArgs) -> OsProfile {
@@ -418,4 +426,23 @@ mod tests {
};
assert_eq!(err.kind(), ErrorKind::ArgumentConflict);
}
#[test]
fn cookie_only_flag_parses() {
use clap::Parser;
let cli = ConnectArgsTestCli::try_parse_from(["test", "portal.example.com", "--cookie-only"])
.expect("--cookie-only should parse");
assert!(cli.args.cookie_only);
}
#[test]
fn cookie_only_is_disabled_by_default() {
use clap::Parser;
let cli = ConnectArgsTestCli::try_parse_from(["test", "portal.example.com"]).expect("connect args should parse");
assert!(!cli.args.cookie_only);
}
}