Skip to main content

Crate sova_passport

Crate sova_passport 

Source
Expand description

Passport-style authentication for Sova.

  • Passport — strategy registry, authenticate, session serialize/deserialize, login/logout
  • Auth / AuthMw — extract + verify strategies (Bearer, API key, JWT)
  • feature jwt: [JwtAuth] (users, refresh, migrate)
  • feature oauth: [Oauth] (OAuth2 code + PKCE)

Structs§

ApiTokenRevoked
Fired after an API personal access token is revoked.
Auth
Strategy constructors: Auth::bearer, Auth::api_key, [Auth::jwt_hs256], …
AuthBuilder
Builder before AuthBuilder::verify binds the user type.
AuthMw
Strategy middleware: extract credential → verify → req.set(U).
Authenticated
Marker that a principal id was established (session and/or strategy).
Credentials
Extracted credential string.
Extract
Ordered chain of extractors — first match wins.
Passport
Passport.js-style authentication manager.

Enums§

Source
Where a credential was found.

Traits§

AuthExt
Prefer PassportExt — kept as a deprecated alias name for docs only. Passport request helpers (login / logout / isAuthenticated / user).
PassportExt
Passport request helpers (login / logout / isAuthenticated / user).

Functions§

local_strategy
Proper local strategy (JSON email/password) — body consumed once.
passport_serialize
After setting the user on req, run configured serialize_user and store the id.