Skip to content

Commit 556cba6

Browse files
committed
format what needs formatting
1 parent 2e21112 commit 556cba6

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/workos/sso/_resource.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
from .models import Profile, SSOLogoutAuthorizeResponse, SSOTokenResponse
1111
from .models import SSOProvider
12+
from .._types import RequestOptions
1213
from ..connections.models import Connection, ConnectionsConnectionType, ConnectionsOrder
1314
from .._pagination import AsyncPage, SyncPage
14-
from .._types import RequestOptions
1515

1616

1717
class SSO:
@@ -325,6 +325,7 @@ def delete_connection(
325325
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
326326
"""
327327
self._client.connections.delete(id, request_options=request_options)
328+
328329
# @oagen-ignore-end
329330

330331

@@ -639,4 +640,5 @@ async def delete_connection(
639640
request_options: Per-request options. Supports extra_headers, timeout, max_retries, and base_url override.
640641
"""
641642
await self._client.connections.delete(id, request_options=request_options)
643+
642644
# @oagen-ignore-end

src/workos/webhooks/_resource.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
from __future__ import annotations
44

5-
import hashlib
6-
import hmac
7-
import json
8-
import time
95
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
106

117
if TYPE_CHECKING:
@@ -20,6 +16,10 @@
2016
)
2117
from .._pagination import AsyncPage, SyncPage
2218
from .._types import RequestOptions
19+
import hashlib
20+
import hmac
21+
import json
22+
import time
2323

2424

2525
class Webhooks:
@@ -249,7 +249,9 @@ def verify_header(
249249

250250
issued_timestamp = issued_timestamp[2:]
251251
signature_hash = signature_hash[3:]
252-
max_seconds_since_issued = tolerance if tolerance is not None else self.DEFAULT_TOLERANCE
252+
max_seconds_since_issued = (
253+
tolerance if tolerance is not None else self.DEFAULT_TOLERANCE
254+
)
253255
current_time = time.time()
254256
timestamp_in_seconds = int(issued_timestamp) / 1000
255257
seconds_since_issued = current_time - timestamp_in_seconds
@@ -258,9 +260,7 @@ def verify_header(
258260
raise ValueError("Timestamp outside the tolerance zone")
259261

260262
body_str = (
261-
event_body.decode("utf-8")
262-
if isinstance(event_body, bytes)
263-
else event_body
263+
event_body.decode("utf-8") if isinstance(event_body, bytes) else event_body
264264
)
265265
unhashed_string = f"{issued_timestamp}.{body_str}"
266266
expected_signature = hmac.new(
@@ -273,6 +273,7 @@ def verify_header(
273273
raise ValueError(
274274
"Signature hash does not match the expected signature hash for payload"
275275
)
276+
276277
# @oagen-ignore-end
277278

278279

0 commit comments

Comments
 (0)