webhook

package
v0.17.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWebhookClient

func NewWebhookClient(url string, secret *string) *webhookClient

Types

type TestPayloadType

type TestPayloadType string
const (
	TestPayloadTypeEmpty                 TestPayloadType = "empty"
	TestPayloadTypeSampleSBOM            TestPayloadType = "sampleSbom"
	TestPayloadTypeSampleDependencyVulns TestPayloadType = "sampleDependencyVulns"
	TestPayloadTypeSampleFirstPartyVulns TestPayloadType = "sampleFirstPartyVulns"
)

type WebhookIntegration

type WebhookIntegration struct {
	// contains filtered or unexported fields
}

func NewWebhookIntegration

func NewWebhookIntegration(db core.DB) *WebhookIntegration

func (*WebhookIntegration) CreateIssue

func (w *WebhookIntegration) CreateIssue(ctx context.Context, asset models.Asset, assetVersionName string, vuln models.Vuln, projectSlug string, orgSlug string, justification string, userID string) error

func (*WebhookIntegration) CreateLabels added in v0.17.3

func (w *WebhookIntegration) CreateLabels(ctx context.Context, asset models.Asset) error

func (*WebhookIntegration) Delete

func (w *WebhookIntegration) Delete(ctx core.Context) error

func (*WebhookIntegration) GetID

func (*WebhookIntegration) GetRoleInGroup

func (w *WebhookIntegration) GetRoleInGroup(ctx context.Context, userID string, providerID string, groupID string) (string, error)

func (*WebhookIntegration) GetRoleInProject

func (w *WebhookIntegration) GetRoleInProject(ctx context.Context, userID string, providerID string, projectID string) (string, error)

func (*WebhookIntegration) GetUsers

func (w *WebhookIntegration) GetUsers(org models.Org) []core.User

func (*WebhookIntegration) HandleEvent

func (w *WebhookIntegration) HandleEvent(event any) error

func (*WebhookIntegration) HandleWebhook

func (w *WebhookIntegration) HandleWebhook(ctx core.Context) error

func (*WebhookIntegration) HasAccessToExternalEntityProvider

func (w *WebhookIntegration) HasAccessToExternalEntityProvider(ctx core.Context, externalEntityProviderID string) (bool, error)

func (*WebhookIntegration) ListGroups

func (w *WebhookIntegration) ListGroups(ctx context.Context, userID string, providerID string) ([]models.Project, []core.Role, error)

func (*WebhookIntegration) ListOrgs

func (w *WebhookIntegration) ListOrgs(ctx core.Context) ([]models.Org, error)

func (*WebhookIntegration) ListProjects

func (w *WebhookIntegration) ListProjects(ctx context.Context, userID string, providerID string, groupID string) ([]models.Asset, []core.Role, error)

func (*WebhookIntegration) ListRepositories

func (w *WebhookIntegration) ListRepositories(ctx core.Context) ([]core.Repository, error)

func (*WebhookIntegration) Save

func (w *WebhookIntegration) Save(ctx core.Context) error

func (*WebhookIntegration) Test

func (w *WebhookIntegration) Test(ctx core.Context) error

func (*WebhookIntegration) Update

func (w *WebhookIntegration) Update(ctx core.Context) error

func (*WebhookIntegration) UpdateIssue

func (w *WebhookIntegration) UpdateIssue(ctx context.Context, asset models.Asset, assetVersionSlug string, vuln models.Vuln) error

func (*WebhookIntegration) WantsToHandleWebhook

func (w *WebhookIntegration) WantsToHandleWebhook(ctx core.Context) bool

type WebhookStruct

type WebhookStruct struct {
	Organization core.OrgObject          `json:"organization"`
	Project      core.ProjectObject      `json:"project"`
	Asset        core.AssetObject        `json:"asset"`
	AssetVersion core.AssetVersionObject `json:"assetVersion"`
	Payload      any                     `json:"payload"`
	Type         WebhookType             `json:"type"`
	Artifact     core.ArtifactObject     `json:"artifact,omitempty"`
}

type WebhookType

type WebhookType string
const (
	WebhookTypeSBOM                      WebhookType = "sbom"
	WebhookTypeFirstPartyVulnerabilities WebhookType = "firstPartyVulnerabilities"
	WebhookTypeDependencyVulnerabilities WebhookType = "dependencyVulnerabilities"
	WebhookTypeTest                      WebhookType = "test"
)

Jump to

Keyboard shortcuts

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