mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 14:06:14 -05:00
Add tunnel statistics and an optional CLI dashboard, native sign-in controls and recovery, and broader client certificate support. Include platform integration fixes and the approved release notes.
45 lines
955 B
Rust
45 lines
955 B
Rust
use thiserror::Error;
|
|
|
|
mod server_tls;
|
|
pub use server_tls::{ServerTlsError, ServerTlsErrorKind};
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum PortalError {
|
|
#[error("Prelogin error: {0}")]
|
|
PreloginError(String),
|
|
|
|
#[error("Portal config error: {0}")]
|
|
ConfigError(String),
|
|
|
|
#[error(transparent)]
|
|
NetworkError(#[from] reqwest::Error),
|
|
}
|
|
|
|
impl PortalError {
|
|
fn tls_error_kind(&self) -> Option<ServerTlsErrorKind> {
|
|
match self {
|
|
Self::NetworkError(error) => server_tls::classify(error),
|
|
_ => None,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum AuthDataParseError {
|
|
#[error("No auth data found")]
|
|
NotFound,
|
|
#[error("Authentication failed (SAML status: {0})")]
|
|
AuthenticationFailed(String),
|
|
#[error(transparent)]
|
|
Invalid(#[from] anyhow::Error),
|
|
}
|
|
|
|
impl AuthDataParseError {
|
|
pub fn is_invalid(&self) -> bool {
|
|
matches!(
|
|
self,
|
|
AuthDataParseError::Invalid(_) | AuthDataParseError::AuthenticationFailed(_)
|
|
)
|
|
}
|
|
}
|