Crate http_tunnel_handler

Crate http_tunnel_handler 

Source
Expand description

Shared utilities for AWS Lambda handlers

This module provides common functionality used across all Lambda functions including DynamoDB operations, request/response transformations, and helper functions.

Modules§

auth
Authentication module for WebSocket connections
content_rewrite
Content rewriting module for path-based routing
error_handling
Error handling and sanitization
handlers
Handler modules

Structs§

SharedClients
Shared AWS clients used across all handlers

Functions§

build_api_gateway_response
Convert HttpResponse to API Gateway response
build_http_request
Build HttpRequest from API Gateway event
delete_connection
Delete connection from DynamoDB
extract_tunnel_id_from_path
Extract tunnel ID from request path (path-based routing) Example: “/abc123/api/users” -> “abc123”
is_event_driven_enabled
Check if event-driven response pattern is enabled
lookup_connection_by_tunnel_id
Look up connection ID by tunnel ID using GSI (path-based routing)
save_connection_metadata
Save connection metadata to DynamoDB
save_pending_request
Save pending request to DynamoDB
send_to_connection
Send message to WebSocket connection
strip_tunnel_id_from_path
Strip tunnel ID from path before forwarding to local service Example: “/abc123/api/users” -> “/api/users” Example: “/abc123” -> “/”
update_pending_request_with_response
Update pending request with response data
wait_for_response
Wait for response with event-driven or polling approach based on USE_EVENT_DRIVEN flag