Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSignature = errors.New("invalid signature")
Functions ¶
This section is empty.
Types ¶
type AuthenticateFn ¶
type Event ¶
type Event interface {
Type() string
//
// The signature for the event payload.
// The value returned here is used by the HTTP server
// to verify the integrity of the event payload.
//
// Usually, this value is what is present in the
// X-*-Signature-256 HTTP header on the webhook request.
//
Signature() string
}
Used to represent events received from the integration. Returned by HandleWebhook().
type EventHandler ¶
type EventHandler interface {
//
// Convert the webhook data into a stateful resource.
// Used by the pending events worker to update execution resources.
// Used in conjunction with Status() to update the status of an execution resource.
//
Status(string, []byte) (StatefulResource, error)
//
// Convert the webhook data into an event.
// Used by the HTTP server when receiving events
// for a resource from the integration.
//
Handle(data []byte, header http.Header) (Event, error)
//
// List of event types supported by the integration.
//
EventTypes() []string
}
type OIDCVerifier ¶
type OIDCVerifier interface {
Verify(ctx context.Context, verifier *crypto.OIDCVerifier, token string, options VerifyTokenOptions) error
}
type ResourceManager ¶
type ResourceManager interface {
//
// Describe and list resources by their type and name.
// Used when creating event sources or stage executors,
// to validate that the resource reference in the event source
// or executor really exists.
//
Get(resourceType, id string) (Resource, error)
List(resourceType string) ([]Resource, error)
//
// Get the status of a resource created by the executor.
// Used by the execution resource poller. Ideally, not needed at all, since the status
// should be received in a webhook, through WebhookStatus().
//
Status(resourceType, id string, parentResource Resource) (StatefulResource, error)
//
// Cancel a resource.
// Used by the execution poller to cancel execution resources,
// when an execution is cancelled.
//
Cancel(resourceType, id string, parentResource Resource) error
//
// Set up webhooks in the integration.
// `any` type is used because the configuration and the metadata
// are integration-specific.
//
SetupWebhook(options WebhookOptions) (any, error)
//
// Clean up webhooks in the integration.
// `any` type is used because the configuration and the metadata
// are integration-specific.
//
CleanupWebhook(options WebhookOptions) error
}
type StatefulResource ¶
type StatefulResource interface {
Id() string
URL() string
Type() string
Finished() bool
Successful() bool
}
Similar to Resource, but with additional state information.
type VerifyTokenOptions ¶
Click to show internal directories.
Click to hide internal directories.