web

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Overview

Package web serves Ken's human-facing UI: the first-run setup wizard, login (Argon2id + server-side session + CSRF + per-IP login guard), search/browse, and the proposal review queue (diff + promote/reject). The human curates; the UI never creates brand-new entries — that is the AI's job over MCP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(d Deps) http.Handler

Handler returns the web UI mux. When no admin exists yet it logs the one-time setup token so the operator (who can read the log) can complete first-run setup.

Types

type Deps

type Deps struct {
	Store *store.Store
	// SecureCookies marks session cookies Secure and uses the __Host- prefix
	// (required behind TLS; disable for plain-HTTP dev).
	SecureCookies bool
	// SetupToken pins the one-time /setup token (env KEN_SETUP_TOKEN); if empty a
	// random one is generated and logged at startup while an admin is absent.
	SetupToken string
	// TrustedProxies is a comma-separated CIDR list (env KEN_TRUSTED_PROXIES);
	// X-Forwarded-For is honored for the login guard only when the direct peer
	// matches one of these. Used only when Settings is nil (tests); otherwise the
	// live value from Settings wins.
	TrustedProxies string
	// Settings, when set, makes the client-IP resolver, login lockout and session
	// TTL read live values, and enables the /settings admin page.
	Settings *settings.Live
	// OAuthEnabled mounts the interactive OAuth consent flow (/oauth/authorize)
	// and the Connectors management section. Mirrors KEN_OAUTH_ENABLED; the
	// stateless discovery/token endpoints are mounted separately in main.go.
	OAuthEnabled bool
	// I18n provides the reloadable UI translations. If nil, a Manager with the
	// embedded English + Spanish defaults (no external override dir) is used.
	I18n *i18n.Manager
}

Deps are the collaborators the web UI needs.

Jump to

Keyboard shortcuts

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