mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
refactor: move HIP models to neutral API namespace
This commit is contained in:
10 files changed
+10
-9
No files matched your search
@@ -7,7 +7,7 @@ use std::{
|
||||
|
||||
use anyhow::{Context, ensure};
|
||||
use base64::{Engine, engine::general_purpose::STANDARD};
|
||||
use gpapi::service::hip::HipApprovalStatus;
|
||||
use gpapi::hip::HipApprovalStatus;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tempfile::Builder;
|
||||
use uuid::Uuid;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{os::unix::process::CommandExt, process::Stdio, sync::Arc, time::Duration};
|
||||
|
||||
use anyhow::{Context, bail, ensure};
|
||||
use gpapi::service::{hip::HipSource, request::PreviewHipReportRequest};
|
||||
use gpapi::{hip::HipSource, service::request::PreviewHipReportRequest};
|
||||
use tokio::{io::AsyncReadExt, process::Command};
|
||||
|
||||
const MAX_PREVIEW_BYTES: u64 = 1024 * 1024;
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::{
|
||||
};
|
||||
|
||||
use anyhow::{Context, bail, ensure};
|
||||
use gpapi::service::hip::HipSource;
|
||||
use gpapi::hip::HipSource;
|
||||
use gpservice::hip_runner_state::{MAX_STATE_BYTES, RUNNER_NAME, RunnerReport, STATE_NAME, validate_root_owned_path};
|
||||
use tempfile::{Builder, TempDir};
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ impl RequestDispatcher {
|
||||
}
|
||||
if matches!(
|
||||
request.args().hip_source(),
|
||||
gpapi::service::hip::HipSource::UserScript { .. } | gpapi::service::hip::HipSource::ApprovedRootScript { .. }
|
||||
gpapi::hip::HipSource::UserScript { .. } | gpapi::hip::HipSource::ApprovedRootScript { .. }
|
||||
) {
|
||||
return Err("macOS does not support custom HIP scripts");
|
||||
}
|
||||
@@ -459,7 +459,7 @@ mod tests {
|
||||
|
||||
let custom = ConnectRequest::new(info, "cookie".into())
|
||||
.with_vpnc_script(Some("/app/Contents/Resources/Scripts/vpnc-script".to_string()))
|
||||
.with_hip_source(gpapi::service::hip::HipSource::UserScript {
|
||||
.with_hip_source(gpapi::hip::HipSource::UserScript {
|
||||
path: "/tmp/hip.sh".into(),
|
||||
});
|
||||
assert_eq!(
|
||||
|
||||
@@ -6,7 +6,7 @@ use gpapi::service::transport::{
|
||||
ClientMessage, ClientPrelude, CloseReason, HandshakeRejection, NoiseResponder, NoiseTransport, ServerMessage,
|
||||
ServerPrelude, ServiceErrorCode, ServiceResult,
|
||||
};
|
||||
use gpapi::service::{hip::HipSource, request::WsRequest};
|
||||
use gpapi::{hip::HipSource, service::request::WsRequest};
|
||||
use log::{info, warn};
|
||||
use tokio::sync::{mpsc, watch};
|
||||
use tokio::time::Instant;
|
||||
|
||||
File renamed without changes.
@@ -5,6 +5,7 @@ pub mod device_anchor;
|
||||
pub mod error;
|
||||
pub mod gateway;
|
||||
pub mod gp_params;
|
||||
pub mod hip;
|
||||
pub mod log_format;
|
||||
pub mod os_profile;
|
||||
pub mod params;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
pub mod event;
|
||||
pub mod hip;
|
||||
pub mod request;
|
||||
pub mod transport;
|
||||
pub mod vpn_env;
|
||||
|
||||
@@ -6,10 +6,11 @@ use zeroize::Zeroize;
|
||||
|
||||
use crate::{
|
||||
gateway::Gateway,
|
||||
hip::HipSource,
|
||||
os_profile::{ClientOs, OsProfile},
|
||||
};
|
||||
|
||||
use super::{hip::HipSource, vpn_state::ConnectInfo};
|
||||
use super::vpn_state::ConnectInfo;
|
||||
|
||||
pub const MAX_CLIENT_IDENTITY_DATA: usize = 32 * 1024;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::service::hip::HipApprovalStatus;
|
||||
use crate::hip::HipApprovalStatus;
|
||||
use crate::service::{event::WsEvent, request::WsRequest, vpn_env::VpnEnv, vpnc_script::VpncScriptMetadata};
|
||||
|
||||
use super::{MAX_PLAINTEXT, MAX_SERVICE_MESSAGE, ServiceErrorCode, TransportError};
|
||||
|
||||
Reference in new issue
Block a user