FastAPI security and authentication best practices. Use when implementing or reviewing auth in FastAPI — OAuth2PasswordBearer, getcurrentuser dependencies, router-level auth, password hashing, token endpoints. Triggers on OAuth2PasswordBearer, OAuth2PasswordRequestForm, getcurrentuser, or Depends-based auth.
FastAPI testing best practices. Use when writing or reviewing tests for a FastAPI app — TestClient, dependencyoverrides, async httpx clients. Triggers on TestClient, AsyncClient, ASGITransport, dependencyoverrides, or pytest test files for FastAPI endpoints.