mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Log authenticated fetch
This commit is contained in:
parent
06462ec8ff
commit
8355fa9597
1 changed files with 8 additions and 0 deletions
8
app.py
8
app.py
|
@ -436,6 +436,10 @@ def outbox():
|
||||||
|
|
||||||
@app.route("/outbox/<item_id>")
|
@app.route("/outbox/<item_id>")
|
||||||
def outbox_detail(item_id):
|
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(
|
doc = DB.activities.find_one(
|
||||||
{
|
{
|
||||||
"box": Box.OUTBOX.value,
|
"box": Box.OUTBOX.value,
|
||||||
|
@ -454,6 +458,10 @@ def outbox_detail(item_id):
|
||||||
|
|
||||||
@app.route("/outbox/<item_id>/activity")
|
@app.route("/outbox/<item_id>/activity")
|
||||||
def outbox_activity(item_id):
|
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(
|
data = find_one_activity(
|
||||||
{**in_outbox(), **by_remote_id(activity_url(item_id)), **is_public()}
|
{**in_outbox(), **by_remote_id(activity_url(item_id)), **is_public()}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue