[Doc] Some more documentation

This commit is contained in:
Ferdinand Thiessen 2020-10-30 02:12:06 +01:00
parent 50b6ac85ce
commit 6dfdffebf9
1 changed files with 12 additions and 17 deletions

View File

@ -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/<token> 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/<token> GET: get lifetime of token #
# PUT: set new lifetime #
# DELETE: logout / delete token #
#################################################
@auth_bp.route("/auth", methods=["POST"])
def _login():
"""Login User