vial.blueprints.auth_pwd package

This pluggable module provides classical web login form with password authentication method.

Provided endpoints

/auth_pwd/login

Page providing classical web login form.

  • Authentication: no authentication

  • Methods: GET, POST

vial.blueprints.auth_pwd.BLUEPRINT_NAME = 'auth_pwd'

Name of the blueprint as module global constant.

class vial.blueprints.auth_pwd.LoginView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.BaseLoginView

View enabling classical password login.

authenticate_user(user)[source]

Authenticate given user.

property dbmodel

This property must be implemented in each subclass to return reference to appropriate model class based on SQLAlchemy declarative base.

classmethod get_menu_title(**kwargs)[source]

Return menu entry title for the view.

Default implementation returns the return value of vial.view.BaseView.get_view_title() method by default.

Parameters

kwargs (dict) – Optional parameters.

Returns

Menu entry title for the view.

Return type

str

get_user_login()[source]

Get login of the user that is being authenticated.

classmethod get_view_title(**kwargs)[source]

Return title for the view, that will be displayed in the title tag of HTML head element and also as the content of page header in h2 tag.

Default implementation returns the return value of vial.view.BaseView.get_menu_title() method by default.

Parameters

kwargs (dict) – Optional parameters.

Returns

Title for the view.

Return type

str

is_sign_in = True
methods = ['GET', 'POST']
property search_by

Return model`s attribute (column) according to which to search for a single item.

class vial.blueprints.auth_pwd.PwdAuthBlueprint(name, import_name, **kwargs)[source]

Bases: vial.app.VialBlueprint

Pluggable module - classical authentication service (auth_pwd).

classmethod get_module_title()[source]

Get human readable name for this blueprint/module.

Returns

Name (short summary) of the blueprint/module.

Return type

str

class vial.blueprints.auth_pwd.RegisterView[source]

Bases: vial.view.mixin.HTMLMixin, vial.view.mixin.SQLAlchemyMixin, vial.view.BaseRegisterView

View enabling classical password login.

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.

do_before_action(item)[source]

Hook method. Will be called before any action handling tasks.

static get_item_form(item)[source]

Hook method. Must return instance of flask_wtf.FlaskForm appropriate for given item class.

classmethod get_menu_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_menu_title().

classmethod get_view_title(**kwargs)[source]

Implementation of vial.view.BaseView.get_view_title().

is_sign_up = True
methods = ['GET', 'POST']
property search_by

Return model`s attribute (column) according to which to search for a single item.

vial.blueprints.auth_pwd.get_blueprint()[source]

Mandatory interface for vial.Vial and factory function. This function must return a valid instance of vial.app.VialBlueprint or flask.Blueprint.