Crate humphrey_auth

Source
Expand description

Web applications commonly need a way of authenticating users. This crate provides an easy and secure way to do this, integrating with Humphrey using the AuthApp trait and allowing complete control over the database users are stored in. Humphrey Auth does not come with a database, but the AuthDatabase trait is implemented for Vec<User> to get started. For a production use, you should use a proper database and implement the AuthDatabase trait for it.

If a JSON representation of users is useful for your database, you can enable the json feature which provides JSON serialization and deserialization for User and Session using the Humphrey JSON crate.

Learn more about Humphrey Auth here.

Modules§

app
Provides the authentication-related extensions to the Humphrey app.
config
Contains configuration functionality for the authentication service.
database
Contains database traits for connecting the authentication service with a database of your choosing. These are automatically implemented for Vec<User> as an example.
error
Provides error handling capabilities to the crate.
session
Provides functionality for handling sessions and tokens.
user
Provides a user model for the authentication service.

Structs§

AuthProvider
Represents an authentication provider. Contains a database of users and provides methods for managing authentication.