File tree Expand file tree Collapse file tree 3 files changed +16
-17
lines changed
Expand file tree Collapse file tree 3 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,11 @@ def is_publishable_key(key: str) -> bool:
9191 PUBLISHABLE_KEY_TEST_PREFIX
9292 )
9393
94- has_valid_postfix = base64_decode (
95- key .split ("_" )[2 ] if len (key .split ("_" )) > 2 else ""
96- ).decode ("utf-8" ).endswith ("$" )
94+ has_valid_postfix = (
95+ base64_decode (key .split ("_" )[2 ] if len (key .split ("_" )) > 2 else "" )
96+ .decode ("utf-8" )
97+ .endswith ("$" )
98+ )
9799
98100 return has_valid_prefix and has_valid_postfix
99101
@@ -219,4 +221,3 @@ def teardown_clerk_testing_token(
219221 frontend_api_url = parsed_result .frontend_api
220222
221223 page .unroute (f"https://{ frontend_api_url } /v1/**" )
222-
Original file line number Diff line number Diff line change 1- import base64
21import json
32import typing as t
43
@@ -162,6 +161,7 @@ def distribution_headers(distribution) -> dict[str, str]:
162161def decode_cookie (response : Response ):
163162 "decode a signed cookie into a dict for inspection and assertion"
164163 from app .routes .middleware import SESSION_SECRET_KEY
164+
165165 from tests .utils import starlette_session_decode
166166
167167 signer = itsdangerous .Signer (SESSION_SECRET_KEY )
Original file line number Diff line number Diff line change 11import base64
2- import typing as t
32
43from tenacity import retry , stop_after_attempt
54
5+ from app .configuration .clerk import clerk
6+ from app .environments import is_testing
7+ from app .utils .geolocation import get_cached_public_ip
8+
9+ from tests .constants import (
10+ CLERK_ALL_USERS_TO_PRESERVE ,
11+ )
12+
13+ from .log import log
14+
615
716def base64_decode (original_b64_string : str | bytes , url_safe : bool = False ) -> bytes :
817 """
@@ -37,17 +46,6 @@ def starlette_session_decode(decoded_signed_value: bytes) -> bytes:
3746 return base64_decode (data , url_safe = True )
3847
3948
40- from app .configuration .clerk import clerk
41- from app .environments import is_testing
42- from app .utils .geolocation import get_cached_public_ip
43-
44- from tests .constants import (
45- CLERK_ALL_USERS_TO_PRESERVE ,
46- )
47-
48- from .log import log
49-
50-
5149def get_public_ip_address () -> str | None :
5250 """
5351 Get the current public IP address of this server. Helpful when you have geolocation stuff that is
You can’t perform that action at this time.
0 commit comments