Compare commits
4 Commits
v2.0.0-bet
...
13be9179f5
Author | SHA1 | Date | |
---|---|---|---|
|
13be9179f5 | ||
|
0a55506077 | ||
|
8860efa82e | ||
|
9bc0994a8e |
10
Cargo.lock
generated
@@ -1423,7 +1423,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpapi"
|
||||
version = "2.0.0-beta8"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.5",
|
||||
@@ -1452,7 +1452,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpauth"
|
||||
version = "2.0.0-beta8"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -1472,7 +1472,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpclient"
|
||||
version = "2.0.0-beta8"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@@ -1493,7 +1493,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpservice"
|
||||
version = "2.0.0-beta8"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
@@ -2478,7 +2478,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openconnect"
|
||||
version = "2.0.0-beta8"
|
||||
version = "2.0.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"is_executable",
|
||||
|
@@ -4,7 +4,7 @@ resolver = "2"
|
||||
members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth"]
|
||||
|
||||
[workspace.package]
|
||||
version = "2.0.0-beta8"
|
||||
version = "2.0.0"
|
||||
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
|
||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||
edition = "2021"
|
||||
|
@@ -127,7 +127,7 @@ The project depends on `openconnect >= 8.20`, `webkit2gtk`, `libsecret`, `libaya
|
||||
|
||||
## About Trial
|
||||
|
||||
The CLI version is always free, while the GUI version is paid. There two trial modes for the GUI version:
|
||||
The CLI version is always free, while the GUI version is paid. There are two trial modes for the GUI version:
|
||||
|
||||
1. 10-day trial: You can use the GUI stable release for 10 days after the installation.
|
||||
2. 14-day trial: Each beta release has a fresh trial period (at most 14 days) after released.
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 974 B After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 85 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 83 KiB |
@@ -150,8 +150,10 @@ fn parse_res_xml(res_xml: String, is_gateway: bool) -> anyhow::Result<Prelogin>
|
||||
bail!("Prelogin failed: {}", msg)
|
||||
}
|
||||
|
||||
let region = xml::get_child_text(&doc, "region")
|
||||
.ok_or_else(|| anyhow::anyhow!("Prelogin response does not contain region element"))?;
|
||||
let region = xml::get_child_text(&doc, "region").unwrap_or_else(|| {
|
||||
info!("Prelogin response does not contain region element");
|
||||
String::from("Unknown")
|
||||
});
|
||||
|
||||
let saml_method = xml::get_child_text(&doc, "saml-auth-method");
|
||||
let saml_request = xml::get_child_text(&doc, "saml-request");
|
||||
|
@@ -1,5 +1,6 @@
|
||||
use std::process::Stdio;
|
||||
|
||||
use anyhow::bail;
|
||||
use tokio::process::Command;
|
||||
|
||||
use crate::{auth::SamlAuthResult, credential::Credential, GP_AUTH_BINARY};
|
||||
@@ -129,12 +130,13 @@ impl<'a> SamlAuthLauncher<'a> {
|
||||
.wait_with_output()
|
||||
.await?;
|
||||
|
||||
let auth_result = serde_json::from_slice::<SamlAuthResult>(&output.stdout)
|
||||
.map_err(|_| anyhow::anyhow!("Failed to parse auth data"))?;
|
||||
let Ok(auth_result) = serde_json::from_slice::<SamlAuthResult>(&output.stdout) else {
|
||||
bail!("Failed to parse auth data")
|
||||
};
|
||||
|
||||
match auth_result {
|
||||
SamlAuthResult::Success(auth_data) => Credential::try_from(auth_data),
|
||||
SamlAuthResult::Failure(msg) => Err(anyhow::anyhow!(msg)),
|
||||
SamlAuthResult::Failure(msg) => bail!(msg),
|
||||
}
|
||||
}
|
||||
}
|
||||
|