admin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package admin is the Admin API: its routes, administrator authentication and sessions, the Host, Origin and CSRF checks, the sign-in throttle, password hashing, the status, history, monitoring and security log reads, and the handlers that ask the controller for changes.

It changes state only through the controller's exported operations and reads the database only through store.Reads, so it can never write SQLite or publish a policy itself; a test fails if it names the store's database type or a function that opens one. It owns no listener: the controller serves its Handler on the loopback admin address. The gateway wiring builds it with New.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VersionText

func VersionText() string

VersionText is the version command's output for the running binary.

Types

type Deps

type Deps struct {
	Control *controller.Controller
	Limiter *pipeline.Limiter
	UI      http.Handler
	Plain   bool
	Logger  *slog.Logger
}

Deps is what the Admin API serves: an opened controller, the data plane's rate counters (for the limits view), the dashboard files (nil: none) and the logger. Plain is true when the gateway serves the data plane itself over plain HTTP, so HSTS is never sent; false when a host program owns it.

type Server

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

Server is the Admin API: routing, authentication, the Host, Origin and CSRF checks, the login throttle, password hashing and every handler. It changes state only through the controller's exported operations and reads the database only through store.Reads.

func New

func New(d Deps) *Server

New returns the Admin API of d.Control.

func (*Server) Handler

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

Handler routes every Admin API endpoint behind the Host check.

Jump to

Keyboard shortcuts

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