api.authentication.database package

Submodules

api.authentication.database.models module

class api.authentication.database.models.BaseModel(**kwargs)[source]

Bases: sqlalchemy.orm.decl_api.Model

Base model for authentication user model

created_on = Column(None, DateTime(), table=None, nullable=False, server_default=DefaultClause(<sqlalchemy.sql.functions.now at 0x7f972912dee0; now>, for_update=False))
delete()[source]

Deletes an instance of the model from the database

id = Column(None, Integer(), table=None, primary_key=True, nullable=False)
save()[source]

Saves an instance of the model from the database

update()[source]

Updates an instance of the model from the database

updated_on = Column(None, DateTime(), table=None, nullable=False, onupdate=ColumnDefault(<sqlalchemy.sql.functions.now at 0x7f972912daf0; now>), server_default=DefaultClause(<sqlalchemy.sql.functions.now at 0x7f972912db80; now>, for_update=False))
class api.authentication.database.models.User(**kwargs)[source]

Bases: api.authentication.database.models.BaseModel

Class implementing authentication user model

classmethod authenticate(**kwargs)[source]

Authenticates a user given the provided arguments

check_password(password)[source]

Checks if the password hashes are equal

created_on
classmethod get_by_identifier(uid)[source]

Returns a user instance given the identifier

classmethod get_by_username(username)[source]

Returns a user instance given the username

hash_password()[source]

Generates the password hash

id
password
updated_on
username

Module contents

api.authentication.database.initialize_database(app)[source]

Prepares and registers the authentication database supported by the API.

Parameters

app (flask.Flask) – app instance

Returns

None

Return type

None type