verifier

package
v0.6.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 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 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