async-trait in custom extractors.State, not global mutable stateIntoResponse implementations, error typesRun in order. Do not write a finding until the step that applies has passed.
Cargo.toml (crate or workspace root) and can state axum (and related tower/tower-http) versions and Rust edition. Then apply 0.6 vs 0.7+ or Edition 2024–specific checklist items only when that file supports them.[FILE:LINE] from the current tree for the handler, router, layer, or type under review (not from memory, docs-only, or another branch).Report findings as:
[FILE:LINE] ISSUE_TITLE
Severity: Critical | Major | Minor | Informational
Description of the issue and why it matters.
| Issue Type | Reference |
|---|---|
| ------------ | ----------- |
| Route definitions, nesting, method routing | references/routing.md |
| State, Path, Query, Json, body extractors | references/extractors.md |
| Tower middleware, layers, error handling | references/middleware.md |
/api/users, /api/orders).get(), .post(), not .route() with manual method matching)Json, Form, Bytes) are the LAST parameterState requires T: Clone — typically Arc or direct Clone derivePath parameter types match the route definitionQuery fields are Option for optional query params with #[serde(default)]FromRequestParts (not body) or FromRequest (body)async fn in trait impls (no #[async_trait] needed for FromRequest/FromRequestParts)State, not global mutable staticsClone derived or manually implemented on state typeLazyLock from std (not once_cell::sync::Lazy or lazy_static!)IntoResponse for proper HTTP error codesResult pattern used for handlers-> impl IntoResponse capture all in-scope lifetimes by default; use + use<> to opt out of capturing request lifetimes when returning owned datatower-http used for common concerns (CORS, compression, tracing, timeout)#[async_trait] can migrate to native async fn in trait implsState (race conditions)sqlx::Error returned to client)async-trait still used for FromRequest/FromRequestParts when native async fn works.get(), .post()tower-http::trace for request loggingonce_cell::sync::Lazy or lazy_static! used where std::sync::LazyLock workstower-http layers for common concernsutoipa or aide#[axum::debug_handler] on handlers — Debugging aid that improves compile error messagesExtension for middleware-injected data — Valid pattern for request-scoped valuesimpl IntoResponse from handlers — More flexible than concrete typesRouter::new() per module, merged in main — Standard organization patternServiceBuilder for layer composition — Tower pattern, not over-engineeringaxum::serve with TcpListener — Standard axum 0.7+ server setupasync fn in FromRequest/FromRequestParts impls — async-trait crate no longer needed (stable since Rust 1.75)+ use<'a> on handler return types — Edition 2024 precise capture syntax for RPITstd::sync::LazyLock for shared static state — Replaces once_cell/lazy_static (stable since Rust 1.80)Complete Gates (before reporting findings) and load the review-verification-protocol skill for category-specific checks before any issue is final.
共 2 个版本