Skip to content

Commit

Permalink
feat(htpasswd): fix lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Ermakov <[email protected]>
  • Loading branch information
vooon committed Feb 8, 2025
1 parent 2f38114 commit dff945a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/htpasswd.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (s *HTPasswd) Authenticate(username, passphrase string) (ok, present bool)
err := bcrypt.CompareHashAndPassword([]byte(passphraseHash), []byte(passphrase))
ok = err == nil

if err != nil && err != bcrypt.ErrMismatchedHashAndPassword {
if err != nil && !errors.Is(err, bcrypt.ErrMismatchedHashAndPassword) {
// Log that user's hash has unsupported format. Better than silently return 401.
s.log.Warn().Err(err).Str("username", username).Msg("htpasswd bcrypt compare failed")
}

Check warning on line 96 in pkg/api/htpasswd.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/htpasswd.go#L94-L96

Added lines #L94 - L96 were not covered by tests
Expand All @@ -109,7 +109,7 @@ type HTPasswdWatcher struct {
log log.Logger
}

// NewHTPasswdWatcher create and start watcher
// NewHTPasswdWatcher create and start watcher.
func NewHTPasswdWatcher(htp *HTPasswd, filePath string) (*HTPasswdWatcher, error) {
watcher, err := fsnotify.NewWatcher()
if err != nil {
Expand Down

0 comments on commit dff945a

Please sign in to comment.