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 ¶
var MergeCallerLog = glog.Infof
MergeCallerLog records one line per merge request naming its caller. It is a variable rather than a direct glog call, matching vaultapi.MergeLog, so the specs can assert the line without depending on glog's file sinks. Production never reassigns it.
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.