auth handler should not use populateKeyMap when auth disabled
@@ -45,10 +45,12 @@ func NewAuthHandler(cfg Config, log logrus.FieldLogger) *AuthHandler {
utils: NewAuthUtils(cfg.JwkCert, cfg.JwkCertURL),
log: log,
}
+ if a.EnableAuth {
err := a.populateKeyMap()
if err != nil {
log.Fatalln("Failed to init auth handler,", err)
}
+ }
return a
}
