hawat.blueprints.auth_dev package

Description

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

Hawat pluggable module - special developer authentication (auth_dev).

classmethod get_module_title()[source]

Implementation of hawat.base.HawatBlueprint.get_module_title().

register_app(app)[source]

Callback method. Will be called from hawat.base.HawatApp.register_blueprint() method and can be used to customize the Flask application object. Possible use cases:

  • application menu customization

Parameters

app (hawat.base.HawatApp) – Flask application to be customize.

class hawat.blueprints.auth_dev.LoginView[source]

Bases: hawat.base.HTMLMixin, hawat.base.SQLAlchemyMixin, hawat.base.SimpleView

View enabling special developer login.

dbmodel

Implementation of hawat.base.SQLAlchemyMixin.dbmodel().

dispatch_request()[source]

Mandatory interface required by the flask.views.View.dispatch_request(). Will be called by the Flask framework to service the request.

classmethod get_menu_icon()[source]

Implementation of hawat.base.BaseView.get_menu_icon().

classmethod get_menu_title(item=None)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

methods = ['GET', 'POST']
hawat.blueprints.auth_dev.get_blueprint()[source]

Mandatory interface and factory function. This function must return a valid instance of hawat.base.HawatBlueprint or flask.Blueprint.