Configuration
Configure the HTTP Functions module inconfig.yaml:
config.yaml
Security Configuration
The module includes built-in security controls to protect against SSRF and other vulnerabilities.array<string>
default:"['*']"
List of URL patterns allowed for HTTP function invocations. Supports wildcards.Examples:
https://api.example.com/*- Allow all endpoints under api.example.comhttps://*.example.com/*- Allow all subdomains of example.com*- Allow all URLs (use with caution)
boolean
default:true
Block requests to private IP ranges (RFC 1918) to prevent SSRF attacks.Blocked ranges:
10.0.0.0/8172.16.0.0/12192.168.0.0/16127.0.0.0/8169.254.0.0/16
boolean
default:true
Require HTTPS for all HTTP function invocations. Rejects HTTP URLs.
Registering HTTP Functions
HTTP functions are registered dynamically at runtime using theregister_http_function method:
HttpFunctionConfig
string
required
The function ID to register. Used when calling the function via
client.call().string
required
The HTTP endpoint URL. Supports path parameters using
{param} syntax.Must pass URL validation against the allowlist.string
required
HTTP method:
GET, POST, PUT, PATCH, DELETEstring
Optional description of the function’s purpose
number
default:30000
Request timeout in milliseconds
object
HTTP headers to include in the request. Common use cases:
- Authentication:
Authorization: Bearer {token} - Content type:
Content-Type: application/json - API keys:
X-API-Key: {key}
HttpAuth
Authentication configuration. See Authentication section.
object
JSON schema for request validation
object
JSON schema for response validation
object
Arbitrary metadata attached to the function
Invoking HTTP Functions
Once registered, HTTP functions are called like any other function:Path Parameters
URL path parameters are extracted from the input data:Query Parameters
Non-path parameters are added as query strings:Request Body
For POST/PUT/PATCH requests, the input is sent as the request body:Authentication
The module supports various authentication methods:API Key in Headers
Bearer Token
Basic Auth
OAuth 2.0
Unregistering Functions
Remove HTTP functions when they’re no longer needed:Use Cases
External API Integration
Microservice Communication
Webhook Forwarding
Error Handling
URL Validation Errors
Request Failures
Security Best Practices
- Use allowlists - Restrict HTTP functions to trusted domains
- Enable HTTPS - Set
require_https: truein production - Block private IPs - Keep
block_private_ips: trueto prevent SSRF - Rotate credentials - Store API keys in environment variables, not hardcoded
- Validate responses - Use
response_formatto validate external API responses - Set timeouts - Prevent hanging requests with appropriate
timeout_msvalues - Rate limiting - Implement rate limiting for external API calls
- Monitor usage - Track HTTP function invocations for unusual patterns
Production Configuration
config.yaml
Development Configuration
config.yaml
Limitations
- Synchronous only - HTTP functions are invoked synchronously
- No streaming - Response must fit in memory
- No retries - Failed requests do not retry automatically
- No caching - Responses are not cached (implement caching in your code)