mirror of
https://github.com/FAUSheppy/atlantis-event-dispatcher
synced 2025-12-06 14:31:35 +01:00
change: remove inbuilt authentication
This commit is contained in:
8
app.py
8
app.py
@@ -3,12 +3,4 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
def createApp(envivorment=None, start_response=None):
|
def createApp(envivorment=None, start_response=None):
|
||||||
|
|
||||||
# check files & environment
|
|
||||||
signal = os.environ.get("SIGNAL_CLI_BIN")
|
|
||||||
|
|
||||||
if not os.environ.get("SIGNAL_API_PASS"):
|
|
||||||
print("SIGNAL_API_PASS must be set in enviromenment", file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
return interface.app
|
return interface.app
|
||||||
|
|||||||
13
interface.py
13
interface.py
@@ -5,7 +5,6 @@ import flask
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
from functools import wraps
|
|
||||||
import datetime
|
import datetime
|
||||||
import secrets
|
import secrets
|
||||||
|
|
||||||
@@ -38,17 +37,6 @@ class DispatchObject(db.Model):
|
|||||||
method = Column(String)
|
method = Column(String)
|
||||||
dispatch_secret = Column(String)
|
dispatch_secret = Column(String)
|
||||||
|
|
||||||
def login_required(f):
|
|
||||||
@wraps(f)
|
|
||||||
def decorated_function(*args, **kwargs):
|
|
||||||
auth = flask.request.authorization
|
|
||||||
print(auth.password)
|
|
||||||
print(type(auth.password))
|
|
||||||
if not auth or not auth.lower() == app.config["PASSWORD"]:
|
|
||||||
return (flask.jsonify({ 'message' : 'Authentication required' }), 401)
|
|
||||||
return f(*args, **kwargs)
|
|
||||||
return decorated_function
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/get-dispatch')
|
@app.route('/get-dispatch')
|
||||||
def get_dispatch():
|
def get_dispatch():
|
||||||
@@ -104,7 +92,6 @@ def confirm_dispatch():
|
|||||||
|
|
||||||
|
|
||||||
@app.route('/smart-send', methods=["POST"])
|
@app.route('/smart-send', methods=["POST"])
|
||||||
@login_required
|
|
||||||
def smart_send_to_clients():
|
def smart_send_to_clients():
|
||||||
'''Send to clients based on querying the LDAP
|
'''Send to clients based on querying the LDAP
|
||||||
requests MAY include:
|
requests MAY include:
|
||||||
|
|||||||
Reference in New Issue
Block a user