secrets

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultName = "tekton-ci-hook-secrets"

DefaultName is the name that is used for comparing GitHub hooks.

Variables

This section is empty.

Functions

This section is empty.

Types

type KubeSecretGetter

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

KubeSecretGetter is an implementation of SecretGetter.

func New

New creates and returns a KubeSecretGetter that looks up the hook secret as a key in a known v1.Secret.

func (KubeSecretGetter) Secret

func (k KubeSecretGetter) Secret(ctx context.Context, hook scm.Webhook) (string, error)

Secret finds the secret to use to match against for the repo associated with the provided hook, or returns an error.

type MockSecret

type MockSecret struct{}

MockSecret implements the SecretGetter but returns an empty string, which go-scm uses to indicate that it should not check the secret.

func NewMock

func NewMock() MockSecret

NewMock returns a simple secret getter that returns an empty secret token.

This causes the go-scm webhook parser to ignore the header.

func (MockSecret) Secret

func (k MockSecret) Secret(ctx context.Context, hook scm.Webhook) (string, error)

Secret implements the SecretGetter interface.

type SecretGetter

type SecretGetter interface {
	Secret(ctx context.Context, hook scm.Webhook) (string, error)
}

SecretGetter is provided by values that implement Secret, to look up the correct secret for a Webhook in order to validate the origin of the Webhook.

Jump to

Keyboard shortcuts

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