From a3092dc57b7a91d9d38ece34c142a51912e33a65 Mon Sep 17 00:00:00 2001 From: Oleg Gaidarenko Date: Wed, 29 May 2019 16:12:42 +0300 Subject: [PATCH] LDAP: remove unused function (#17351) --- pkg/services/ldap/ldap.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pkg/services/ldap/ldap.go b/pkg/services/ldap/ldap.go index c64533d34922d..418673be44637 100644 --- a/pkg/services/ldap/ldap.go +++ b/pkg/services/ldap/ldap.go @@ -30,7 +30,6 @@ type IConnection interface { type IServer interface { Login(*models.LoginUserQuery) (*models.ExternalUserInfo, error) Users([]string) ([]*models.ExternalUserInfo, error) - ExtractGrafanaUser(*UserInfo) (*models.ExternalUserInfo, error) InitialBind(string, string) error Dial() error Close() @@ -148,6 +147,11 @@ func (server *Server) Login(query *models.LoginUserQuery) ( // Check if a second user bind is needed user := users[0] + + if err := server.validateGrafanaUser(user); err != nil { + return nil, err + } + if server.requireSecondBind { err = server.secondBind(user, query.Password) if err != nil { @@ -188,16 +192,6 @@ func (server *Server) Users(logins []string) ( return serializedUsers, nil } -// ExtractGrafanaUser extracts external user info from LDAP user -func (server *Server) ExtractGrafanaUser(user *UserInfo) (*models.ExternalUserInfo, error) { - result := server.buildGrafanaUser(user) - if err := server.validateGrafanaUser(result); err != nil { - return nil, err - } - - return result, nil -} - // validateGrafanaUser validates user access. // If there are no ldap group mappings access is true // otherwise a single group must match