Rename the authentication endpoint

master
kaiyou 7 years ago
parent 3c9552a14b
commit ff71e70360

@ -6,6 +6,7 @@ import urllib
SUPPORTED_AUTH_METHODS = ["none", "plain"] SUPPORTED_AUTH_METHODS = ["none", "plain"]
STATUSES = { STATUSES = {
"authentication": ("Authentication credentials invalid", { "authentication": ("Authentication credentials invalid", {
"imap": "AUTHENTICATIONFAILED", "imap": "AUTHENTICATIONFAILED",

@ -4,8 +4,10 @@ from mailu.internal import internal, nginx
import flask import flask
@internal.route("/nginx") @internal.route("/auth/email")
def nginx_authentication(): def nginx_authentication():
""" Main authentication endpoint for Nginx email server
"""
headers = nginx.handle_authentication(flask.request.headers) headers = nginx.handle_authentication(flask.request.headers)
response = flask.Response() response = flask.Response()
for key, value in headers.items(): for key, value in headers.items():

@ -89,15 +89,15 @@ http {
server { server {
listen 127.0.0.1:8000; listen 127.0.0.1:8000;
location /internal { location / {
proxy_pass http://admin; proxy_pass http://admin/internal/;
} }
} }
} }
mail { mail {
server_name {{ HOSTNAMES.split(",")[0] }}; server_name {{ HOSTNAMES.split(",")[0] }};
auth_http http://127.0.0.1:8000/internal/nginx; auth_http http://127.0.0.1:8000/auth/email;
proxy_pass_error_message on; proxy_pass_error_message on;
{% if TLS and not TLS_ERROR %} {% if TLS and not TLS_ERROR %}

Loading…
Cancel
Save