server

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 38 Imported by: 0

Documentation

Overview

Package server wires the kafkito HTTP router and top-level handlers.

Index

Constants

View Source
const PrivateClusterHeader = "X-Kafkito-Cluster"

PrivateClusterHeader carries a base64-encoded JSON ClusterConfig for ad-hoc ("private") clusters that the user maintains client-side (browser localStorage). The header is only honoured when the URL path uses config.PrivateClusterSentinel as the cluster segment.

View Source
const ProdConfirmHeader = "X-Kafkito-Confirm-Prod"

ProdConfirmHeader is the request header the frontend must set to "true" to perform a mutating/dangerous operation (produce, delete topic, delete records, reset offsets) against a cluster marked is_prod. This is the server-side enforcement point: the frontend's confirmation dialog is a UX nicety, not a security boundary — a direct API call without this header against a production cluster is always rejected, regardless of what the caller's local cluster list says.

Variables

This section is empty.

Functions

func New

func New(opts Options) http.Handler

New returns a ready-to-serve http.Handler.

Types

type Options

type Options struct {
	Version  string
	Logger   *slog.Logger
	Registry *kafkapkg.Registry // may be nil (no kafka configured)
	Config   config.Config
	// Auth validates incoming bearer tokens and injects auth.Principal into
	// the request context for /api/v1/* routes. nil disables the
	// auth middleware (used by tests).
	Auth auth.Validator
	// contains filtered or unexported fields
}

Options configures the HTTP server.

Directories

Path Synopsis
Package api provides primitives to interact with the openapi HTTP API.
Package api provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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