协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
rust-service-security【开发与工程】Use when adding, changing, testing, or reviewing security-sensitive Rust web service behavior, especially login flows, password hashing, credential checks, session cookies, flash messages, admin route protection, auth middleware, user enumeration defenses, or moving CPU-heavy password work off async executors.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this skill when a Rust service handles identity, credentials, sessions, cookies, privileged routes, or sensitive user data. Prefer explicit threat checks and tests over optimistic handler code.
HttpOnly, Secure,
SameSite, path, lifetime, signing/encryption, and store backend.Read references/password-auth.md before implementing or changing password
storage or verification.
tokio::task::spawn_blocking or a dedicated blocking abstraction for
expensive password operations.Read references/cookies-sessions.md when setting, reading, deleting, signing,
or persisting cookies and sessions.
Set-Cookie headers.Read references/auth-middleware.md when adding admin routes, extractors,
guards, or framework middleware.
Keep handlers typed:
pub async fn admin_dashboard(user: AuthenticatedUser) -> Result<HttpResponse, AppError> {
// Handler can assume authentication succeeded.
Ok(HttpResponse::Ok().finish())
}
Avoid optional user lookups in handlers that require authentication; make the missing-user case impossible at the handler signature when the framework allows it.
references/password-auth.md: Argon2, PHC strings, user enumeration, and
blocking password work.references/cookies-sessions.md: cookie flags, signed messages, server-side
sessions, and logout.references/auth-middleware.md: route guards, extractors, and typed session
access.