webhook

package
v3.8.0-alpha.0+incompa... Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package webhook contains code for managing and serving webhook services, providing post push events to trigger builds.

Index

Constants

View Source
const (
	DefaultConfigRef = "master"
)

Variables

View Source
var (
	ErrSecretMismatch  = errors.New("the provided secret does not match")
	ErrHookNotEnabled  = errors.New("the specified hook is not enabled")
	MethodNotSupported = errors.New("unsupported HTTP method")
)

Functions

func FindTriggerPolicy

func FindTriggerPolicy(triggerType buildapi.BuildTriggerType, config *buildapi.BuildConfig) (buildTriggers []buildapi.BuildTriggerPolicy, err error)

FindTriggerPolicy retrieves the BuildTrigger of a given type from a build configuration

func GitRefMatches

func GitRefMatches(eventRef, configRef string, buildSource *buildapi.BuildSource) bool

GitRefMatches determines if the ref from a webhook event matches a build configuration

func NewWarning added in v1.4.0

func NewWarning(message string) *kerrors.StatusError

NewWarning returns an StatusError object with a http.StatusOK (200) code.

func ValidateWebHookSecret added in v1.3.0

func ValidateWebHookSecret(webHookTriggers []buildapi.BuildTriggerPolicy, secret string) (*buildapi.WebHookTrigger, error)

ValidateWebHookSecret validates the provided secret against all currently defined webhook secrets and if it is valid, returns its information.

Types

type Plugin

type Plugin interface {
	// Method extracts build information and returns:
	// - newly created build object or nil if default is to be created
	// - information whether to trigger the build itself
	// - eventual error.
	Extract(buildCfg *buildapi.BuildConfig, secret, path string, req *http.Request) (*buildapi.SourceRevision, []kapi.EnvVar, *buildapi.DockerStrategyOptions, bool, error)
}

Plugin for Webhook verification is dependent on the sending side, it can be eg. github, bitbucket or else, so there must be a separate Plugin instance for each webhook provider.

Directories

Path Synopsis
Package bitbucket contains webhook.Plugin implementation of bitbucket webhooks according to https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html
Package bitbucket contains webhook.Plugin implementation of bitbucket webhooks according to https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html
Package generic contains webhook.Plugin implementation of a generic webhooks for use in testing and/or other ad/hoc usage
Package generic contains webhook.Plugin implementation of a generic webhooks for use in testing and/or other ad/hoc usage
Package github contains webhook.Plugin implementation of github webhooks according to https://developer.github.com/webhooks/
Package github contains webhook.Plugin implementation of github webhooks according to https://developer.github.com/webhooks/
Package gitlab contains webhook.Plugin implementation of gitlab webhooks according to https://docs.gitlab.com/ce/user/project/integrations/webhooks.html
Package gitlab contains webhook.Plugin implementation of gitlab webhooks according to https://docs.gitlab.com/ce/user/project/integrations/webhooks.html

Jump to

Keyboard shortcuts

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