verifier

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MPL-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlgoNotFound                       = errors.New("Algorithm not found")
	ErrInvalidIP                          = errors.New("Source IP not supported")
	ErrCannotReadRequestBody              = errors.New("Failed to read request body")
	ErrHashDoesNotMatch                   = errors.New("Invalid Signature - Hash does not match")
	ErrCannotDecodeHexEncodedMACHeader    = errors.New("Cannot decode hex encoded MAC header")
	ErrCannotDecodeBase64EncodedMACHeader = errors.New("Cannot decode base64 encoded MAC header")
	ErrSignatureCannotBeEmpty             = errors.New("Signature cannot be empty")
	ErrAuthHeader                         = errors.New("Invalid Authorization header")
	ErrAuthHeaderCannotBeEmpty            = errors.New("Auth header cannot be empty")
	ErrInvalidHeaderStructure             = errors.New("Invalid header structure")
	ErrInvalidAuthLength                  = errors.New("Invalid Basic Auth Length")
	ErrInvalidEncoding                    = errors.New("Invalid header encoding")
)

Functions

This section is empty.

Types

type APIKeyVerifier

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

func NewAPIKeyVerifier

func NewAPIKeyVerifier(key, header string) *APIKeyVerifier

func (*APIKeyVerifier) VerifyRequest

func (aV *APIKeyVerifier) VerifyRequest(r *http.Request, payload []byte) error

type BasicAuthVerifier

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

func NewBasicAuthVerifier

func NewBasicAuthVerifier(username, password string) *BasicAuthVerifier

func (*BasicAuthVerifier) VerifyRequest

func (baV *BasicAuthVerifier) VerifyRequest(r *http.Request, payload []byte) error

type GithubVerifier

type GithubVerifier struct {
	HmacOpts *HmacOptions
}

func NewGithubVerifier

func NewGithubVerifier(secret string) *GithubVerifier

func (*GithubVerifier) VerifyRequest

func (gV *GithubVerifier) VerifyRequest(r *http.Request, payload []byte) error

type HmacOptions

type HmacOptions struct {
	Header       string
	GetSignature func(string) string
	Hash         string
	Secret       string
	Encoding     string
}

type HmacVerifier

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

func NewHmacVerifier

func NewHmacVerifier(opts *HmacOptions) *HmacVerifier

func (*HmacVerifier) VerifyRequest

func (hV *HmacVerifier) VerifyRequest(r *http.Request, payload []byte) error

type NoopVerifier added in v0.6.2

type NoopVerifier struct{}

func (*NoopVerifier) VerifyRequest added in v0.6.2

func (nV *NoopVerifier) VerifyRequest(r *http.Request, payload []byte) error

type ShopifyVerifier

type ShopifyVerifier struct {
	HmacOpts *HmacOptions
}

func NewShopifyVerifier

func NewShopifyVerifier(secret string) *ShopifyVerifier

func (*ShopifyVerifier) VerifyRequest

func (sv *ShopifyVerifier) VerifyRequest(r *http.Request, payload []byte) error

type TwitterVerifier

type TwitterVerifier struct {
	HmacOpts *HmacOptions
}

func NewTwitterVerifier

func NewTwitterVerifier(secret string) *TwitterVerifier

func (*TwitterVerifier) VerifyRequest

func (tv *TwitterVerifier) VerifyRequest(r *http.Request, payload []byte) error

type Verifier

type Verifier interface {
	VerifyRequest(r *http.Request, payload []byte) error
}

Jump to

Keyboard shortcuts

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