webhooksecret

package
v0.0.74 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package webhooksecret provides a way to generate and verify secrets for GitLab webhooks.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrEmptyBaseOrUniq is returned when the base or uniq strings are empty.
	ErrEmptyBaseOrUniq = errors.New("base or uniq strings are empty")
)

Functions

func New

func New(base string, uniq string) (string, error)

New creates a new secret for usage in the gitlab webhook. The secret is generated by combining the base and uniq strings and then hashing the result.

func Verify

func Verify(base string, uniq string, secret string) bool

Verify checks if the given secret is valid for the given base and uniq strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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