[fix] rename function name & fix sign verify
This commit is contained in:
parent
98f5e47dd8
commit
340863224c
1 changed files with 4 additions and 5 deletions
|
@ -13,7 +13,7 @@ def inbox_prechecker(
|
||||||
payload = request.headers
|
payload = request.headers
|
||||||
ap_body = request.data
|
ap_body = request.data
|
||||||
try:
|
try:
|
||||||
parsec_signature = HttpSignature.parse_signature(
|
parsed_signature = HttpSignature.parse_signature(
|
||||||
payload["signature"]
|
payload["signature"]
|
||||||
)
|
)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -33,16 +33,15 @@ def inbox_prechecker(
|
||||||
sigdate = SignedData(
|
sigdate = SignedData(
|
||||||
method = request.method,
|
method = request.method,
|
||||||
path = request.path,
|
path = request.path,
|
||||||
signed_list = parsec_signature["headers"],
|
signed_list = parsed_signature["headers"],
|
||||||
body_digest = HttpSignature.calculation_digest(ap_body),
|
body_digest = HttpSignature.calculation_digest(ap_body),
|
||||||
headers = request.headers,
|
headers = request.headers,
|
||||||
)
|
)
|
||||||
|
|
||||||
is_verify = HttpSignature.verify_signature(
|
is_verify = HttpSignature.verify_signature(
|
||||||
HttpSignature.build_signature_string(sigdate),
|
HttpSignature.build_signature_string(sigdate),
|
||||||
parsec_signature["signature"],
|
parsed_signature["signature"],
|
||||||
pub_key,
|
pub_key,
|
||||||
)
|
)
|
||||||
|
|
||||||
print(is_verify)
|
return is_verify
|
||||||
return True
|
|
||||||
|
|
Loading…
Reference in a new issue