Documentation
¶
Index ¶
Constants ¶
const AllowAllOrigins = "*"
AllowAllOrigins is the wildcard operators reach for first. Comparing it literally, as any other string, meant ZENNOTES_ALLOWED_ORIGINS="*" locked everything out with no hint that it was unsupported. (#482)
const NullOrigin = "null"
NullOrigin is what a browser sends for an opaque origin — a sandboxed iframe, a data: document, or a page loaded over file:// in most engines.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Config config.Config
Vault *vault.Vault
Watcher *watcher.Watcher
Static fs.FS // embedded web bundle, may be nil in dev
// contains filtered or unexported fields
}
func (*Server) EnableMCP ¶
EnableMCP turns on the built-in MCP endpoint, for Router to route at /mcp. An error means the server should not start.
MCP clients use their own tokens, which open /mcp and nothing else. The server's token and browser sessions do not open /mcp, so a leaked MCP token can never reach the REST API and a restricted agent never holds the unrestricted token. That only means something if the REST API needs a token at all, which is why one is required.