git

package
v0.0.0-...-19fb9ea Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

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, ciHandler pipeline.CiHandler, gitWebhookRepository repository.GitWebhookRepository) *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 *pipeline.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 *pipeline.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

Jump to

Keyboard shortcuts

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