Documentation
¶
Overview ¶
Package webhook hosts the HTTP server that ingests provider webhooks and dispatches them to the workflow runtime via workflow.Callback. See DESIGN.md § "Architecture".
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
Dispatcher receives normalised events bound for a specific runID. In production this is a thin wrapper that calls workflow.Callback.
type SecretRegistry ¶
type SecretRegistry struct {
// contains filtered or unexported fields
}
SecretRegistry maps a (provider, runID) to the HMAC secret we registered with that provider's webhook. Per-Run secrets so a leaked one only affects one Run.
func NewSecretRegistry ¶
func NewSecretRegistry() *SecretRegistry
func (*SecretRegistry) Forget ¶
func (r *SecretRegistry) Forget(providerName, runID string)
func (*SecretRegistry) Get ¶
func (r *SecretRegistry) Get(providerName, runID string) (string, bool)
func (*SecretRegistry) Set ¶
func (r *SecretRegistry) Set(providerName, runID, secret string)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the HTTP front for webhook ingestion. Mount it onto an http.ServeMux via Mount(); the daemon owns the http.Server lifecycle.
Routing: POST /webhook/{providerName}/{runID}
- Looks up the registered runID + secret
- Verifies HMAC via the provider
- Normalises the event
- Calls the registered Dispatcher
func NewServer ¶
func NewServer(providers map[string]provider.Provider, dispatcher Dispatcher, secrets *SecretRegistry) *Server
NewServer wires a Server. providers maps name → Provider impl.