Debian Codegraph @

examples/oauth/server/models.py

raw
1 """
2 Copyright 2022 by J. Christopher Wagner (jwag). All rights reserved.
3 :license: MIT, see LICENSE for more details.
4
5 """
6
7 from flask_security.models import fsqla_v3 as fsqla
8 from flask_security import SQLAlchemyUserDatastore
9 from flask_sqlalchemy import SQLAlchemy
10
11 # Create database connection object
12 db = SQLAlchemy()
13
14 # Define models
15 fsqla.FsModels.set_db_info(db)
16
17
18 class Role(db.Model, fsqla.FsRoleMixin):
19 pass
20
21
22 class User(db.Model, fsqla.FsUserMixin):
23 pass
24
25
26 class WebAuthn(db.Model, fsqla.FsWebAuthnMixin):
27 pass
28
29
30 # Setup Flask-Security
31 user_datastore = SQLAlchemyUserDatastore(db, User, Role, WebAuthn)