handler

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: BSD-2-Clause Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package handler owns the HTTP surface: the five canonical admin endpoints and the typed /api/v1 read endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(
	ctx context.Context,
	index *vaultapi.Index,
	gatewaySecret string,
	vaultPath string,
	vaultName string,
	writer gitrest.Client,
	clock libtime.CurrentDateTime,
	taskPublisher publisher.TaskPublisher,
) http.Handler

NewHandler builds the service router. When gatewaySecret is non-empty every /api/v1/* request must carry it in X-Gateway-Secret; the admin endpoints stay unauthenticated, matching the fleet's contract.

The write endpoints need five things the read endpoints do not: vaultPath, to read the original bytes before re-rendering them; vaultName, which stamps the change event so a consumer sharing one topic across vaults can tell its own tasks apart; writer, to hand the rendered file to git-rest; clock, so an approval's instant is injected rather than read from the wall clock; and taskPublisher, which turns a landed write into a change event.

Types

This section is empty.

Jump to

Keyboard shortcuts

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