Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit 8816c7c

Browse files
committed
Update docstring param & return syntax
1 parent f242718 commit 8816c7c

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

paddle_billing/Logger/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ def get_logger(
99
"""
1010
Configures a logger instance that our Client() uses
1111
12-
@param log_level: Defaults to logging.INFO
13-
@param log_file_path: Defaults to None, which streams logs to the console. If a file path is provided logs are written to the file.
14-
@return: Returns a logger instance
12+
:param log_level: Defaults to logging.INFO
13+
:param log_file_path: Defaults to None, which streams logs to the console. If a file path is provided logs are written to the file.
14+
:return: Returns a logger instance
1515
"""
1616
logger = logging.getLogger('paddle_billing')
1717

paddle_billing/Notifications/PaddleSignature.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def parse(signature_header: str) -> tuple:
3232
"""
3333
Parse the Paddle-Signature header to extract the timestamp and signature
3434
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)
3737
"""
3838
components = {
3939
PaddleSignature().TIMESTAMP: 0,
@@ -70,10 +70,10 @@ def __do_verify(self, timestamp: str, signatures: list[str], raw_body: str, secr
7070
Verifies an individual secret key against a Paddle-Signature header.
7171
Called by PaddleSignature.verify()
7272
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
7777
"""
7878
new_body_to_verify = f"{timestamp}:{raw_body}".encode('utf-8')
7979
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
9595
Performs an integrity check on a Paddle webhook's signature against one or more Secrets
9696
Handling multiple Secrets is needed because of key rotation situations
9797
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
102102
"""
103103
is_list = type(secrets) is list
104104
key_count = 'multiple secret keys' if is_list else 'one secret key'

paddle_billing/Notifications/Verifier.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def maximum_variance(self) -> int:
2424

2525
def verify(self, request: requests, secrets: list[Secret] | Secret, verify_time_drift = True):
2626
"""
27-
@param request: The request object to verify
28-
@param secrets: One or more Secrets to use for verifying the request
29-
@param verify_time_drift: Defaults to True. Set False to disable time drift verification (NOT RECOMMENDED, counters MITM attacks)
30-
@return: True on verification success, False on verification failure
27+
:param request: The request object to verify
28+
:param secrets: One or more Secrets to use for verifying the request
29+
:param verify_time_drift: Defaults to True. Set False to disable time drift verification (NOT RECOMMENDED, counters MITM attacks)
30+
:return: True on verification success, False on verification failure
3131
"""
3232
self.log.info(f"Attempting to verify the authenticity of a request")
3333

0 commit comments

Comments
 (0)