[feat] pprint inbox log
This commit is contained in:
parent
157073a4a7
commit
632e10c956
1 changed files with 8 additions and 1 deletions
|
@ -5,15 +5,22 @@ from flask import Request, abort
|
|||
from demo.httpsig import HttpSignature, SignedData
|
||||
from demo.actor import fetch_actor
|
||||
from app import logger
|
||||
from pprint import pformat
|
||||
|
||||
|
||||
def inbox_prechecker(
|
||||
request: Request,
|
||||
) -> bool:
|
||||
"""Inbox request prechecker"""
|
||||
try:
|
||||
json_payload = request.json
|
||||
except json.JSONDecodeError:
|
||||
abort(401, "no activity+json request!")
|
||||
|
||||
headers = request.headers
|
||||
payload = request.data
|
||||
logger.debug(f"new request {payload=}\n{headers=}")
|
||||
logger.info(f"new request \n{pformat(json_payload)}\n{pformat({k: v for k, v in request.headers})}")
|
||||
|
||||
try:
|
||||
parsed_signature = HttpSignature.parse_signature(
|
||||
headers["signature"]
|
||||
|
|
Loading…
Reference in a new issue