Expand description
Middleware components for the microsandbox server.
This module handles:
- Request/response middleware
- Authentication and authorization
- Request tracing and logging
- Error handling
The module provides:
- Middleware components for common operations
- Authentication middleware for API security
- Logging and tracing middleware
Functions§
- auth_
middleware - Authentication middleware for verifying API keys and namespace access
- logging_
middleware - Log incoming requests
- mcp_
smart_ auth_ middleware - Smart authentication middleware for MCP requests that handles protocol vs tool methods differently Protocol methods (initialize, tools/list, prompts/list, prompts/get) don’t require namespace validation Tool methods (tools/call) require namespace validation
- proxy_
middleware - Proxy middleware for forwarding requests to a target service
- proxy_
uri - Convert a URI to a proxied URI targeting a sandbox
- validate_
token_ and_ namespace - Validate the token and check namespace access