mirror of
https://github.com/warp-tech/warpgate.git
synced 2024-09-20 06:46:17 +08:00
bumped rust
This commit is contained in:
parent
96d0d95e80
commit
42f9c68788
|
@ -1 +1 @@
|
|||
nightly-2022-08-01
|
||||
nightly-2022-10-01
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(decl_macro, proc_macro_hygiene, let_else)]
|
||||
#![feature(decl_macro, proc_macro_hygiene)]
|
||||
mod api;
|
||||
use poem::{EndpointExt, IntoEndpoint, Route};
|
||||
use poem_openapi::OpenApiService;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(type_alias_impl_trait, let_else, try_blocks)]
|
||||
#![feature(type_alias_impl_trait, try_blocks)]
|
||||
mod api;
|
||||
use poem_openapi::OpenApiService;
|
||||
use regex::Regex;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(let_else, drain_filter, duration_constants)]
|
||||
#![feature(drain_filter, duration_constants)]
|
||||
pub mod auth;
|
||||
mod config;
|
||||
pub mod consts;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(let_else, drain_filter, duration_constants)]
|
||||
#![feature(drain_filter, duration_constants, try_blocks)]
|
||||
pub mod consts;
|
||||
mod data;
|
||||
mod state;
|
||||
|
|
|
@ -54,9 +54,7 @@ pub fn install_database_logger(database: Arc<Mutex<DatabaseConnection>>) {
|
|||
fn values_to_log_entry_data(mut values: SerializedRecordValues) -> Option<LogEntry::ActiveModel> {
|
||||
let session_id = (*values).remove("session");
|
||||
let username = (*values).remove("session_username");
|
||||
let message = (*values)
|
||||
.remove("message")
|
||||
.unwrap_or_else(|| "".to_string());
|
||||
let message = (*values).remove("message").unwrap_or_default();
|
||||
|
||||
use sea_orm::ActiveValue::Set;
|
||||
let session_id = session_id.and_then(|x| Uuid::parse_str(&x).ok());
|
||||
|
|
|
@ -17,13 +17,13 @@ impl MySqlBufMutExt for Vec<u8> {
|
|||
self.push(v as u8);
|
||||
} else if v < 0x1_00_00 {
|
||||
self.push(0xfc);
|
||||
self.extend(&(v as u16).to_le_bytes());
|
||||
self.extend((v as u16).to_le_bytes());
|
||||
} else if v < 0x1_00_00_00 {
|
||||
self.push(0xfd);
|
||||
self.extend(&(v as u32).to_le_bytes()[..3]);
|
||||
} else {
|
||||
self.push(0xfe);
|
||||
self.extend(&v.to_le_bytes());
|
||||
self.extend(v.to_le_bytes());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,19 +12,19 @@ pub struct SslRequest {
|
|||
|
||||
impl Encode<'_, Capabilities> for SslRequest {
|
||||
fn encode_with(&self, buf: &mut Vec<u8>, capabilities: Capabilities) {
|
||||
buf.extend(&(capabilities.bits() as u32).to_le_bytes());
|
||||
buf.extend(&self.max_packet_size.to_le_bytes());
|
||||
buf.extend((capabilities.bits() as u32).to_le_bytes());
|
||||
buf.extend(self.max_packet_size.to_le_bytes());
|
||||
buf.push(self.collation);
|
||||
|
||||
// reserved: string<19>
|
||||
buf.extend(&[0_u8; 19]);
|
||||
buf.extend([0_u8; 19]);
|
||||
|
||||
if capabilities.contains(Capabilities::MYSQL) {
|
||||
// reserved: string<4>
|
||||
buf.extend(&[0_u8; 4]);
|
||||
buf.extend([0_u8; 4]);
|
||||
} else {
|
||||
// extended client capabilities (MariaDB-specified): int<4>
|
||||
buf.extend(&((capabilities.bits() >> 32) as u32).to_le_bytes());
|
||||
buf.extend(((capabilities.bits() >> 32) as u32).to_le_bytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ where
|
|||
) {
|
||||
// reserve space to write the prefixed length
|
||||
let offset = buf.len();
|
||||
buf.extend(&[0_u8; 4]);
|
||||
buf.extend([0_u8; 4]);
|
||||
|
||||
// encode the payload
|
||||
self.0.encode_with(buf, capabilities);
|
||||
|
|
|
@ -53,7 +53,7 @@ impl Api {
|
|||
version: env!("CARGO_PKG_VERSION").to_string(),
|
||||
username: session.get_username(),
|
||||
selected_target: session.get_target_name(),
|
||||
external_host: external_host.map(&str::to_string),
|
||||
external_host: external_host.map(str::to_string),
|
||||
authorized_via_ticket: matches!(
|
||||
session.get_auth(),
|
||||
Some(SessionAuthorization::Ticket { .. })
|
||||
|
|
|
@ -99,7 +99,7 @@ impl Api {
|
|||
code: Query<Option<String>>,
|
||||
) -> poem::Result<Response<ReturnToSsoResponse>> {
|
||||
let url = self
|
||||
.api_return_to_sso_get_common(req, session, services, &*code)
|
||||
.api_return_to_sso_get_common(req, session, services, &code)
|
||||
.await?
|
||||
.unwrap_or_else(|x| make_redirect_url(&x));
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(type_alias_impl_trait, let_else, try_blocks)]
|
||||
#![feature(type_alias_impl_trait, try_blocks)]
|
||||
pub mod api;
|
||||
mod catchall;
|
||||
mod common;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(type_alias_impl_trait, let_else, try_blocks)]
|
||||
#![feature(type_alias_impl_trait, try_blocks)]
|
||||
use poem_openapi::OpenApiService;
|
||||
use regex::Regex;
|
||||
use warpgate_protocol_http::api;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(type_alias_impl_trait, let_else, try_blocks)]
|
||||
#![feature(type_alias_impl_trait, try_blocks)]
|
||||
mod client;
|
||||
mod common;
|
||||
mod error;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(type_alias_impl_trait, let_else)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
mod client;
|
||||
mod common;
|
||||
mod compat;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![feature(type_alias_impl_trait, let_else)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
mod commands;
|
||||
mod config;
|
||||
mod logging;
|
||||
|
|
Loading…
Reference in a new issue