Commit Graph

3 Commits

Author SHA1 Message Date
zhenyi 61dc08c036 refactor(session): extract SessionConfig and add auto-migration
- session/config.rs: add SessionConfig struct that pre-validates all
  session configuration values, with build_middleware() for infallible
  middleware construction
- session/middleware.rs: expose parse_same_site as pub(crate)
- session/storage/redis.rs: derive Clone for RedisSessionStore
- main.rs: validate session config before HttpServer loop, use
  SessionConfig::build_middleware() inside closure; add
  sqlx::migrate!() call after database connection
2026-06-10 18:48:55 +08:00
zhenyi 2bb5834167 feat(session): add session middleware with Redis storage support
- Implemented SessionMiddleware with cookie-based session key management
- Added support for encrypted and signed session cookies
- Integrated Redis backend for session state persistence
- Implemented session lifecycle management (create, update, delete)
- Added TTL extension policies for session timeout handling
- Created fluent builder for session middleware configuration
- Implemented cookie security features (secure, http-only, same-site)
- Added session state loading and persistence logic
- Implemented proper error handling and logging for session operations
- Added support for configurable session cookie parameters
- Implemented session key extraction and validation from requests
2026-06-07 17:42:27 +08:00
zhenyi 563381c1ca feat: init 2026-06-07 11:30:56 +08:00