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§
- Credentials
- Basic information about a user. Note that
realmcan be a arbitrary string and you can use to figure out a group a user belongs to like"admin". - Session
- Information about a session. Each session is associated with a
user_name.
Enums§
- AddUser
Return - Error return type of
add_user - Delete
User Return - EndSession
Return - Session
Generated Err - Error return type of error in result from
generate_session - Session
Invalided - Return type of
invalidate_session - Session
Validated - Return type of
validate_session - User
Validated Return - Error return type of
validate_user
Constants§
Functions§
- add_
user add_user- connect_
to_ db_ get_ pool - Provides a connection to a postgres server. This requires
DATABASE_URLto be set in.envfile. - delete_
user delete_user- end_
sessions end_sessions- generate_
session - 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_sessionandinvalidate_session. - invalidate_
session invalidate_session- validate_
session validate_session- validate_
user validate_user