diff --git a/app/auth/auth_jwks.py b/app/auth/auth_jwks.py index 26df8d4..8f061e8 100644 --- a/app/auth/auth_jwks.py +++ b/app/auth/auth_jwks.py @@ -44,7 +44,7 @@ async def get_jwks(self) -> KeySet: """Get cached or new JWKS.""" url = self.config.jwks_uri logger.info(f"Fetching JSON Web Key Set from {url}") - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(timeout=30) as client: response = await client.get(url) return JsonWebKey.import_key_set(response.json()) diff --git a/tests/conftest.py b/tests/conftest.py index d0be6be..1a203ec 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -95,7 +95,10 @@ def protected_bearer_schema(create_protected_with_bearer_app): def get_access_token(): """Fetch an access token.""" - with Client(base_url=cfg.OAUTH2_TOKEN_ENDPOINT) as client: + with Client( + base_url=cfg.OAUTH2_TOKEN_ENDPOINT, + timeout=30, + ) as client: response = client.post( "/", headers={