custom

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package custom is the config-only generic webhook source: operators map any vendor's alert JSON to investigation requests with dot-path field extraction (sources.custom.instances.<name>), no Go required.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is the generic webhook source adapter. One Source serves every configured instance; the core-stamped source.InstanceHeader selects which mapping applies to a delivery (see source.Built.Handler).

func (*Source) Authenticate

func (s *Source) Authenticate(_ []byte, h http.Header) bool

Authenticate verifies a delivery's bearer token. Implementing source.Authenticator skips the core's shared webhook auth, so the ladder is re-established here explicitly: the instance's own token when configured (shared no longer accepted — tighter, per-vendor secrets), else the shared server.webhook_token_env value resolved at Build, else open (mirroring the alertmanager source; app.RequireWebhookAuth still refuses to start a model-configured server with an empty shared token, and Build fails closed under actions.mode=auto below).

func (*Source) Decode

func (s *Source) Decode(body []byte, h http.Header) (source.DecodeResult, error)

Decode maps one delivery through the instance's field paths. A single non-conforming event is skipped (fail-safe: one junk element must not void a batch); an unknown instance is an error (→ 400) — it means a route/config mismatch, not vendor noise.

Jump to

Keyboard shortcuts

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