webhook

package
v0.7.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: Apache-2.0 Imports: 16 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 (
	ConnectionFailedErr = "Connection failed"
	ForbiddenErr        = "Not allowed"
	UnknownErr          = "Unknown error"
)
View Source
const (
	// A new connection was made to the SSH Server
	WebhookIncomingConnectionEvent = "incoming_connection"
)

Webhook event types

Variables

This section is empty.

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 Webhook

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

func NewClient

func NewClient() Webhook

type WebhookOptions

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

Jump to

Keyboard shortcuts

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