# Passport.js Node Interface Requirements (High-Level) - **Middleware pipeline** - Supports `req`, `res`, and `next()` chaining (Express/Connect interface). - **HTTP request/response objects** - `req` and `res` implement Node’s `IncomingMessage` / `ServerResponse` APIs. - Expose: `headers`, `method`, `url`, `statusCode`, etc. - Both behave as **EventEmitters**. - **Request parsing** - Access to `req.body`, `req.query`, and `req.params`. - **Cookies** - Ability to read and set cookies (`req.cookies`, `res.cookie()`). - **Sessions** - Session mechanism (`req.session`) or equivalent for authentication persistence. - **Redirects** - Response redirection (`res.redirect()` or manual 302 responses). - **Header manipulation** - Support for `req.headers`, `res.setHeader()`, and `res.getHeader()`. - **Crypto utilities** - Access to hashing, signing, and verification (Node’s `crypto` module). - **URL and body parsing** - `url`, `querystring`, and `body-parser` middleware compatibility.