Compare commits

..

No commits in common. "f39d319b25f5197859b06947d27e27e563aaafd6" and "969ba0f64c68f4f1249b524696c74c7a34498ec1" have entirely different histories.

3 changed files with 0 additions and 22 deletions

View File

@ -1,3 +0,0 @@
- 2023.1
* Implement #3, a /ping health check endpoint

View File

@ -42,15 +42,6 @@ def create_app():
check_password_hash(users.get(username), password): check_password_hash(users.get(username), password):
return username return username
@app.route("/ping", methods=['GET'])
@auth.login_required
def ping():
remote_user = auth.username()
app.logger.info('Received ping for'
f' anchor f2b-jail/{remote_user}')
return jsonify({'anchor': f'f2b-jail/{remote_user}',
'operation': 'ping',
'result': 'pong'})
@app.route("/flush/<name>", methods=['GET']) @app.route("/flush/<name>", methods=['GET'])
@auth.login_required @auth.login_required
def flush(name): def flush(name):

View File

@ -1,10 +0,0 @@
def test_ping(client, mocker, valid_credentials):
'''
Test application health check
'''
response = client.get("/ping",
headers={"Authorization":
"Basic " + valid_credentials})
assert response.json['operation'] == 'ping'