From 73af8193b6360278ab4a9ffb69ffbf9693643651 Mon Sep 17 00:00:00 2001 From: ale <ale@incal.net> Date: Fri, 27 Jun 2014 17:19:04 +0200 Subject: [PATCH] nginx auth should be served on / --- authserv/app_nginx.py | 2 +- authserv/test/test_app_nginx.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/authserv/app_nginx.py b/authserv/app_nginx.py index b754c8a..169c859 100644 --- a/authserv/app_nginx.py +++ b/authserv/app_nginx.py @@ -6,7 +6,7 @@ app = Flask(__name__) _default_port_map = {'imap': 143, 'pop3': 110} -@app.route('/auth', methods=('GET',)) +@app.route('/', methods=('GET',)) def do_nginx_http_auth(): service = app.config.get('NGINX_AUTH_SERVICE', 'mail') username = request.environ.get('HTTP_AUTH_USER') diff --git a/authserv/test/test_app_nginx.py b/authserv/test/test_app_nginx.py index 1f1e6c6..0f233be 100644 --- a/authserv/test/test_app_nginx.py +++ b/authserv/test/test_app_nginx.py @@ -4,8 +4,6 @@ from authserv import protocol from authserv import server from authserv import app_nginx -URL = '/api/1/auth' - class ServerTest(unittest.TestCase): @@ -27,7 +25,7 @@ class ServerTest(unittest.TestCase): def test_nginx_http_auth_ok(self): response = self.app.get( - '/auth', headers={ + '/', headers={ 'Auth-User': 'user', 'Auth-Pass': 'pass', 'Client-IP': '127.0.0.1', @@ -39,7 +37,7 @@ class ServerTest(unittest.TestCase): def test_nginx_http_auth_fail(self): response = self.app.get( - '/auth', headers={ + '/', headers={ 'Auth-User': 'user', 'Auth-Pass': 'bad password', 'Client-IP': '127.0.0.1', -- GitLab