mirror of
https://github.com/warp-tech/warpgate.git
synced 2024-09-20 06:46:17 +08:00
lint
This commit is contained in:
parent
916d51a4e8
commit
47c943d201
|
@ -25,7 +25,7 @@ struct CreateTicketRequest {
|
|||
username: String,
|
||||
target_name: String,
|
||||
expiry: Option<DateTime<Utc>>,
|
||||
number_of_uses: Option<i32>
|
||||
number_of_uses: Option<i32>,
|
||||
}
|
||||
|
||||
#[derive(Object)]
|
||||
|
@ -89,7 +89,6 @@ impl Api {
|
|||
created: Set(chrono::Utc::now()),
|
||||
expiry: Set(body.expiry),
|
||||
uses_left: Set(body.number_of_uses),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let ticket = values.insert(&*db).await.context("Error saving ticket")?;
|
||||
|
|
|
@ -62,7 +62,7 @@ impl AuthStateStore {
|
|||
.get_credential_policy(username, supported_credential_types)
|
||||
.await?;
|
||||
let Some(policy) = policy else {
|
||||
return Err(WarpgateError::UserNotFound(username.into()))
|
||||
return Err(WarpgateError::UserNotFound(username.into()));
|
||||
};
|
||||
|
||||
let state = AuthState::new(
|
||||
|
|
|
@ -333,17 +333,11 @@ async fn get_auth_state(
|
|||
) -> Option<Arc<Mutex<AuthState>>> {
|
||||
let store = services.auth_state_store.lock().await;
|
||||
|
||||
let Some(auth) = auth else {
|
||||
let SessionAuthorization::User(username) = auth? else {
|
||||
return None;
|
||||
};
|
||||
|
||||
let SessionAuthorization::User(username) = auth else {
|
||||
return None;
|
||||
};
|
||||
|
||||
let Some(state_arc) = store.get(id) else {
|
||||
return None;
|
||||
};
|
||||
let state_arc = store.get(id)?;
|
||||
|
||||
{
|
||||
let state = state_arc.lock().await;
|
||||
|
|
|
@ -15,7 +15,7 @@ pub async fn span_for_request(req: &Request) -> poem::Result<Span> {
|
|||
Ok(ref handle) => {
|
||||
let handle = handle.lock().await;
|
||||
let ss = handle.session_state().lock().await;
|
||||
match { ss.username.clone() } {
|
||||
match ss.username.clone() {
|
||||
Some(ref username) => {
|
||||
info_span!("HTTP", session=%handle.id(), session_username=%username, %client_ip)
|
||||
}
|
||||
|
|
|
@ -994,7 +994,7 @@ impl ServerSession {
|
|||
}
|
||||
|
||||
async fn start_terminal_recording(&mut self, channel_id: Uuid, name: String) {
|
||||
match async {
|
||||
let recorder = async {
|
||||
let mut recorder = self
|
||||
.services
|
||||
.recordings
|
||||
|
@ -1009,8 +1009,8 @@ impl ServerSession {
|
|||
}
|
||||
Ok::<_, recordings::Error>(recorder)
|
||||
}
|
||||
.await
|
||||
{
|
||||
.await;
|
||||
match recorder {
|
||||
Ok(recorder) => {
|
||||
self.channel_recorders.insert(channel_id, recorder);
|
||||
}
|
||||
|
|
|
@ -70,9 +70,9 @@ impl SsoClient {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
|
||||
let (auth_url, csrf_token, nonce) = auth_req.url();
|
||||
|
||||
|
||||
Ok(SsoLoginRequest {
|
||||
auth_url,
|
||||
csrf_token,
|
||||
|
|
|
@ -6,7 +6,7 @@ import { Alert, FormGroup } from 'sveltestrap'
|
|||
|
||||
let error: Error|null = null
|
||||
let name = ''
|
||||
let type: 'Ssh'|'MySql'|'Http' = 'Ssh'
|
||||
let type: 'Http' | 'MySql' | 'Ssh' = 'Ssh'
|
||||
|
||||
async function create () {
|
||||
if (!name || !type) {
|
||||
|
|
|
@ -40,7 +40,7 @@ async function create () {
|
|||
username: selectedUser.username,
|
||||
targetName: selectedTarget.name,
|
||||
expiry: selectedExpiry ? new Date(selectedExpiry) : undefined,
|
||||
numberOfUses: selectedNumberOfUses
|
||||
numberOfUses: selectedNumberOfUses,
|
||||
},
|
||||
})
|
||||
} catch (err) {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
let seekInputValue = 0
|
||||
let duration = 0
|
||||
let resizeObserver: ResizeObserver|undefined
|
||||
let events: (SizeEvent | DataEvent | SnapshotEvent)[] = []
|
||||
let events: (DataEvent | SizeEvent | SnapshotEvent)[] = []
|
||||
let playing = false
|
||||
let loading = true
|
||||
let sessionIsLive: boolean|null = null
|
||||
|
@ -67,7 +67,7 @@
|
|||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-type-alias
|
||||
type AsciiCastData = [number, 'o', string]
|
||||
type AsciiCastItem = AsciiCastHeader | AsciiCastData
|
||||
type AsciiCastItem = AsciiCastData | AsciiCastHeader
|
||||
|
||||
function isAsciiCastHeader (data: AsciiCastItem): data is AsciiCastHeader {
|
||||
return 'version' in data
|
||||
|
|
Loading…
Reference in a new issue