Skip to content

Commit c740c2f

Browse files
committed
test(auth): pin the passthrough test's key URL like the env deployment it simulates
1 parent f9eaf61 commit c740c2f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

backend/tests/external_dependency_unit/auth/test_jwt_passthrough.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,17 @@ def _reset_key_cache() -> Any:
138138

139139

140140
def _point_at(monkeypatch: pytest.MonkeyPatch, url: str) -> None:
141-
# Both modules read the shared security settings at call time.
141+
# Both modules read the shared security settings at call time. The URL is
142+
# treated as env-pinned, matching the env-configured deployment this test
143+
# simulates, so the local plain-http JWKS server stays fetchable.
142144
settings = _build_env_defaults().model_copy(update={"jwt_public_key_url": url})
143145
monkeypatch.setattr(jwt_module, "get_security_settings", lambda: settings)
144146
monkeypatch.setattr(users_module, "get_security_settings", lambda: settings)
147+
monkeypatch.setattr(
148+
jwt_module,
149+
"env_pinned_active_fields",
150+
lambda: frozenset({"jwt_public_key_url"}),
151+
)
145152

146153

147154
async def _authenticate(token: str) -> User | None:

0 commit comments

Comments
 (0)