httpserver

package
v0.0.0-...-d55067e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 37 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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)

View Source
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 New

func New(v *vault.Vault, w *watcher.Watcher, static fs.FS, cfg config.Config) *Server

func (*Server) EnableMCP

func (s *Server) EnableMCP(m config.MCPConfig) error

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.

func (*Server) Router

func (s *Server) Router() http.Handler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL