Documentation ¶
Index ¶
- Variables
- func CreateSignature(d interface{}, secret []byte) (string, error)
- func JSONAddSpaces(src []byte) []byte
- func Marshal(d interface{}) ([]byte, error)
- func SignatureVerifierMiddleware(secret []byte) func(h http.Handler) http.Handler
- func VerifySignatureFromRequest(r *http.Request, secret []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoBody is returned when there's no body provided to the signature function ErrNoBody = errors.New("No body") // ErrInvalidSignature is returned when the signatures don't match ErrInvalidSignature = errors.New("Invalid signature") // ErrNoSecret is returned when there's no secret provided ErrNoSecret = errors.New("No secret provided") // ErrNoSignature is returned when there's no signature found in the request headers ErrNoSignature = errors.New("No signature provided") )
Functions ¶
func CreateSignature ¶
CreateSignature creates a pot signature with the given secret
func JSONAddSpaces ¶
JSONAddSpaces ands spaces after the value declarations in json
func SignatureVerifierMiddleware ¶ added in v2.1.0
SignatureVerifierMiddleware creates a middleware with the provided secret to verify the signatures in the incoming requests
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.