{"modulePath":"github.com/stacklok/toolhive","version":"v0.68.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package validating\n\nPackage validating implements a validating webhook middleware for ToolHive. It calls external HTTP services to approve or deny MCP requests.\n\n## Constants\n\n```go\nconst MiddlewareType = \"validating-webhook\"\n```\nMiddlewareType is the type constant for the validating webhook middleware.\n\n## Functions\n\n```go\nfunc CreateMiddleware(config *types.MiddlewareConfig, runner types.MiddlewareRunner) error\n```\nCreateMiddleware is the factory function for validating webhook middleware.\n\n## Types\n\n```go\ntype FactoryMiddlewareParams struct {\n\tMiddlewareParams\n\t// ServerName is the name of the ToolHive instance.\n\tServerName string `json:\"server_name\"`\n\t// Transport is the transport type (e.g., sse, stdio).\n\tTransport string `json:\"transport\"`\n}\n```\nFactoryMiddlewareParams extends MiddlewareParams with context for the factory.\n\n```go\ntype Middleware struct {\n\t// contains filtered or unexported fields\n}\n```\nMiddleware wraps validating webhook functionality for the factory pattern.\n\n```go\nfunc (*Middleware) Close() error\n```\nClose cleans up any resources used by the middleware.\n\n```go\nfunc (m *Middleware) Handler() types.MiddlewareFunction\n```\nHandler returns the middleware function used by the proxy.\n\n```go\ntype MiddlewareParams struct {\n\t// Webhooks is the list of validating webhook configurations to call.\n\t// Webhooks are called in configuration order; if any webhook denies the request,\n\t// the request is rejected. All webhooks must allow the request for it to proceed.\n\tWebhooks []webhook.Config `json:\"webhooks\"`\n}\n```\nMiddlewareParams holds the configuration parameters for the validating webhook middleware.\n\n```go\nfunc (p *MiddlewareParams) Validate() error\n```\nValidate checks that the MiddlewareParams are valid.\n\n","path":"github.com/stacklok/toolhive/pkg/webhook/validating","name":"validating","synopsis":"Package validating implements a validating webhook middleware for ToolHive.","isRedistributable":true}
