For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inSign up
Support
GuidesReference
GuidesReference
    • Core
      • Overview
    • Agents
      • Overview
      • AgentBase
      • AgentServer
      • BedrockAgent
      • CLI Tools
      • Configuration
        • AuthHandler
        • ConfigLoader
        • Environment Variables
        • SecurityConfig
          • get_basic_auth
          • get_cors_config
          • get_security_headers
          • get_ssl_context_kwargs
          • get_url_scheme
          • load_from_env
          • log_config
          • should_allow_host
          • validate_ssl_config
      • ContextBuilder
      • DataMap
      • FunctionResult
      • Helper Functions
      • LiveWire
      • MCP Gateway
      • PomBuilder
      • Prefabs
      • Search
      • SkillBase
      • Skills
      • SWAIGFunction
      • SWMLBuilder
      • SWMLService
      • WebService
    • RELAY
      • Overview
      • Actions
      • Call
      • Constants
      • Events
      • Message
      • RelayClient
      • RelayError
    • REST Client
      • Overview
      • Addresses
      • Calling
      • Chat
      • Compat
      • Datasphere
      • Fabric
      • Imported Numbers
      • Logs
      • Lookup
      • MFA
      • Number Groups
      • Phone Numbers
      • Project
      • PubSub
      • Queues
      • Recordings
      • Registry
      • RestClient
      • Short Codes
      • SignalWireRestError
      • SIP Profile
      • Verified Callers
      • Video
LogoLogoSignalWire Docs
Log inSign up
Support
On this page
  • Parameters
  • Returns
  • Example
AgentsConfigurationSecurityConfig

should_allow_host

|View as Markdown|Open in Claude|
Was this page helpful?
Edit this page
Previous

validate_ssl_config

Next
Built with

Check if a host is in the allowed hosts list.

Parameters

host
strRequired

The hostname to check.

Returns

bool — True 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