Add ensure settings when to search user in auth proxy

This issue is regresssion that introduced by f92bc8076d (diff-42381e6df5f17ebd3d9165a325d5d8f4), the a.ensure() was removed from SearchUser(), which leads to the alwaysonboard cannot be updated.

Signed-off-by: wang yan <wangyan@vmware.com>
This commit is contained in:
wang yan 2019-05-22 17:11:11 +08:00
parent 7b7f7a920a
commit 15ca9bfb81

View File

@ -104,6 +104,10 @@ func (a *Auth) PostAuthenticate(u *models.User) error {
// SearchUser returns nil as authproxy does not have such capability.
// When AlwaysOnboard is set it always return the default model.
func (a *Auth) SearchUser(username string) (*models.User, error) {
err := a.ensure()
if err != nil {
log.Warningf("Failed to refresh configuration for HTTP Auth Proxy Authenticator, error: %v, the default settings will be used", err)
}
var u *models.User
if a.AlwaysOnboard {
u = &models.User{Username: username}