test(anthropic): pin case-insensitive matching of WIF exchange-host allowlist entries

This commit is contained in:
mateo-berri 2026-09-05 13:22:05 -07:00
parent adc50b0f9e
commit fd63ff1fa1

View file

@ -278,6 +278,11 @@ class TestExchangeHostTrust:
monkeypatch.setenv("LITELLM_ANTHROPIC_WIF_ALLOWED_HOSTS", "gateway.internal:8443")
assert self._mint("https://gateway.internal:8443", monkeypatch) == "https://gateway.internal:8443/v1/oauth/token"
def test_allowlist_matching_ignores_hostname_case(self, monkeypatch: pytest.MonkeyPatch):
monkeypatch.setenv("LITELLM_ANTHROPIC_WIF_ALLOWED_HOSTS", "Gateway.Internal:8443")
assert self._mint("https://gateway.internal:8443", monkeypatch) == "https://gateway.internal:8443/v1/oauth/token"
assert self._mint("https://GATEWAY.internal:8443", monkeypatch) == "https://GATEWAY.internal:8443/v1/oauth/token"
class TestBaseUrlDerivation:
def _mint(self, api_base: str | None, monkeypatch: pytest.MonkeyPatch) -> str: