Crate rustapi_extras

Crate rustapi_extras 

Source
Expand description

§rustapi-extras

Optional security and utility features for the RustAPI framework.

This crate provides production-ready middleware and utilities that are opt-in via Cargo feature flags to minimize binary size when not needed.

§Features

  • jwt - JWT authentication middleware and AuthUser<T> extractor
  • cors - CORS middleware with builder pattern configuration
  • rate-limit - IP-based rate limiting middleware
  • config - Configuration management with .env file support
  • cookies - Cookie parsing extractor
  • sqlx - SQLx database error conversion to ApiError
  • extras - Meta feature enabling jwt, cors, and rate-limit
  • full - All features enabled

§Example

[dependencies]
rustapi-extras = { version = "0.1", features = ["jwt", "cors"] }