@@ -32,8 +32,8 @@ def parse(signature_header: str) -> tuple:
32
32
"""
33
33
Parse the Paddle-Signature header to extract the timestamp and signature
34
34
35
- @ param signature_header: The Paddle-Signature key=value from the webhook event's headers
36
- @ return: A tuple containing (timestamp, signature)
35
+ : param signature_header: The Paddle-Signature key=value from the webhook event's headers
36
+ : return: A tuple containing (timestamp, signature)
37
37
"""
38
38
components = {
39
39
PaddleSignature ().TIMESTAMP : 0 ,
@@ -70,10 +70,10 @@ def __do_verify(self, timestamp: str, signatures: list[str], raw_body: str, secr
70
70
Verifies an individual secret key against a Paddle-Signature header.
71
71
Called by PaddleSignature.verify()
72
72
73
- @ param signatures: The Paddle-Signature header
74
- @ param raw_body: Raw body of the webhook request
75
- @ param secret_key: A Paddle secret key: https://developer.paddle.com/webhooks/signature-verification#get-secret-key
76
- @ return: True on verification success, False on verification failure
73
+ : param signatures: The Paddle-Signature header
74
+ : param raw_body: Raw body of the webhook request
75
+ : param secret_key: A Paddle secret key: https://developer.paddle.com/webhooks/signature-verification#get-secret-key
76
+ : return: True on verification success, False on verification failure
77
77
"""
78
78
new_body_to_verify = f"{ timestamp } :{ raw_body } " .encode ('utf-8' )
79
79
generated_signature = PaddleSignature .calculate_hmac (secret_key .secret_key , new_body_to_verify ).hexdigest ()
@@ -95,10 +95,10 @@ def verify(self, signature_header: str, raw_body: str, secrets: list[Secret] | S
95
95
Performs an integrity check on a Paddle webhook's signature against one or more Secrets
96
96
Handling multiple Secrets is needed because of key rotation situations
97
97
98
- @ param signature_header: The Paddle-Signature header
99
- @ param raw_body: Raw body of the webhook request
100
- @ param secrets: One or more Paddle secret key(s): https://developer.paddle.com/webhooks/signature-verification#get-secret-key
101
- @ return: True if any secret key passes verification success. Raises a ConnectionRefusedError if all secret keys fail verification
98
+ : param signature_header: The Paddle-Signature header
99
+ : param raw_body: Raw body of the webhook request
100
+ : param secrets: One or more Paddle secret key(s): https://developer.paddle.com/webhooks/signature-verification#get-secret-key
101
+ : return: True if any secret key passes verification success. Raises a ConnectionRefusedError if all secret keys fail verification
102
102
"""
103
103
is_list = type (secrets ) is list
104
104
key_count = 'multiple secret keys' if is_list else 'one secret key'
0 commit comments