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