Module mini_rust_auth::auth
source · Expand description
A set of base functions that are used to do all the underlying work of auth. This includes user and session management.
Structs§
- Basic information about a user. Note that
realm
can be a arbitrary string and you can use to figure out a group a user belongs to like"admin"
. - Information about a session. Each session is associated with a
user_name
.
Enums§
- Error return type of
add_user
- Error return type of
generate_session
- Return type of
invalidate_session
- Return type of
validate_session
- Error return type of
validate_user
Functions§
add_user
- Provides a connection to a postgres server. This requires
DATABASE_URL
to be set. - Will create a session for the provided user. The users information is stored in
credentials
. Once the session is generated it will be stored in the DB. The validity and state of the session can be changed later withvalidate_session
andinvalidate_session
. invalidate_session
validate_session
validate_user