diff --git a/main.go b/main.go index 39bd1b5..6c19901 100644 --- a/main.go +++ b/main.go @@ -144,10 +144,11 @@ func main() { case syscall.SIGHUP: if yamlSource, err = loadConfiguration(); err != nil { log.WithError(err).Error("Unable to reload configuration") - } else { - if err = initializeModules(yamlSource); err != nil { - log.WithError(err).Error("Unable to initialize modules") - } + continue + } + + if err = initializeModules(yamlSource); err != nil { + log.WithError(err).Error("Unable to initialize modules") } default: @@ -167,7 +168,7 @@ func handleAuthRequest(res http.ResponseWriter, r *http.Request) { switch err { case plugins.ErrNoValidUserFound: // No valid user found, check whether special anonymous "user" has access - // Username is set to 0x0 character to prevent accidential whitelist-match + // Username is set to 0x0 character to prevent accidental whitelist-match if mainCfg.ACL.HasAccess(string(0x0), nil, r) { mainCfg.AuditLog.Log(auditEventValidate, r, map[string]string{"result": "anonymous access granted"}) // #nosec G104 - This is only logging res.WriteHeader(http.StatusOK) diff --git a/plugins/auth/google/auth.go b/plugins/auth/google/auth.go index 5eb3e92..6639c34 100644 --- a/plugins/auth/google/auth.go +++ b/plugins/auth/google/auth.go @@ -216,7 +216,7 @@ func (a *AuthGoogleOAuth) getUserFromToken(ctx context.Context, token *oauth2.To httpClient := conf.Client(ctx, token) client, err := v2.NewService(ctx, option.WithHTTPClient(httpClient)) if err != nil { - return "", errors.Wrap(err, "Unable to instanciate OAuth2 API service") + return "", errors.Wrap(err, "Unable to instantiate OAuth2 API service") } tok, err := client.Tokeninfo().Context(ctx).Do() diff --git a/plugins/mfa/totp/mfa.go b/plugins/mfa/totp/mfa.go index b572160..51b345e 100644 --- a/plugins/mfa/totp/mfa.go +++ b/plugins/mfa/totp/mfa.go @@ -93,7 +93,7 @@ func (m MFATOTP) exec(c plugins.MFAConfig) (string, error) { } if n := len(secret) % 8; n != 0 { - secret = secret + strings.Repeat("=", 8-n) + secret += strings.Repeat("=", 8-n) } return totp.GenerateCodeCustom(strings.ToUpper(secret), time.Now(), generatorOpts)