fix(server): clippy fixes for Task 4 (CI green)
All checks were successful
Build and Test / Build Agent (Windows) (push) Successful in 6m3s
Build and Test / Build Server (Linux) (push) Successful in 10m19s
Build and Test / Security Audit (push) Successful in 4m10s
Build and Test / Build Summary (push) Successful in 9s

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:
2026-05-29 21:17:23 -07:00
parent bfcdbb5379
commit 21189423f2
2 changed files with 8 additions and 6 deletions

View File

@@ -40,9 +40,11 @@ impl EventTypes {
// Failed connection events (security audit trail) // Failed connection events (security audit trail)
pub const CONNECTION_REJECTED_NO_AUTH: &'static str = "connection_rejected_no_auth"; pub const CONNECTION_REJECTED_NO_AUTH: &'static str = "connection_rejected_no_auth";
pub const CONNECTION_REJECTED_INVALID_CODE: &'static str = "connection_rejected_invalid_code"; 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_EXPIRED_CODE: &'static str = "connection_rejected_expired_code";
pub const CONNECTION_REJECTED_INVALID_API_KEY: &'static str = pub const CONNECTION_REJECTED_INVALID_API_KEY: &'static str =
"connection_rejected_invalid_api_key"; "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 = pub const CONNECTION_REJECTED_CANCELLED_CODE: &'static str =
"connection_rejected_cancelled_code"; "connection_rejected_cancelled_code";
} }

View File

@@ -325,12 +325,12 @@ fn too_many_requests(detail: &str, error_code: &str) -> Response {
// Axum middleware functions (one per protected route) // Axum middleware functions (one per protected route)
// ============================================================================ // ============================================================================
/// Selects which limiter from [`RateLimitState`] a middleware uses. // Selects which limiter from `RateLimitState` a middleware uses.
/// //
/// Each protected route gets its own `from_fn_with_state` middleware pointing at // Each protected route gets its own `from_fn_with_state` middleware pointing at
/// the matching limiter; keeping them as distinct functions avoids threading an // the matching limiter; keeping them as distinct functions avoids threading an
/// extra "which limiter" parameter through the layer and keeps the wiring in // extra "which limiter" parameter through the layer and keeps the wiring in
/// `main.rs` self-documenting. // `main.rs` self-documenting.
/// Rate-limit middleware for `POST /api/auth/login`. /// Rate-limit middleware for `POST /api/auth/login`.
pub async fn login_rate_limit( pub async fn login_rate_limit(