Skip to content

v0.1.0

Choose a tag to compare

@erwagasore erwagasore released this 26 Feb 11:40
· 6 commits to main since this release

Features

  • Stateless CSRF protection middleware using Signed Double-Submit Cookie pattern with HMAC-SHA256
  • Token generation with 32-byte random nonce and base64url encoding (87 chars)
  • Constant-time token verification via timing_safe.eql
  • Cookie management with configurable name, path, max-age, Secure, and SameSite attributes
  • Origin/Referer validation (opt-in defence-in-depth)
  • Configurable rejection status and body
  • Safe method detection with custom method support
  • Token extraction from header (x-csrf-token) with form field (_csrf) fallback
  • Example server with form-based CSRF flow