webhook

package
v0.0.0-...-6b6273f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGitHubURL     = "https://github.com"
	SSHAppSigningKeyPath = "/root/.ssh/key"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvConfig

type EnvConfig struct {
	// Port indicates what port the app is served on.
	Port int `envconfig:"PORT" required:"true" default:"8080"`

	// DevMode is enabled only for initial PoC/testing of the app.  This flow
	// will be removed and must not be used for production deployments.
	DevMode bool `envconfig:"DEV_MODE" default:"false"`

	// KMSKey records the KMS identifier for the signing key to use for
	// interactions with the GitHub instance. When DevMode is true, this is
	// parsed as a path to a private key file on disk.
	KMSKey string `envconfig:"KMS_KEY" required:"true"`

	// GitHubURL indicates the URL of the GitHub instance the app is deployed
	// for.
	GitHubURL string `envconfig:"GITHUB_URL" default:"https://github.com"`

	// AppID indicates the app's ID provided by the GitHub instance the app is
	// deployed on.
	AppID int64 `envconfig:"GITHUB_APP_ID" required:"true"`

	// WebhookSecret contains the secret configured with the GitHub instance for
	// communications from the server.
	WebhookSecret string `envconfig:"GITHUB_WEBHOOK_SECRET" required:"true"`

	// AppEmailID is the email ID used for commits created by the app.
	AppEmailID string `envconfig:"APP_EMAIL_ID" required:"true"`

	// CloudProvider identifies the cloud provider used for the KMS and secrets
	// manager.
	CloudProvider string `envconfig:"CLOUD_PROVIDER" default:"gcp"`

	// AppSigningKey indicates the secret used as the signing private key for
	// the app's signatures.
	AppSigningKey string `envconfig:"APP_SIGNING_KEY" required:"true"`

	// AppSigningPubKey indicates the secret used as the public key for the
	// app's signatures.
	AppSigningPubKey string `envconfig:"APP_SIGNING_PUBKEY" required:"true"`
}

type GittufApp

type GittufApp struct {
	Transport     *ghinstallation.AppsTransport
	WebhookSecret [][]byte
	Params        *EnvConfig
	// contains filtered or unexported fields
}

func (*GittufApp) ServeHTTP

func (g *GittufApp) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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