fix(server): clippy fixes for Task 4 (CI green)
All checks were successful
All checks were successful
Task 4 (bfcdbb5) compiles and passes all 32 tests on the build host; only
clippy -D warnings blocked CI. Fixed the two denials:
- rate_limit.rs: converted a dangling /// doc block (no documented item) to //
to clear clippy::empty_line_after_doc_comments
- db/events.rs: #[allow(dead_code)] on CONNECTION_REJECTED_EXPIRED_CODE and
_CANCELLED_CODE (not-yet-wired audit-event constants), matching the file's
existing STREAMING_STOPPED pattern; TODO comments note the rejection-event wiring
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -40,9 +40,11 @@ impl EventTypes {
|
||||
// Failed connection events (security audit trail)
|
||||
pub const CONNECTION_REJECTED_NO_AUTH: &'static str = "connection_rejected_no_auth";
|
||||
pub const CONNECTION_REJECTED_INVALID_CODE: &'static str = "connection_rejected_invalid_code";
|
||||
#[allow(dead_code)] // TODO(audit-events): emit on expired-code bind rejection
|
||||
pub const CONNECTION_REJECTED_EXPIRED_CODE: &'static str = "connection_rejected_expired_code";
|
||||
pub const CONNECTION_REJECTED_INVALID_API_KEY: &'static str =
|
||||
"connection_rejected_invalid_api_key";
|
||||
#[allow(dead_code)] // TODO(audit-events): emit on cancelled-code bind rejection
|
||||
pub const CONNECTION_REJECTED_CANCELLED_CODE: &'static str =
|
||||
"connection_rejected_cancelled_code";
|
||||
}
|
||||
|
||||
@@ -325,12 +325,12 @@ fn too_many_requests(detail: &str, error_code: &str) -> Response {
|
||||
// Axum middleware functions (one per protected route)
|
||||
// ============================================================================
|
||||
|
||||
/// Selects which limiter from [`RateLimitState`] a middleware uses.
|
||||
///
|
||||
/// Each protected route gets its own `from_fn_with_state` middleware pointing at
|
||||
/// the matching limiter; keeping them as distinct functions avoids threading an
|
||||
/// extra "which limiter" parameter through the layer and keeps the wiring in
|
||||
/// `main.rs` self-documenting.
|
||||
// Selects which limiter from `RateLimitState` a middleware uses.
|
||||
//
|
||||
// Each protected route gets its own `from_fn_with_state` middleware pointing at
|
||||
// the matching limiter; keeping them as distinct functions avoids threading an
|
||||
// extra "which limiter" parameter through the layer and keeps the wiring in
|
||||
// `main.rs` self-documenting.
|
||||
|
||||
/// Rate-limit middleware for `POST /api/auth/login`.
|
||||
pub async fn login_rate_limit(
|
||||
|
||||
Reference in New Issue
Block a user