webhook

package
v0.16.521 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0 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 webhook is the incoming webhook connector (docs/connectors.md, «Incoming webhook»): a personal address on the hub that a service (GitHub, GitLab, Grafana, Alertmanager, Sentry, n8n, Zapier, Make, anything that posts JSON) sends its events to. The hub keeps nothing of a request: it passes it over the machine's link to the runtime (connectors.webhook), and here, on the machine, the signature is checked by the connection's secret from the safe, the body is kept under the connection's folder for the agent's reads, and the event becomes a webhook.received envelope without text, with its kind (alert.firing, ci.failed, pr.opened, issue.assigned…) as a fact.

Index

Constants

View Source
const (
	PresetGitHub       = hookauth.PresetGitHub
	PresetGitLab       = hookauth.PresetGitLab
	PresetGrafana      = hookauth.PresetGrafana
	PresetAlertmanager = hookauth.PresetAlertmanager
	PresetSentry       = hookauth.PresetSentry
	PresetJSON         = hookauth.PresetJSON
)

Presets of the services it understands.

View Source
const (
	AuthHeader = hookauth.AuthHeader
	AuthPath   = hookauth.AuthPath
)

How a service proves a request is its own, for the presets that let the person choose.

View Source
const EventReceived = "webhook.received"

EventReceived is its one event type; the kind of what happened is the fact "kind".

View Source
const ID = "webhook"

ID names the connector.

View Source
const (
	// MaxBody is the largest body taken; the hub refuses a larger one before it reaches the machine.
	MaxBody = 1 << 20
)
View Source
const SourceKey = "hookSource"

SourceKey is the config key the managed path sets to the hub's source of the webhook (stage 4): its address is then the hub's /hook/t/<source>/<token>, and the hub checks the signature.

Variables

View Source
var Base = func() string { return "" }

Base is the public address of this machine's webhooks on its hub (https://hub.example.com/api/platform/automations/ hook/m/<machine>), set by the runtime; "" while the machine is not linked to a hub.

Functions

func HubBase

func HubBase() string

HubBase is the hub's address of webhooks (…/automations/hook), from Base.

func ManagedAddress

func ManagedAddress(source, secret string) string

ManagedAddress is the address of a webhook the hub keeps: /hook/t/<source>/<token>, the token derived from the secret the service signs with (hookauth.RouteToken). "" while the machine is not linked to a hub.

Types

This section is empty.

Jump to

Keyboard shortcuts

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