From 23b2f4d5ee90be543d73a811295884949424369a Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 10 Sep 2018 20:01:34 +0300 Subject: Drop: /login endpoint (not used anymore) --- qvisqve/__init__.py | 3 ++- qvisqve/api.py | 3 +-- qvisqve/login_router.py | 62 ------------------------------------------------- without-tests | 2 +- 4 files changed, 4 insertions(+), 66 deletions(-) delete mode 100644 qvisqve/login_router.py diff --git a/qvisqve/__init__.py b/qvisqve/__init__.py index a596298..29a53dc 100644 --- a/qvisqve/__init__.py +++ b/qvisqve/__init__.py @@ -16,6 +16,8 @@ from .version import __version__, __version_info__ from .log_setup import setup_logging, log +from .tmpl import render_template + from .file_store import ( FileStore, ResourceStoreError, @@ -46,7 +48,6 @@ from .token import TokenGenerator from .router import Router from .version_router import VersionRouter from .management_router import ManagementRouter -from .login_router import LoginRouter from .auth_router import AuthRouter from .token_router import TokenRouter diff --git a/qvisqve/api.py b/qvisqve/api.py index d8b3001..9950694 100644 --- a/qvisqve/api.py +++ b/qvisqve/api.py @@ -40,10 +40,9 @@ class API: version = qvisqve.VersionRouter() mgmt = qvisqve.ManagementRouter(storedir, baseurl) token = qvisqve.TokenRouter(tg, clients, users, self._attempts) - login = qvisqve.LoginRouter() auth = qvisqve.AuthRouter(applications, users, self._attempts) - routers = [version, mgmt, token, login, auth] + routers = [version, mgmt, token, auth] self._routes = [] for router in routers: qvisqve.log.log( diff --git a/qvisqve/login_router.py b/qvisqve/login_router.py deleted file mode 100644 index ef460b4..0000000 --- a/qvisqve/login_router.py +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (C) 2018 Ivan Dolgov -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - - -import bottle - - -import qvisqve - - -login_template = '''\ - - - - - - - Qvisqve Login - - -
- User name: -
- Password: -
- -
- - -''' - - -class LoginRouter(qvisqve.Router): - - def get_routes(self): - return [ - { - 'method': 'GET', - 'path': '/login', - 'callback': self._login, - 'needs-authorization': False, - }, - ] - - def _login(self, *args, **kwargs): - headers = { - 'Content-Type': 'text/html; charset=utf-8', - } - template = bottle.template(login_template) - return qvisqve.ok_response(template, headers=headers) diff --git a/without-tests b/without-tests index 11a86db..f128753 100644 --- a/without-tests +++ b/without-tests @@ -6,10 +6,10 @@ qvisqve/app.py qvisqve/auth_router.py qvisqve/backend.py qvisqve/log_setup.py -qvisqve/login_router.py qvisqve/management_router.py qvisqve/responses.py qvisqve/router.py +qvisqve/tmpl.py qvisqve/token.py qvisqve/token_router.py qvisqve/version.py -- cgit v1.2.1