fix: wonky merge conflict, and missing body parameter from matcher
This commit is contained in:
parent
5e9c5d2c17
commit
0368fb10db
|
|
@ -2,9 +2,9 @@ package webhooks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/hmac"
|
"crypto/hmac"
|
||||||
"crypto/subtle"
|
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"crypto/subtle"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -123,14 +123,6 @@ func (v *AuthVerifier) verifyBasic(r *http.Request) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
import (
|
|
||||||
"crypto/subtle"
|
|
||||||
// ... existing imports
|
|
||||||
)
|
|
||||||
|
|
||||||
func (v *AuthVerifier) verifyBasic(r *http.Request) bool {
|
|
||||||
// ... existing checks ...
|
|
||||||
|
|
||||||
parts := strings.SplitN(v.config.Secret, ":", 2)
|
parts := strings.SplitN(v.config.Secret, ":", 2)
|
||||||
if len(parts) == 2 {
|
if len(parts) == 2 {
|
||||||
usernameMatch := subtle.ConstantTimeCompare([]byte(username), []byte(parts[0]))
|
usernameMatch := subtle.ConstantTimeCompare([]byte(username), []byte(parts[0]))
|
||||||
|
|
@ -140,4 +132,3 @@ func (v *AuthVerifier) verifyBasic(r *http.Request) bool {
|
||||||
|
|
||||||
return subtle.ConstantTimeCompare([]byte(password), []byte(v.config.Secret)) == 1
|
return subtle.ConstantTimeCompare([]byte(password), []byte(v.config.Secret)) == 1
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ func NewWebhookMatcher(cfg config.WebhookConfig, r *http.Request, bodyBytes []by
|
||||||
return &WebhookMatcher{
|
return &WebhookMatcher{
|
||||||
config: cfg,
|
config: cfg,
|
||||||
req: r,
|
req: r,
|
||||||
body: body,
|
|
||||||
bodyBytes: bodyBytes,
|
bodyBytes: bodyBytes,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue