webhook

package
v0.13.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// A unique ID that identifies the delivered webhook.
	WebhookIDHeader = "X-SHELLHUB-WEBHOOK-ID"
	// Name of the event that has been triggered.
	WebhookEventHeader = "X-SHELLHUB-WEBHOOK-EVENT"
	// A signature created using the webhook secret key.
	WebhookSignatureHeader = "X-SHELLHUB-WEBHOOK-SIGNATURE"
)

Webhook request headers.

View Source
const (
	// A new connection was made to the SSH Server.
	WebhookIncomingConnectionEvent = "incoming_connection"
)

Webhook event types.

Variables

View Source
var (
	ErrConnectionFailed = errors.New("connection failed")
	ErrForbidden        = errors.New("not allowed")
	ErrUnknown          = errors.New("unknown error")
)

Functions

This section is empty.

Types

type IncomingConnectionWebhookRequest

type IncomingConnectionWebhookRequest struct {
	Username  string `json:"username"`
	Hostname  string `json:"hostname"`
	Namespace string `json:"namespace"`
	SourceIP  string `json:"source_ip"`
}

IncomingConnectionWebhookRequest is the body payload.

type IncomingConnectionWebhookResponse

type IncomingConnectionWebhookResponse struct {
	// Timeout to wait for connection to be established
	Timeout int `json:"timeout"`
}

IncommingConnectionWebhookResponse is the expected response body.

type Options added in v0.7.2

type Options struct {
	WebhookURL    string `envconfig:"webhook_url"`
	WebhookPort   int    `envconfig:"webhook_port"`
	WebhookScheme string `envconfig:"webhook_scheme"`
}

type Webhook

type Webhook interface {
	Connect(m map[string]string) (*IncomingConnectionWebhookResponse, error)
}

func NewClient

func NewClient() Webhook

Jump to

Keyboard shortcuts

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