mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-29 22:26:26 -04:00
Compare commits
No commits in common. "187ca778f23dc7a15b413741c3fc253d3bde19c0" and "08bd4efefae287a3b21896a86c3720e547a78000" have entirely different histories.
187ca778f2
...
08bd4efefa
14
Cargo.lock
generated
14
Cargo.lock
generated
@ -564,7 +564,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "common"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"is_executable",
|
||||
]
|
||||
@ -1430,7 +1430,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpapi"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64 0.21.5",
|
||||
@ -1462,7 +1462,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpauth"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1482,7 +1482,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpclient"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1504,7 +1504,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpgui-helper"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
@ -1522,7 +1522,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gpservice"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"axum",
|
||||
@ -2527,7 +2527,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "openconnect"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"common",
|
||||
|
@ -5,7 +5,7 @@ members = ["crates/*", "apps/gpclient", "apps/gpservice", "apps/gpauth", "apps/g
|
||||
|
||||
[workspace.package]
|
||||
rust-version = "1.70"
|
||||
version = "2.1.1"
|
||||
version = "2.1.0"
|
||||
authors = ["Kevin Yue <k3vinyue@gmail.com>"]
|
||||
homepage = "https://github.com/yuezk/GlobalProtect-openconnect"
|
||||
edition = "2021"
|
||||
|
@ -22,8 +22,8 @@
|
||||
"all": true,
|
||||
"request": true,
|
||||
"scope": [
|
||||
"http://*",
|
||||
"https://*"
|
||||
"http://**",
|
||||
"https://**"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -5,10 +5,9 @@ use common::vpn_utils::find_csd_wrapper;
|
||||
use gpapi::{
|
||||
clap::args::Os,
|
||||
credential::{Credential, PasswordCredential},
|
||||
error::PortalError,
|
||||
gateway::gateway_login,
|
||||
gp_params::{ClientOs, GpParams},
|
||||
portal::{prelogin, retrieve_config, Prelogin},
|
||||
portal::{prelogin, retrieve_config, PortalError, Prelogin},
|
||||
process::{
|
||||
auth_launcher::SamlAuthLauncher,
|
||||
users::{get_non_root_user, get_user_by_name},
|
||||
@ -153,8 +152,6 @@ impl<'a> ConnectHandler<'a> {
|
||||
}
|
||||
|
||||
async fn connect_gateway_with_prelogin(&self, gateway: &str) -> anyhow::Result<()> {
|
||||
info!("Treat the portal as the gateway, connecting...");
|
||||
|
||||
let mut gp_params = self.build_gp_params();
|
||||
gp_params.set_is_gateway(true);
|
||||
|
||||
@ -169,7 +166,7 @@ impl<'a> ConnectHandler<'a> {
|
||||
async fn connect_gateway(&self, gateway: &str, cookie: &str) -> anyhow::Result<()> {
|
||||
let mtu = self.args.mtu.unwrap_or(0);
|
||||
let csd_uid = get_csd_uid(&self.args.csd_user)?;
|
||||
let csd_wrapper = if self.args.csd_wrapper.is_some() {
|
||||
let csd_wrapper = if self.args.csd_user.is_some() {
|
||||
self.args.csd_wrapper.clone()
|
||||
} else if self.args.hip {
|
||||
find_csd_wrapper()
|
||||
|
@ -1,12 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 2.1.1 - 2024-03-25
|
||||
|
||||
- Add the `--hip` option to enable HIP report
|
||||
- Fix not working in OpenSuse 15.5 (fix #336, #322)
|
||||
- Treat portal as gateway when the gateway login is failed (fix #338)
|
||||
- Improve the error message (fix #327)
|
||||
|
||||
## 2.1.0 - 2024-02-27
|
||||
|
||||
- Update distribution channel for `gpgui` to complaint with the GPL-3 license.
|
||||
|
@ -1,11 +0,0 @@
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum PortalError {
|
||||
#[error("Portal prelogin error: {0}")]
|
||||
PreloginError(String),
|
||||
#[error("Portal config error: {0}")]
|
||||
ConfigError(String),
|
||||
#[error("Gateway error: {0}")]
|
||||
GatewayError(String),
|
||||
}
|
@ -6,7 +6,6 @@ use urlencoding::encode;
|
||||
|
||||
use crate::{
|
||||
credential::Credential,
|
||||
error::PortalError,
|
||||
gp_params::GpParams,
|
||||
utils::{normalize_server, parse_gp_error, remove_url_scheme},
|
||||
};
|
||||
@ -29,13 +28,7 @@ pub async fn gateway_login(gateway: &str, cred: &Credential, gp_params: &GpParam
|
||||
|
||||
info!("Gateway login, user_agent: {}", gp_params.user_agent());
|
||||
|
||||
let res = client
|
||||
.post(&login_url)
|
||||
.form(¶ms)
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| anyhow::anyhow!(PortalError::GatewayError(e.to_string())))?;
|
||||
|
||||
let res = client.post(&login_url).form(¶ms).send().await?;
|
||||
let status = res.status();
|
||||
|
||||
if status.is_client_error() || status.is_server_error() {
|
||||
|
@ -1,6 +1,5 @@
|
||||
pub mod auth;
|
||||
pub mod credential;
|
||||
pub mod error;
|
||||
pub mod gateway;
|
||||
pub mod gp_params;
|
||||
pub mod portal;
|
||||
|
@ -7,9 +7,9 @@ use specta::Type;
|
||||
|
||||
use crate::{
|
||||
credential::{AuthCookieCredential, Credential},
|
||||
error::PortalError,
|
||||
gateway::{parse_gateways, Gateway},
|
||||
gp_params::GpParams,
|
||||
portal::PortalError,
|
||||
utils::{normalize_server, parse_gp_error, remove_url_scheme, xml},
|
||||
};
|
||||
|
||||
|
@ -3,3 +3,13 @@ mod prelogin;
|
||||
|
||||
pub use config::*;
|
||||
pub use prelogin::*;
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum PortalError {
|
||||
#[error("Portal prelogin error: {0}")]
|
||||
PreloginError(String),
|
||||
#[error("Portal config error: {0}")]
|
||||
ConfigError(String),
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ use serde::Serialize;
|
||||
use specta::Type;
|
||||
|
||||
use crate::{
|
||||
error::PortalError,
|
||||
gp_params::GpParams,
|
||||
portal::PortalError,
|
||||
utils::{base64, normalize_server, parse_gp_error, xml},
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user