COSCUP-ap-demo/demo/utils/checker.py
SouthFox e006e448ed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
[feat] process inbox request
2023-06-13 14:11:29 +08:00

17 lines
392 B
Python

from flask import Request, abort
from demo.httpsig import HttpSignature
def inbox_prechecker(
request: Request,
) -> bool:
try:
payload = request.headers
parsec_signature = HttpSignature.parse_signature(
payload["signature"]
)
print(parsec_signature)
except KeyError:
abort(401, "Missing signature key!")
return True