From 8355fa959716591386293110a73347374e40ea2a Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Thu, 8 Aug 2019 23:00:52 +0200 Subject: [PATCH] Log authenticated fetch --- app.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app.py b/app.py index bb9d4da..3b3753b 100644 --- a/app.py +++ b/app.py @@ -436,6 +436,10 @@ def outbox(): @app.route("/outbox/") def outbox_detail(item_id): + sig = request.headers.get("Signature") + if sig: + app.logger.info(f"received an authenticated fetch: {sig}") + doc = DB.activities.find_one( { "box": Box.OUTBOX.value, @@ -454,6 +458,10 @@ def outbox_detail(item_id): @app.route("/outbox//activity") def outbox_activity(item_id): + sig = request.headers.get("Signature") + if sig: + app.logger.info(f"received an authenticated fetch: {sig}") + data = find_one_activity( {**in_outbox(), **by_remote_id(activity_url(item_id)), **is_public()} )