admin

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 36 Imported by: 0

Documentation

Overview

Package admin serves the admin API under /admin: sign-in with local accounts, cookie sessions with CSRF tokens, the GraphQL endpoint, and the configuration MCP endpoint at /admin/mcp for administrators' tokens.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store    revision.Store
	Accounts accounts.Store
	// Catalog keeps what schema scans found; in memory when nil.
	Catalog catalog.Store
	// Plans keeps plan templates and MCP tokens; nil refuses them.
	Plans      configapp.PlanStore
	Introspect configapp.Introspection
	// Bus runs the scans and the console's event feed; optional (unbounded
	// without one).
	Bus *bus.Bus
	// Status reports the serving process to the console; optional.
	Status func() graph.RuntimeState
	// Capabilities reports what the serving connections may do; optional.
	Capabilities func() bootstrap.EntityCapabilities
	// PathPrefix is the path a gateway serves the service under and strips
	// from requests (server.pathPrefix); pages, the cookie and redirects
	// carry it.
	PathPrefix string
	// SecureCookie marks the session cookie Secure; set it when serving TLS.
	SecureCookie bool
	// Playground mounts GraphiQL at /admin/playground and enables GraphQL
	// schema introspection. It is a development aid.
	Playground bool
	Now        func() time.Time
}

Config wires the admin API.

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves /admin/*.

func New

func New(cfg Config) *Handler

New builds the admin handler.

func (*Handler) Close added in v0.1.12

func (h *Handler) Close()

Close stops the background schema scans.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
Package accounts holds the business rules for administrator accounts.
Package accounts holds the business rules for administrator accounts.
Package auth holds what the admin HTTP layer and the GraphQL resolvers share: argon2id password hashing, admin permissions and the signed-in principal on a request context.
Package auth holds what the admin HTTP layer and the GraphQL resolvers share: argon2id password hashing, admin permissions and the signed-in principal on a request context.
Package configapp is the configuration service of the admin plane: the scanned catalog, schema scans and scan batches, plans and their previews, plan templates, pending work and administrators' MCP tokens.
Package configapp is the configuration service of the admin plane: the scanned catalog, schema scans and scan batches, plans and their previews, plan templates, pending work and administrators' MCP tokens.
Package configmcp serves the configuration MCP endpoint at /admin/mcp: an agent, signed in with one of an administrator's tokens, acts for the administrator: it searches the scanned catalog, scans schemas, previews plans against the administrator's workspace and writes them into it (the one copy the administrator edits in the console, so they see the changes as if made there), and diffs and simulates configurations.
Package configmcp serves the configuration MCP endpoint at /admin/mcp: an agent, signed in with one of an administrator's tokens, acts for the administrator: it searches the scanned catalog, scans schemas, previews plans against the administrator's workspace and writes them into it (the one copy the administrator edits in the console, so they see the changes as if made there), and diffs and simulates configurations.
Package graph implements the admin GraphQL API.
Package graph implements the admin GraphQL API.
Package scanjobs runs long administrative work, such as schema scans, on the Scan lane of the execution bus, off the request path: a request starts a job and polls it, so a slow database ties up neither the request nor the service.
Package scanjobs runs long administrative work, such as schema scans, on the Scan lane of the execution bus, off the request path: a request starts a job and polls it, so a slow database ties up neither the request nor the service.
Package ui embeds the built admin console (web/admin).
Package ui embeds the built admin console (web/admin).

Jump to

Keyboard shortcuts

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