mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-02 23:20:56 -04:00
Use the new version of the notifications-python-client. This version no longer adds the req and pay to the claims of the jwt. The change is backward compatible so an older client that sends a JWT with the extra claims will pass authentication. Once all the clients have been updated to not include the extra claims some updates to exclude them from the method signatures will happen as well. The documentation has been updated to reflect this change. https://www.pivotaltracker.com/story/show/116971293
22 lines
731 B
Python
22 lines
731 B
Python
from flask import jsonify, request
|
|
from app import (version, status_api_client)
|
|
from app.status import status
|
|
from notifications_python_client.errors import HTTPError
|
|
|
|
|
|
@status.route('/_status', methods=['GET'])
|
|
def show_status():
|
|
if request.args.get('elb', None):
|
|
return jsonify(status="ok"), 200
|
|
else:
|
|
try:
|
|
api_status = status_api_client.get_status()
|
|
except HTTPError as e:
|
|
return jsonify(status="error", message=str(e.message)), 500
|
|
return jsonify(
|
|
status="ok",
|
|
api=api_status,
|
|
travis_commit=version.__travis_commit__,
|
|
travis_build_number=version.__travis_job_number__,
|
|
build_time=version.__time__), 200
|