Documentation
¶
Overview ¶
Package server wires the kafkito HTTP router and top-level handlers.
Index ¶
Constants ¶
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.
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 ¶
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.
Source Files
¶
- acls.go
- api_routes.go
- apierror.go
- clusters_api.go
- groups.go
- message_params.go
- messages.go
- path_params.go
- private_cluster.go
- private_cluster_access.go
- prod_confirm.go
- ratelimit.go
- rbac.go
- requestlog.go
- schemas.go
- scram_users.go
- secheaders.go
- server.go
- stores.go
- system.go
- topic_consumers.go
- topic_copy.go
- topics.go
- userapi_default.go
- validation.go