From 6dfdffebf9299a3b4c212724d759a87cf5073ded Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Fri, 30 Oct 2020 02:12:06 +0100 Subject: [PATCH] [Doc] Some more documentation --- flaschengeist/modules/auth/__init__.py | 29 +++++++++++--------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/flaschengeist/modules/auth/__init__.py b/flaschengeist/modules/auth/__init__.py index 01f9495..c19e4a9 100644 --- a/flaschengeist/modules/auth/__init__.py +++ b/flaschengeist/modules/auth/__init__.py @@ -1,8 +1,15 @@ -############################################# -# Plugin: Auth # -# Functionality: Allow management of # -# authentication, login, logout, etc # -############################################# +"""Flaschengeist plugin: Auth + +Allow management of authentication, login, logout, etc. + + Routes + +/auth POST: login (new token) + GET: get all tokens for user +/auth/ GET: get lifetime of token + PUT: set new lifetime + DELETE: logout / delete token +""" from flask import Blueprint, request, jsonify from werkzeug.exceptions import Forbidden, BadRequest, Unauthorized @@ -11,7 +18,6 @@ from flaschengeist import logger from flaschengeist.modules import Plugin from flaschengeist.system.decorator import login_required from flaschengeist.system.controller import sessionController, userController, messageController -from flaschengeist.system.models.session import Session auth_bp = Blueprint("auth", __name__) @@ -21,17 +27,6 @@ class AuthRoutePlugin(Plugin): super().__init__(blueprint=auth_bp) -################################################# -# Routes # -# # -# /auth POST: login (new token) # -# GET: get all tokens for user # -# /auth/ GET: get lifetime of token # -# PUT: set new lifetime # -# DELETE: logout / delete token # -################################################# - - @auth_bp.route("/auth", methods=["POST"]) def _login(): """Login User