webhook

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthFailed = errors.New("Auth Failed")

ErrAuthFailed indicates some part of the auth handshake failed

This is usually indicative of an auth failure between the client library and GitHub

Functions

func NewGithubHookHandler

func NewGithubHookHandler(s storage.Store, authors []string, x509Key []byte, opts GithubOpts) gin.HandlerFunc

NewGithubHookHandler creates a GitHub webhook handler.

func SHA1HMAC

func SHA1HMAC(salt, message []byte) string

SHA1HMAC computes the GitHub SHA1 HMAC.

Types

type GithubOpts

type GithubOpts struct {
	// CheckSuiteOnPR will trigger a check suite run for new PRs that pass the security params.
	CheckSuiteOnPR      bool
	AppID               int
	DefaultSharedSecret string
	EmittedEvents       []string
}

GithubOpts provides options for configuring a GitHub hook

type Payload

type Payload struct {
	Type         string      `json:"type"`
	Token        string      `json:"token"`
	TokenExpires time.Time   `json:"tokenExpires"`
	Body         interface{} `json:"body"`
	AppID        int         `json:"-"`
	InstID       int         `json:"-"`
	Commit       string      `json:"commit"`
	Branch       string      `json:"branch"`
}

Payload represents the data sent as the payload of an event.

Jump to

Keyboard shortcuts

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