nest_backend package

Submodules

nest_backend.gestione module

A utilities Python Module.

Gestione adds many fancy thingamajigs to the flask application, such as a login system and such.

nest_backend.gestione.admin_or_403(f)
nest_backend.gestione.authenticate(username, password)

Authentication method. It checks if the combination of username+password is a valid match. If not, it returns None. :param username: the user’s email :param password: the user’s password :return: if the credentials are correct, it returns the user. Else, it returns None.

nest_backend.gestione.find_user(email)
nest_backend.gestione.gen_password(password)

It generates an hashed password. :param password: the password that needs to be hashed. :return: the password’s hash.

nest_backend.gestione.identity(payload)

Authentication verification method. It checks if the user is in fact registered on the server. It is required by Flask-JWT, and shouldnt be used alone. :param payload: the reqest payload. :return: an User or None. It depends whether the user is actually registered on the platform.

nest_backend.gestione.json_error(msg)

Returns an error in json format :param msg: the error message. :return: a json formatted string.

nest_backend.gestione.json_success(data)

An happy little function. Its happy because the operation was successful. :param data: the thing you want to be returned :return: a json formatted string

nest_backend.gestione.repository_auth(f)

Module contents