Help us shape the future of Go! Take the 2026 Go Developer Survey

gitWebhook

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: Apache-2.0 Imports: 14 Imported by: 4

Documentation

Index

Constants

View Source
const (
	SECRET_VALIDATOR_SHA1       string = "SHA-1"
	SECRET_VALIDATOR_URL_APPEND string = "URL_APPEND"
	SECRET_VALIDATOR_PLAIN_TEXT string = "PLAIN_TEXT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GitWebhookService

type GitWebhookService interface {
	HandleGitWebhook(gitWebhookRequest gitSensor.CiPipelineMaterial) (int, error)
}

type GitWebhookServiceImpl

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

func NewGitWebhookServiceImpl

func NewGitWebhookServiceImpl(Logger *zap.SugaredLogger, gitWebhookRepository repository.GitWebhookRepository,
	ciHandlerService trigger.HandlerService) *GitWebhookServiceImpl

func (*GitWebhookServiceImpl) HandleGitWebhook

func (impl *GitWebhookServiceImpl) HandleGitWebhook(gitWebhookRequest gitSensor.CiPipelineMaterial) (int, error)

type WebhookSecretValidator

type WebhookSecretValidator interface {
	ValidateSecret(r *http.Request, secretInUrl string, requestBodyBytes []byte, gitHost *bean2.GitHostRequest) bool
}

type WebhookSecretValidatorImpl

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

func NewWebhookSecretValidatorImpl

func NewWebhookSecretValidatorImpl(Logger *zap.SugaredLogger) *WebhookSecretValidatorImpl

func (*WebhookSecretValidatorImpl) ValidateSecret

func (impl *WebhookSecretValidatorImpl) ValidateSecret(r *http.Request, secretInUrl string, requestBodyBytes []byte, gitHost *bean2.GitHostRequest) bool

Validate secret for some predefined algorithms : SHA1, URL_APPEND, PLAIN_TEXT URL_APPEND : Secret will come in URL (last path param of URL) PLAIN_TEXT : Plain text value in request header SHA1 : SHA1 encrypted text in request header

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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