Actually check authentication
This commit is contained in:
15
main.go
15
main.go
@@ -21,16 +21,13 @@ func (t *LoggingHook) Run(e *zerolog.Event, level zerolog.Level, message string)
|
||||
t.prompt.CleanAndRefreshForLogging()
|
||||
}
|
||||
|
||||
func setupLogging() {
|
||||
debug := flag.Bool("debug", false, "enable debug logging")
|
||||
flag.Parse()
|
||||
|
||||
func setupLogging(debug bool) {
|
||||
// Pretty logging
|
||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||
|
||||
// Default level for this example is info, unless debug flag is present
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
if *debug {
|
||||
if debug {
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
}
|
||||
}
|
||||
@@ -47,12 +44,16 @@ func printWelcomeMessage() {
|
||||
}
|
||||
|
||||
func main() {
|
||||
setupLogging()
|
||||
debugLogging := flag.Bool("debug", false, "enable debug logging")
|
||||
authEnabled := flag.Bool("auth", false, "enable authentication")
|
||||
flag.Parse()
|
||||
|
||||
setupLogging(*debugLogging)
|
||||
|
||||
printWelcomeMessage()
|
||||
|
||||
c := web.MockHTTPServerConfiguration{
|
||||
AuthEnabled: false,
|
||||
AuthEnabled: *authEnabled,
|
||||
}
|
||||
|
||||
addr := ":5738"
|
||||
|
||||
Reference in New Issue
Block a user