{"modulePath":"github.com/txn2/mcp-data-platform","version":"v1.172.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package apiwire\n\nPackage apiwire composes the operation browser's read surface from the registries a deployment holds: which connections a caller reaches, which toolkit answers for one, and how a caller's identity reaches the route policy.\n\nIt is a package of its own rather than another file in the composition root because that root is at its size budget, and it takes the registries and the portal's already-built auth chain as inputs rather than the platform facade, which is the boundary every other adapter under internal/httpserver keeps.\n\n## Functions\n\n```go\nfunc Mount(mux *http.ServeMux, wrap func(http.Handler) http.Handler, deps Deps)\n```\nMount registers the browser's routes on mux behind the portal's own authentication and persona gate.\n\nThe routes are mounted whether or not an api-gateway toolkit is loaded. An absent route under /api/v1 falls through to the MCP root handler, which answers 401 to a browser fetch carrying only a session cookie, and the portal client turns a 401 into a redirect to the login screen. A deployment with no api connections must answer \"you reach none\", which is the empty state the page renders, rather than throwing its reader out of the portal.\n\n## Types\n\n```go\ntype Deps struct {\n\t// Toolkits is the live toolkit registry. Nil leaves the routes unmounted.\n\tToolkits *registry.Registry\n\t// Personas resolves a persona's connection rules. Nil denies every named\n\t// connection, matching the fail-closed action path.\n\tPersonas *persona.Registry\n\t// Resolver maps a caller's roles to their persona. Nil leaves every caller\n\t// without one, which reaches nothing.\n\tResolver portal.PersonaResolver\n\t// AdminRoles are the roles the admin persona is granted, read only when\n\t// IsAdmin is nil.\n\tAdminRoles []string\n\t// IsAdmin is the platform's one administrator rule (#2228), which makes a\n\t// caller's reach over this surface unrestricted.\n\tIsAdmin func(roles []string) bool\n\t// Stored is the connection store, which is what says a connection exists.\n\t// Nil lists what this process serves, which in a multi-replica deployment\n\t// is a different answer per replica (#1757).\n\tStored connview.StoreLister\n}\n```\nDeps are what the browser needs to answer for one caller. The registries are held rather than snapshotted, so a connection added or a persona edited through the admin API takes effect on the next request.\n\n","path":"github.com/txn2/mcp-data-platform/internal/httpserver/apiwire","name":"apiwire","synopsis":"Package apiwire composes the operation browser's read surface from the registries a deployment holds: which connections a caller reaches, which toolkit answers for one, and how a caller's identity reaches the route policy.","isRedistributable":true}
