Private
Public Access
1
0

Actually check authentication

This commit is contained in:
2023-12-10 19:51:18 -08:00
parent 416949095c
commit d8ca07f92a
2 changed files with 43 additions and 10 deletions

15
main.go
View File

@@ -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"