Expand description
Structs§
- Auth
Layer - The auth layer that can be used to protect routes.
- Auth
Service - The auth service that will be used by the
AuthLayer
. - Authenticator
- Claims
- The claims that will be encoded into the JWT.
- Current
User - The user object that will be returned from the
UserData
trait. - Decoding
Key - All the different kind of keys we can use to decode a JWT. This key can be re-used so make sure you only initialize it once if you can for better performance.
- Encoding
Key - A key to encode a JWT with. Can be a secret, a PEM-encoded key or a DER-encoded key. This key can be re-used so make sure you only initialize it once if you can for better performance.
- Error
- An error that can occur when encoding/decoding JWTs
- Header
- A basic JWT header, the alg defaults to HS256 and typ is automatically
set to
JWT
. All the other fields are optional. - Login
Response - The response body for the login handler.
- Refresh
Body - The request body for the refresh token handler.
- Request
Body - The request body for the login handler.
- Validation
- Contains the various validations that are applied after decoding a JWT.
Enums§
- Algorithm
- The algorithms supported for signing/verifying JWTs
- Auth
Error - The error type for the auth module.
Traits§
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- User
Data
Functions§
- auth_
token_ decode - Decode a token.
- auth_
token_ encode - Encode a new token.
- decode
- Decode and validate a JWT
- encode
- Encode the header and claims given and sign the payload using the algorithm from the header and the key. If the algorithm given is RSA or EC, the key needs to be in the PEM format.
- login
- The login handler.
- refresh_
token - The refresh token handler.