summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-09-10 20:01:34 +0300
committerLars Wirzenius <liw@liw.fi>2018-09-10 20:01:34 +0300
commit23b2f4d5ee90be543d73a811295884949424369a (patch)
tree1862f8f782edcd08077446fa3739235f7e617d0c
parent3c46cb2ec6d38157c4659cddd7616e2fe4926748 (diff)
downloadqvisqve-23b2f4d5ee90be543d73a811295884949424369a.tar.gz
Drop: /login endpoint (not used anymore)
-rw-r--r--qvisqve/__init__.py3
-rw-r--r--qvisqve/api.py3
-rw-r--r--qvisqve/login_router.py62
-rw-r--r--without-tests2
4 files changed, 4 insertions, 66 deletions
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 <http://www.gnu.org/licenses/>.
-
-
-import bottle
-
-
-import qvisqve
-
-
-login_template = '''\
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8">
- <meta name="description" content="Qvisqve Login">
- <meta name="author" content="Qvarnlabs Ltd">
- <title>Qvisqve Login</title>
- </head>
- <body>
- <form action="/auth" method="POST">
- User name: <input name="username" type="text" />
- <br />
- Password: <input name="password" type="password" />
- <br />
- <input type="submit" value="Login" />
- </form>
- </body>
-</html>
-'''
-
-
-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