should_allow_host

View as MarkdownOpen in Claude

Check if a host is in the allowed hosts list.

Parameters

host
strRequired

The hostname to check.

Returns

boolTrue if the host is allowed (or if allowed_hosts contains "*").

Example

1from signalwire.core.security_config import SecurityConfig
2
3security = SecurityConfig()
4security.allowed_hosts = ["agent.example.com", "api.example.com"]
5print(security.should_allow_host("agent.example.com")) # True
6print(security.should_allow_host("evil.example.com")) # False