webhook

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package webhook provides an HTTP handler for GitHub webhook events. It validates the HMAC-SHA256 signature sent by GitHub and triggers an incremental single-repo scan for push, create, delete, and repository events.

The webhook endpoint is entirely optional: it is only registered when the GITHUB_WEBHOOK_SECRET environment variable is set. The periodic full-org scan continues to work regardless.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(serverCtx context.Context, secret []byte, sc RepoScanner) http.Handler

Handler returns an http.Handler that validates GitHub webhook payloads and triggers incremental repo scans. serverCtx is used as the parent context for background scans so they are cancelled on graceful server shutdown.

Types

type RepoScanner

type RepoScanner interface {
	TriggerRepoScan(ctx context.Context, owner, repo string)
}

RepoScanner is the subset of scanner.Scanner used by the webhook handler.

Jump to

Keyboard shortcuts

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