Skip to content

Commit

Permalink
Lint: Fix some minor linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Knut Ahlers <knut@ahlers.me>
  • Loading branch information
Luzifer committed Apr 7, 2020
1 parent f9d9c02 commit 4a72836
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion plugins/auth/google/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion plugins/mfa/totp/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4a72836

Please sign in to comment.