style: fmt + clippy cleanup after Phase B
cargo fmt regroups, plus three Phase-B clippy fixes:
- F-P-004: #[allow(clippy::type_complexity)] on the invoke_ast_cache Mutex.
- F-P-008: hoist `futures::stream::{self, TryStreamExt}` to the top-of-
file imports to satisfy clippy::items_after_statements.
- F-P-005: rename `_legacy_offset` to `legacy_offset` + #[allow(dead_code)]
to satisfy clippy's "field is pub but `_`-prefixed" check.
No behavior change.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,7 @@ pub struct Engine {
|
|||||||
/// callee on every invoke. Independent of the orchestrator-core
|
/// callee on every invoke. Independent of the orchestrator-core
|
||||||
/// `LocalExecutorClient` AST cache — that one caches HTTP-path
|
/// `LocalExecutorClient` AST cache — that one caches HTTP-path
|
||||||
/// dispatch; this one caches function-call dispatch.
|
/// dispatch; this one caches function-call dispatch.
|
||||||
|
#[allow(clippy::type_complexity)]
|
||||||
invoke_ast_cache: Mutex<HashMap<ScriptId, (DateTime<Utc>, Arc<AST>)>>,
|
invoke_ast_cache: Mutex<HashMap<ScriptId, (DateTime<Utc>, Arc<AST>)>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -381,8 +381,10 @@ pub struct LogsQuery {
|
|||||||
/// silently ignored to keep older dashboards from 400'ing.
|
/// silently ignored to keep older dashboards from 400'ing.
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub cursor: Option<String>,
|
pub cursor: Option<String>,
|
||||||
|
/// Legacy field — accepted and ignored so older dashboards don't 400.
|
||||||
#[serde(default, rename = "offset")]
|
#[serde(default, rename = "offset")]
|
||||||
pub _legacy_offset: Option<i64>,
|
#[allow(dead_code)]
|
||||||
|
pub legacy_offset: Option<i64>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn default_limit() -> i64 {
|
const fn default_limit() -> i64 {
|
||||||
|
|||||||
@@ -97,15 +97,14 @@ async fn login(State(state): State<AuthState>, Json(input): Json<LoginRequest>)
|
|||||||
|
|
||||||
// F-P-002: Argon2id verify off the async worker.
|
// F-P-002: Argon2id verify off the async worker.
|
||||||
let password = input.password.clone();
|
let password = input.password.clone();
|
||||||
let password_ok = match tokio::task::spawn_blocking(move || verify_password(&stored_hash, &password))
|
let password_ok =
|
||||||
.await
|
match tokio::task::spawn_blocking(move || verify_password(&stored_hash, &password)).await {
|
||||||
{
|
Ok(b) => b,
|
||||||
Ok(b) => b,
|
Err(err) => {
|
||||||
Err(err) => {
|
tracing::error!(?err, "verify_password spawn_blocking join failed");
|
||||||
tracing::error!(?err, "verify_password spawn_blocking join failed");
|
return internal_error();
|
||||||
return internal_error();
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
if !password_ok || user_id.is_none() || !is_active {
|
if !password_ok || user_id.is_none() || !is_active {
|
||||||
return invalid_credentials();
|
return invalid_credentials();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
|
use futures::stream::{self, TryStreamExt};
|
||||||
use picloud_shared::{
|
use picloud_shared::{
|
||||||
AdminUserId, AppId, DocsEventOp, FilesEventOp, KvEventOp, ScriptId, TriggerId,
|
AdminUserId, AppId, DocsEventOp, FilesEventOp, KvEventOp, ScriptId, TriggerId,
|
||||||
};
|
};
|
||||||
@@ -984,7 +985,6 @@ impl TriggerRepo for PostgresTriggerRepo {
|
|||||||
// sum(per-row-latency). Still N+1 queries against the details
|
// sum(per-row-latency). Still N+1 queries against the details
|
||||||
// tables — collapsing to a single per-kind LEFT JOIN is a
|
// tables — collapsing to a single per-kind LEFT JOIN is a
|
||||||
// larger SQL refactor tracked as v1.2.
|
// larger SQL refactor tracked as v1.2.
|
||||||
use futures::stream::{self, TryStreamExt};
|
|
||||||
let pool = self.pool.clone();
|
let pool = self.pool.clone();
|
||||||
let out = stream::iter(parents.into_iter().map(Ok))
|
let out = stream::iter(parents.into_iter().map(Ok))
|
||||||
.map_ok(|p| {
|
.map_ok(|p| {
|
||||||
|
|||||||
@@ -610,9 +610,10 @@ impl UsersService for UsersServiceImpl {
|
|||||||
None => (TIMING_FLAT_DUMMY_HASH.to_string(), None, None),
|
None => (TIMING_FLAT_DUMMY_HASH.to_string(), None, None),
|
||||||
};
|
};
|
||||||
// F-P-002: Argon2id verify off the async worker.
|
// F-P-002: Argon2id verify off the async worker.
|
||||||
let password_ok = tokio::task::spawn_blocking(move || verify_password(&hash, &password_owned))
|
let password_ok =
|
||||||
.await
|
tokio::task::spawn_blocking(move || verify_password(&hash, &password_owned))
|
||||||
.map_err(|e| UsersError::Backend(format!("verify spawn_blocking join: {e}")))?;
|
.await
|
||||||
|
.map_err(|e| UsersError::Backend(format!("verify spawn_blocking join: {e}")))?;
|
||||||
let (Some(user_id), Some(app_id)) = (user_id, app_id) else {
|
let (Some(user_id), Some(app_id)) = (user_id, app_id) else {
|
||||||
return Ok(None);
|
return Ok(None);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user