Merge pull request #1465 from dmcgowan/token-server-oauth

Integration token server supporting oauth
This commit is contained in:
Richard Scothern 2016-06-13 15:01:06 -07:00 committed by GitHub
commit 70928bcf90
3 changed files with 25 additions and 14 deletions

View file

@ -6,6 +6,8 @@ import (
"io"
"strings"
"github.com/docker/distribution/registry/auth"
"golang.org/x/crypto/bcrypt"
)
@ -33,12 +35,12 @@ func (htpasswd *htpasswd) authenticateUser(username string, password string) err
// timing attack paranoia
bcrypt.CompareHashAndPassword([]byte{}, []byte(password))
return ErrAuthenticationFailure
return auth.ErrAuthenticationFailure
}
err := bcrypt.CompareHashAndPassword([]byte(credentials), []byte(password))
if err != nil {
return ErrAuthenticationFailure
return auth.ErrAuthenticationFailure
}
return nil