hawat.blueprints.auth_dev package¶
This Hawat pluggable module provides special authentication method, that is particularly usable for developers and enables them to impersonate any user.
After enabling this module special authentication endpoint will be available and will provide simple authentication form with list of all currently available user accounts. It will be possible for that user to log in as any other user without entering password.
This module is disabled by default in production environment and enabled by default in development environment.
Warning
This module must never ever be enabled on production systems, because it is a huge security risk and enables possible access control management violation. You have been warned!
Provided endpoints¶
/auth_dev/login
Page providing special developer login form.
Authentication: no authentication
Methods:
GET
,POST
-
hawat.blueprints.auth_dev.
BLUEPRINT_NAME
= 'auth_dev'¶ Name of the blueprint as module global constant.
-
class
hawat.blueprints.auth_dev.
DevAuthBlueprint
(name, import_name, **kwargs)[source]¶ Bases:
hawat.base.HawatBlueprint
Pluggable module - developer authentication service (auth_dev).
-
classmethod
get_module_title
()[source]¶ Get human readable name for this blueprint/module.
- Returns
Name (short summary) of the blueprint/module.
- Return type
str
-
name
= None¶
-
classmethod
-
class
hawat.blueprints.auth_dev.
LoginView
[source]¶ Bases:
hawat.view.mixin.HTMLMixin
,hawat.view.mixin.SQLAlchemyMixin
,hawat.view.BaseLoginView
View enabling special developer login.
-
property
dbmodel
¶ This property must be implemented in each subclass to return reference to appropriate model class based on SQLAlchemy declarative base.
Return menu entry title for the view.
Default implementation returns the return value of
hawat.view.BaseView.get_view_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Menu entry title for the view.
- Return type
str
-
classmethod
get_view_title
(**kwargs)[source]¶ Return title for the view, that will be displayed in the
title
tag of HTMLhead
element and also as the content of page header inh2
tag.Default implementation returns the return value of
hawat.view.BaseView.get_menu_title()
method by default.- Parameters
kwargs (dict) – Optional parameters.
- Returns
Title for the view.
- Return type
str
-
methods
: Optional[List[str]] = ['GET', 'POST']¶
-
property
search_by
¶ Return model`s attribute (column) according to which to search for a single item.
-
property
-
class
hawat.blueprints.auth_dev.
RegisterView
[source]¶ Bases:
hawat.view.mixin.HTMLMixin
,hawat.view.mixin.SQLAlchemyMixin
,hawat.view.BaseRegisterView
View responsible for registering new user account into application.
-
property
dbchlogmodel
¶ This property must be implemented in each subclass to return reference to appropriate model class based on SQLAlchemy declarative base.
-
property
dbmodel
¶ This property must be implemented in each subclass to return reference to appropriate model class based on SQLAlchemy declarative base.
-
static
get_item_form
(item)[source]¶ Hook method. Must return instance of
flask_wtf.FlaskForm
appropriate for given item class.
Implementation of
hawat.view.BaseView.get_menu_title()
.
-
classmethod
get_view_title
(**kwargs)[source]¶ Implementation of
hawat.view.BaseView.get_view_title()
.
-
methods
: Optional[List[str]] = ['GET', 'POST']¶
-
property