diff --git a/config.go b/config.go index da7b1cd..0251763 100644 --- a/config.go +++ b/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"), diff --git a/pkg/auth/basic.go b/pkg/auth/basic.go index 9adc2ba..d57be0b 100644 --- a/pkg/auth/basic.go +++ b/pkg/auth/basic.go @@ -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 { diff --git a/pkg/auth/none.go b/pkg/auth/none.go index 257af25..6e8905a 100644 --- a/pkg/auth/none.go +++ b/pkg/auth/none.go @@ -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) {}