clean up and turn off auth for test env

This commit is contained in:
Jim Moffet
2022-07-01 11:19:58 -07:00
parent 1e979ad519
commit 1c5d432427
6 changed files with 15 additions and 16 deletions

2
.gitignore vendored
View File

@@ -109,6 +109,8 @@ environment.sh
.env
.env*
varsfile
*.log.json
logs/**
# CloudFoundry
.cf

View File

@@ -126,6 +126,7 @@ class Development(Config):
class Test(Development):
BASIC_AUTH_FORCE = False
DEBUG = True
TESTING = True
WTF_CSRF_ENABLED = False

View File

@@ -30,8 +30,7 @@ def index():
return render_template(
'views/signedout.html',
sms_rate=CURRENT_SMS_RATE,
counts={"organisations":0,"services":1}
# counts=status_api_client.get_count_of_live_services_and_organisations()
counts=status_api_client.get_count_of_live_services_and_organisations()
)

View File

@@ -1,24 +1,12 @@
from flask import current_app, jsonify, request
from notifications_python_client.errors import HTTPError
from app import status_api_client, version, basic_auth
from app import status_api_client, version
from app.status import status
from functools import wraps
def health_check():
def wrapper(fn):
@wraps(fn)
def decorator(*args, **kwargs):
return jsonify(status="ok"), 200
# if '/_status' in request.url:
# return jsonify(status="ok"), 200
# else:
# return fn(*args, **kwargs)
return decorator
return wrapper
@status.route('/_status', methods=['GET'])
def show_status():
if request.args.get('elb', None) or request.args.get('simple', None):

View File

@@ -16,3 +16,12 @@
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T05:47:06", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T05:53:38", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T05:53:39", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:04:09", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:05:26", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:06:32", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:07:00", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:07:15", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:07:16", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:07:40", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:12:24", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}
{"name": "app", "levelname": "INFO", "message": "Logging configured", "pathname": "/home/vscode/.local/lib/python3.9/site-packages/notifications_utils/logging.py", "lineno": 37, "time": "2022-07-01T18:19:20", "requestId": "no-request-id", "application": "admin", "service_id": "no-service-id", "logType": "application"}

View File

@@ -37,4 +37,4 @@ npm run build
# run flask
# make run
echo "FINISHED ENTRYPOINT SCRIPT"
echo "FINISHED ENTRYPOINT SCRIPT"