Documentation ¶
Index ¶
Constants ¶
View Source
const (
KeySignatureOK = "hmac-signature-ok"
)
Variables ¶
This section is empty.
Functions ¶
func SignatureChecker ¶
func SignatureChecker(signer hmac.Signer, ksg KeySignatureGetter, signatureRequired bool) echo.MiddlewareFunc
SignatureChecker read the signature from a request and ensure it is legit This should be the first step on an authentication root If no error is returned by the KeySignatureGetter and key/signature are nil, the middleware will let the request in unless signatureRequired is true in the
func SignatureEnforce ¶
func SignatureEnforce() echo.MiddlewareFunc
SignatureEnforce is to be used after SignatureChecker to enforce a signature on a route, even though SignatureChecker signatureRequired params was false
func SignatureOK ¶
func SignatureOK(c echo.Context) bool
Types ¶
type KeySignatureGetter ¶
KeySignatureGetter return the key and signature associated to a given request
Click to show internal directories.
Click to hide internal directories.