mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-19 22:46:14 -05:00
style: reorder use statements for consistency across multiple files
This commit is contained in:
18 files changed
+21
-21
No files matched your search
@@ -1,9 +1,9 @@
|
|||||||
use auth::{auth_prelogin, BrowserAuthenticator};
|
use auth::{BrowserAuthenticator, auth_prelogin};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use common::constants::GP_USER_AGENT;
|
use common::constants::GP_USER_AGENT;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
auth::{SamlAuthData, SamlAuthResult},
|
auth::{SamlAuthData, SamlAuthResult},
|
||||||
clap::{args::Os, handle_error, Args, InfoLevelVerbosity},
|
clap::{Args, InfoLevelVerbosity, args::Os, handle_error},
|
||||||
gp_params::{ClientOs, GpParams},
|
gp_params::{ClientOs, GpParams},
|
||||||
utils::{normalize_server, openssl},
|
utils::{normalize_server, openssl},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ mod signals {
|
|||||||
|
|
||||||
pub async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) {
|
pub async fn handle_signals(vpn_ctx: Arc<VpnTaskContext>, ws_ctx: Arc<WsServerContext>) {
|
||||||
use gpapi::service::event::WsEvent;
|
use gpapi::service::event::WsEvent;
|
||||||
use tokio::signal::unix::{signal, Signal, SignalKind};
|
use tokio::signal::unix::{Signal, SignalKind, signal};
|
||||||
|
|
||||||
let (mut user_sig1, mut user_sig2) = match || -> anyhow::Result<(Signal, Signal)> {
|
let (mut user_sig1, mut user_sig2) = match || -> anyhow::Result<(Signal, Signal)> {
|
||||||
let user_sig1 = signal(SignalKind::user_defined1())?;
|
let user_sig1 = signal(SignalKind::user_defined1())?;
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ use anyhow::bail;
|
|||||||
use axum::{
|
use axum::{
|
||||||
body::Bytes,
|
body::Bytes,
|
||||||
extract::{
|
extract::{
|
||||||
ws::{self, CloseFrame, Message, Utf8Bytes, WebSocket},
|
|
||||||
State, WebSocketUpgrade,
|
State, WebSocketUpgrade,
|
||||||
|
ws::{self, CloseFrame, Message, Utf8Bytes, WebSocket},
|
||||||
},
|
},
|
||||||
http::StatusCode,
|
http::StatusCode,
|
||||||
response::IntoResponse,
|
response::IntoResponse,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use axum::{
|
use axum::{
|
||||||
routing::{get, post},
|
|
||||||
Router,
|
Router,
|
||||||
|
routing::{get, post},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{handlers, ws_server::WsServerContext};
|
use crate::{handlers, ws_server::WsServerContext};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ use openconnect::{find_csd_wrapper, find_vpnc_script};
|
|||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
use tokio::{
|
use tokio::{
|
||||||
net::TcpListener,
|
net::TcpListener,
|
||||||
sync::{mpsc, watch, RwLock},
|
sync::{RwLock, mpsc, watch},
|
||||||
};
|
};
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use gpapi::{
|
use gpapi::{
|
||||||
gp_params::GpParams,
|
gp_params::GpParams,
|
||||||
portal::{prelogin, Prelogin},
|
portal::{Prelogin, prelogin},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "browser-auth")]
|
#[cfg(feature = "browser-auth")]
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use anyhow::bail;
|
|||||||
use gpapi::{auth::SamlAuthData, error::AuthDataParseError};
|
use gpapi::{auth::SamlAuthData, error::AuthDataParseError};
|
||||||
use log::{error, info};
|
use log::{error, info};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use tokio::sync::{mpsc, RwLock};
|
use tokio::sync::{RwLock, mpsc};
|
||||||
use tokio_util::sync::CancellationToken;
|
use tokio_util::sync::CancellationToken;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use block2::RcBlock;
|
use block2::RcBlock;
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use objc2::runtime::AnyObject;
|
use objc2::runtime::AnyObject;
|
||||||
use objc2_foundation::{NSError, NSString, NSURLRequest, NSURL};
|
use objc2_foundation::{NSError, NSString, NSURL, NSURLRequest};
|
||||||
use objc2_web_kit::WKWebView;
|
use objc2_web_kit::WKWebView;
|
||||||
use tauri::webview::PlatformWebview;
|
use tauri::webview::PlatformWebview;
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ use gpapi::utils::redact::redact_uri;
|
|||||||
use log::warn;
|
use log::warn;
|
||||||
use tauri::webview::PlatformWebview;
|
use tauri::webview::PlatformWebview;
|
||||||
use webkit2gtk::{
|
use webkit2gtk::{
|
||||||
gio::Cancellable, glib::GString, LoadEvent, TLSErrorsPolicy, URIResponseExt, WebResource, WebResourceExt, WebViewExt,
|
LoadEvent, TLSErrorsPolicy, URIResponseExt, WebResource, WebResourceExt, WebViewExt, WebsiteDataManagerExt,
|
||||||
WebsiteDataManagerExt,
|
gio::Cancellable, glib::GString,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ use anyhow::bail;
|
|||||||
use gpapi::{auth::SamlAuthData, gp_params::GpParams, utils::redact::redact_uri};
|
use gpapi::{auth::SamlAuthData, gp_params::GpParams, utils::redact::redact_uri};
|
||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use tauri::{
|
use tauri::{
|
||||||
webview::{PageLoadEvent, PageLoadPayload},
|
|
||||||
AppHandle, WebviewUrl, WebviewWindow, WindowEvent,
|
AppHandle, WebviewUrl, WebviewWindow, WindowEvent,
|
||||||
|
webview::{PageLoadEvent, PageLoadPayload},
|
||||||
};
|
};
|
||||||
use tokio::{sync::oneshot, time};
|
use tokio::{sync::oneshot, time};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use clap::{builder::PossibleValue, ValueEnum};
|
use clap::{ValueEnum, builder::PossibleValue};
|
||||||
|
|
||||||
use crate::gp_params::ClientOs;
|
use crate::gp_params::ClientOs;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
pub mod hip;
|
||||||
mod login;
|
mod login;
|
||||||
mod parse_gateways;
|
mod parse_gateways;
|
||||||
pub mod hip;
|
|
||||||
|
|
||||||
pub use login::*;
|
pub use login::*;
|
||||||
pub(crate) use parse_gateways::*;
|
pub(crate) use parse_gateways::*;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::sync::OnceLock;
|
|||||||
|
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use env_logger::Logger;
|
use env_logger::Logger;
|
||||||
use log::{warn, Level};
|
use log::{Level, warn};
|
||||||
use log_reload::{ReloadHandle, ReloadLog};
|
use log_reload::{ReloadHandle, ReloadLog};
|
||||||
|
|
||||||
static LOG_HANDLE: OnceLock<ReloadHandle<log_reload::LevelFilter<Logger>>> = OnceLock::new();
|
static LOG_HANDLE: OnceLock<ReloadHandle<log_reload::LevelFilter<Logger>>> = OnceLock::new();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use base64::{engine::general_purpose, Engine};
|
use base64::{Engine, engine::general_purpose};
|
||||||
|
|
||||||
pub fn encode(data: &[u8]) -> String {
|
pub fn encode(data: &[u8]) -> String {
|
||||||
let engine = general_purpose::STANDARD;
|
let engine = general_purpose::STANDARD;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use chacha20poly1305::{
|
use chacha20poly1305::{
|
||||||
aead::{Aead, OsRng},
|
|
||||||
AeadCore, ChaCha20Poly1305, Key, KeyInit,
|
AeadCore, ChaCha20Poly1305, Key, KeyInit,
|
||||||
|
aead::{Aead, OsRng},
|
||||||
};
|
};
|
||||||
use serde::{de::DeserializeOwned, Serialize};
|
use serde::{Serialize, de::DeserializeOwned};
|
||||||
|
|
||||||
pub fn generate_key() -> Key {
|
pub fn generate_key() -> Key {
|
||||||
ChaCha20Poly1305::generate_key(&mut OsRng)
|
ChaCha20Poly1305::generate_key(&mut OsRng)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::path::Path;
|
|||||||
use log::{info, warn};
|
use log::{info, warn};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use tempfile::NamedTempFile;
|
use tempfile::NamedTempFile;
|
||||||
use version_compare::{compare_to, Cmp};
|
use version_compare::{Cmp, compare_to};
|
||||||
|
|
||||||
pub fn openssl_conf() -> String {
|
pub fn openssl_conf() -> String {
|
||||||
let option = get_openssl_option();
|
let option = get_openssl_option();
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::sync::RwLock;
|
|||||||
|
|
||||||
use redact_engine::{Pattern, Redaction as RedactEngine};
|
use redact_engine::{Pattern, Redaction as RedactEngine};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use url::{form_urlencoded, Url};
|
use url::{Url, form_urlencoded};
|
||||||
|
|
||||||
pub struct Redaction {
|
pub struct Redaction {
|
||||||
redact_engine: RwLock<Option<RedactEngine>>,
|
redact_engine: RwLock<Option<RedactEngine>>,
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ mod unix {
|
|||||||
|
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use gtk::{
|
use gtk::{
|
||||||
|
EventBox,
|
||||||
glib::Cast,
|
glib::Cast,
|
||||||
traits::{EventBoxExt, GtkWindowExt, WidgetExt},
|
traits::{EventBoxExt, GtkWindowExt, WidgetExt},
|
||||||
EventBox,
|
|
||||||
};
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
use tauri::WebviewWindow;
|
use tauri::WebviewWindow;
|
||||||
|
|||||||
Reference in new issue
Block a user