Skip to content

Commit 20853cc

Browse files
committed
refactor: Format
1 parent 11a8ae0 commit 20853cc

File tree

1 file changed

+5
-5
lines changed
  • supertokens_python/recipe/session

1 file changed

+5
-5
lines changed

supertokens_python/recipe/session/jwks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class JWKSConfigType(TypedDict):
3535
JWKSConfig: JWKSConfigType = {
3636
"cache_max_age": JWKCacheMaxAgeInMs,
3737
"refresh_rate_limit": JWKRequestCooldownInMs, # FIXME: Not used
38-
"request_timeout": 5000, # 5s
38+
"request_timeout": 5000, # 5s
3939
}
4040

4141

@@ -46,9 +46,7 @@ def __init__(self, path: str, keys: List[PyJWK]):
4646
self.last_refresh_time = get_timestamp_ms()
4747

4848
def is_fresh(self):
49-
return (
50-
get_timestamp_ms() - self.last_refresh_time < JWKSConfig["cache_max_age"]
51-
)
49+
return get_timestamp_ms() - self.last_refresh_time < JWKSConfig["cache_max_age"]
5250

5351

5452
cached_keys: Optional[CachedKeys] = None
@@ -116,7 +114,9 @@ def get_latest_keys(kid: Optional[str] = None) -> List[PyJWK]:
116114
cached_jwks: Optional[List[PyJWK]] = None
117115
try:
118116
log_debug_message("Fetching jwk set from the configured uri")
119-
with requests.get(path, timeout=JWKSConfig['request_timeout']/1000) as response: # 5 second timeout
117+
with requests.get(
118+
path, timeout=JWKSConfig["request_timeout"] / 1000
119+
) as response: # 5 second timeout
120120
response.raise_for_status()
121121
cached_jwks = PyJWKSet.from_dict(response.json()).keys # type: ignore
122122
except Exception as e:

0 commit comments

Comments
 (0)