signature

package
v0.0.0-...-7940cbf Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFailedToEncodePayload is the error we return when we cannot encode webhook payload
	ErrFailedToEncodePayload = errors.New("Failed to encode payload")

	// ErrInvalidEncoding is the error returned when an invalid encoding is provided.
	// TODO(subomi): Can I use this format where I'm using this error
	ErrInvalidEncoding = errors.New("Invalid encoding format - %s")

	// ErrInvalidHash is the error returned when a unsupported hash is supplied.
	ErrInvalidHash = errors.New("Hash not supported")
)

Functions

This section is empty.

Types

type Scheme

type Scheme struct {
	// Secret represents a list of active secrets used for
	// a scheme. It is used to implement rolled secrets.
	// Its order is irrelevant.
	Secret []string

	Hash     string
	Encoding string
}

type Signature

type Signature struct {
	Payload json.RawMessage

	// The order of these Schemes is a core part of this API.
	// We use the index as the version number. That is:
	// Index 0 = v0, Index 1 = v1
	Schemes []Scheme

	// This flag allows for backward-compatible implementation
	// of this type. You're either generating a simplistic header
	// or a complex header.
	Advanced bool
	// contains filtered or unexported fields
}

func (*Signature) ComputeHeaderValue

func (s *Signature) ComputeHeaderValue() (string, error)

Jump to

Keyboard shortcuts

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