Expand description
Generic authentication primitives for Fabryk.
Provides:
AuthenticatedUser— Identity extracted from a validated tokenTokenValidator— Trait for async token validation (implement per provider)AuthLayer/AuthService— Tower middleware parameterised overTokenValidatorAuthConfig— Configuration for the auth layerAuthError— Auth-specific error types
Structs§
- Auth
Config - Configuration for the auth middleware.
- Auth
Layer - Tower
Layerthat wraps services with token authentication. - Auth
Service - Tower
Servicethat validates tokens before forwarding requests. - Authenticated
User - An authenticated user identity, extracted from a validated token.
Enums§
- Auth
Error - Errors that can occur during authentication.
Traits§
- Token
Validator - Trait for validating tokens and extracting user identity.
Functions§
- email_
from_ parts - Extract the user’s email from HTTP request
Parts. - user_
from_ parts - Extract the
AuthenticatedUserfrom HTTP requestParts, if present.