verifier

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 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")
View Source
var ErrAuthHeader = errors.New("Invalid Authorization header")
View Source
var ErrAuthHeaderCannotBeEmpty = errors.New("Auth header cannot be empty")
View Source
var ErrCannotDecodeBase64EncodedMACHeader = errors.New("Cannot decode base64 encoded MAC header")
View Source
var ErrCannotDecodeHexEncodedMACHeader = errors.New("Cannot decode hex encoded MAC header")
View Source
var ErrCannotReadRequestBody = errors.New("Failed to read request body")
View Source
var ErrHashDoesNotMatch = errors.New("Invalid Signature - Hash does not match")
View Source
var ErrInvalidAuthLength = errors.New("Invalid Basic Auth Length")
View Source
var ErrInvalidEncoding = errors.New("Invalid header encoding")
View Source
var ErrInvalidHeaderStructure = errors.New("Invalid header structure")
View Source
var ErrInvalidIP = errors.New("Source IP not supported")
View Source
var ErrSignatureCannotBeEmpty = errors.New("Signature cannot be empty")

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