users
#
User Database Model
AccessToken
#
Bases: SQLAlchemyBaseAccessTokenTableUUID
, UpdatedAtMixin
, Base
FastAPI Users - Access Token Model
Source code in zoo/models/users.py
User
#
UserManager
#
bootstrap_fastapi_users(app)
#
Bootstrap the application with FastAPI Users Routers
Parameters:
Name | Type | Description | Default |
---|---|---|---|
app |
FastAPI
|
|
required |
Returns:
Type | Description |
---|---|
None
|
|
Source code in zoo/models/users.py
create_user(email, password, *, is_superuser=False)
async
#
Create a user
Parameters:
Name | Type | Description | Default |
---|---|---|---|
email |
str
|
User email |
required |
password |
str
|
User password |
required |
is_superuser |
bool
|
Is the user a superuser |
False
|
Returns:
Type | Description |
---|---|
User
|
|
Raises:
Type | Description |
---|---|
UserAlreadyExists
|
If the user already exists |
Source code in zoo/models/users.py
get_access_token_db(session=Depends(get_async_session))
async
#
Yield a SQLAlchemyAccessTokenDatabase
Source code in zoo/models/users.py
get_database_strategy(access_token_db=Depends(get_access_token_db))
#
Get a DatabaseStrategy using the AccessTokenDatabase
Source code in zoo/models/users.py
get_jwt_strategy()
#
Get a DatabaseStrategy using the AccessTokenDatabase
get_user_db(session=Depends(get_async_session))
async
#
Yield a SQLModelUserDatabaseAsync