mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-22 21:47:16 +02:00
cryptutil: use bytes for hmac (#2067)
This commit is contained in:
parent
a935c1ba30
commit
a51c7140ea
12 changed files with 28 additions and 28 deletions
|
@ -28,7 +28,7 @@ func SetHeaders(headers map[string]string) func(next http.Handler) http.Handler
|
|||
|
||||
// ValidateSignature ensures the request is valid and has been signed with
|
||||
// the correspdoning client secret key
|
||||
func ValidateSignature(sharedSecret string) func(next http.Handler) http.Handler {
|
||||
func ValidateSignature(sharedSecret []byte) func(next http.Handler) http.Handler {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return httputil.HandlerFunc(func(w http.ResponseWriter, r *http.Request) error {
|
||||
ctx, span := trace.StartSpan(r.Context(), "middleware.ValidateSignature")
|
||||
|
@ -44,7 +44,7 @@ func ValidateSignature(sharedSecret string) func(next http.Handler) http.Handler
|
|||
|
||||
// ValidateRequestURL validates the current absolute request URL was signed
|
||||
// by a given shared key.
|
||||
func ValidateRequestURL(r *http.Request, key string) error {
|
||||
func ValidateRequestURL(r *http.Request, key []byte) error {
|
||||
return urlutil.NewSignedURL(key, urlutil.GetAbsoluteURL(r)).Validate()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue