Compare commits
No commits in common. "12869d1ec09bac971230128d4dc49a6ca1e9ee62" and "2113e8eade9320638cfdc00efd056de7afce90b8" have entirely different histories.
12869d1ec0
...
2113e8eade
@ -41,7 +41,6 @@ var (
|
|||||||
ErrInvalidHdrVal = errors.New("invalid header value type")
|
ErrInvalidHdrVal = errors.New("invalid header value type")
|
||||||
ErrInvalidType = errors.New("invalid type")
|
ErrInvalidType = errors.New("invalid type")
|
||||||
ErrInsecureWebhook = errors.New("secure webhook missing authorization")
|
ErrInsecureWebhook = errors.New("secure webhook missing authorization")
|
||||||
ErrIncorrectPassword = errors.New("incorrect password")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var httpModule = &starlarkstruct.Module{
|
var httpModule = &starlarkstruct.Module{
|
||||||
@ -356,7 +355,7 @@ func verifySecure(pwdHash, pluginName string, req *http.Request) error {
|
|||||||
fmt.Println(string(pwd))
|
fmt.Println(string(pwd))
|
||||||
|
|
||||||
if err := bcrypt.CompareHashAndPassword([]byte(pwdHash), pwd); err != nil {
|
if err := bcrypt.CompareHashAndPassword([]byte(pwdHash), pwd); err != nil {
|
||||||
return ErrIncorrectPassword
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
6
main.go
6
main.go
@ -41,6 +41,7 @@ import (
|
|||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
log.Logger = logger.NewPretty(os.Stderr)
|
log.Logger = logger.NewPretty(os.Stderr)
|
||||||
|
log.Logger.SetLevel(logger.LogLevelDebug)
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -50,13 +51,8 @@ func main() {
|
|||||||
serverAddr := pflag.StringP("address", "a", ":8080", "Webhook server address")
|
serverAddr := pflag.StringP("address", "a", ":8080", "Webhook server address")
|
||||||
genHash := pflag.BoolP("gen-hash", "g", false, "Generate a password hash for webhooks")
|
genHash := pflag.BoolP("gen-hash", "g", false, "Generate a password hash for webhooks")
|
||||||
useEnv := pflag.BoolP("use-env", "E", false, "Use environment variables for configuration")
|
useEnv := pflag.BoolP("use-env", "E", false, "Use environment variables for configuration")
|
||||||
debug := pflag.BoolP("debug", "d", false, "Enable debug logging")
|
|
||||||
pflag.Parse()
|
pflag.Parse()
|
||||||
|
|
||||||
if *debug {
|
|
||||||
log.Logger.SetLevel(logger.LogLevelDebug)
|
|
||||||
}
|
|
||||||
|
|
||||||
if *genHash {
|
if *genHash {
|
||||||
fmt.Print("Password: ")
|
fmt.Print("Password: ")
|
||||||
pwd, err := term.ReadPassword(int(os.Stdin.Fd()))
|
pwd, err := term.ReadPassword(int(os.Stdin.Fd()))
|
||||||
|
Loading…
Reference in New Issue
Block a user