Skip to content
Snippets Groups Projects
Commit 8084aa31 authored by nimrod's avatar nimrod
Browse files

Merge branch 'drowolath'

parents 9275119d ebdfac12
No related branches found
No related tags found
No related merge requests found
Pipeline #1126 passed
......@@ -3,7 +3,6 @@ FROM registry.hub.docker.com/library/python:3.9-slim-buster
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
git \
libldap2-dev \
libsasl2-dev \
&& \
......
"""LDAP authentication webserver to use with Nginx' auth_request."""
# pylint: disable=import-error
from flask import Flask
from flask_simpleldap import LDAP
import os
from flask import Flask, token
from flask_ldap_auth import login_required
app = Flask(__name__)
ldap = LDAP(app)
app.config["SECRET_KEY"] = os.getenv("SECRET_KEY", os.urandom(16))
app.config["LDAP_AUTH_SERVER"] = os.getenv("LDAP_AUTH_SERVER", "ldapi:///")
app.config["LDAP_TOP_DN"] = os.getenv("LDAP_TOP_DN")
app.register_blueprint(token, url_prefix="/auth")
@app.route("/ping")
......@@ -20,7 +24,7 @@ def index():
@app.route("/login")
@ldap.basic_auth_required
@login_required
def login():
return "OK"
......
flask
#flask-simpleldap
git+https://github.com/adarnimrod/flask-simpleldap.git@ldapi-support#egg=flask-simpleldap
flask-ldap-auth
gunicorn
python-ldap
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment