def validate_hostname_is_trusted()

in azure-kusto-data/azure/kusto/data/kusto_trusted_endpoints.py [0:0]


    def validate_hostname_is_trusted(self, hostname: str, login_endpoint: str):
        if _is_local_address(hostname):
            return
        if self._override_matcher is not None:
            if self._override_matcher(hostname):
                return
        else:
            matcher = self._matchers.get(login_endpoint.lower())
            if matcher is not None and matcher.is_match(hostname):
                return

        matcher = self._additional_matcher
        if matcher is not None and matcher.is_match(hostname):
            return

        raise KustoClientInvalidConnectionStringException(
            f"Can't communicate with '{hostname}' as this hostname is currently not trusted; please see " f"https://aka.ms/kustotrustedendpoints"
        )