mirror of
https://github.com/ncarlier/webhookd.git
synced 2025-04-07 18:47:08 +00:00
fix(security): fix http basic auth debug warning; cleanup
This commit is contained in:
parent
77a8946115
commit
94414d5f59
15
config.go
15
config.go
|
@ -2,9 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
|
@ -22,19 +20,6 @@ type Config struct {
|
|||
AuthenticationParam *string
|
||||
}
|
||||
|
||||
type authFlag struct {
|
||||
selectedMethod auth.Method
|
||||
}
|
||||
|
||||
func (c authFlag) Set(arg string) error {
|
||||
fmt.Println(arg)
|
||||
return errors.New("fall")
|
||||
}
|
||||
|
||||
func (c authFlag) String() string {
|
||||
return "test"
|
||||
}
|
||||
|
||||
var config = &Config{
|
||||
ListenAddr: flag.String("listen", getEnv("LISTEN_ADDR", ":8080"), "HTTP service address (e.g.address, ':8080')"),
|
||||
NbWorkers: flag.Int("nb-workers", getIntEnv("NB_WORKERS", 2), "The number of workers to start"),
|
||||
|
|
|
@ -18,7 +18,9 @@ type basicAuth struct {
|
|||
|
||||
func (c *basicAuth) Init(debug bool) {
|
||||
c.debug = debug
|
||||
logger.Warning.Println("\u001B[33mBasic Auth: Debug mode enabled. Might Leak sentitive information in log output.\u001B[0m")
|
||||
if debug {
|
||||
logger.Warning.Println("\u001B[33mBasic Auth: Debug mode enabled. Might Leak sentitive information in log output.\u001B[0m")
|
||||
}
|
||||
}
|
||||
|
||||
func (c *basicAuth) Usage() string {
|
||||
|
|
|
@ -8,7 +8,7 @@ type noAuth struct {
|
|||
}
|
||||
|
||||
func (c *noAuth) Usage() string {
|
||||
return "No Auth. Usage: --auth none"
|
||||
return "No Auth. Usage: -auth none"
|
||||
}
|
||||
|
||||
func (c *noAuth) Init(_ bool) {}
|
||||
|
|
Loading…
Reference in New Issue
Block a user