2017-08-16 23:37:37 +02:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
2016-04-16 20:39:43 +02:00
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
package einterfaces
|
|
|
|
|
|
|
|
import (
|
2018-02-09 00:11:04 +01:00
|
|
|
"github.com/go-ldap/ldap"
|
|
|
|
|
|
|
|
"github.com/mattermost/mattermost-server/model"
|
2016-04-16 20:39:43 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type LdapInterface interface {
|
2016-05-15 23:02:30 +02:00
|
|
|
DoLogin(id string, password string) (*model.User, *model.AppError)
|
2016-04-16 20:39:43 +02:00
|
|
|
GetUser(id string) (*model.User, *model.AppError)
|
2018-02-09 00:11:04 +01:00
|
|
|
GetUserAttributes(id string, attributes []string) (map[string]string, *model.AppError)
|
2016-04-16 20:39:43 +02:00
|
|
|
CheckPassword(id string, password string) *model.AppError
|
2016-05-15 23:02:30 +02:00
|
|
|
SwitchToLdap(userId, ldapId, ldapPassword string) *model.AppError
|
|
|
|
ValidateFilter(filter string) *model.AppError
|
2018-02-09 00:11:04 +01:00
|
|
|
StartSynchronizeJob(waitForJobToFinish bool) (*model.Job, *model.AppError)
|
2016-09-17 15:19:18 +02:00
|
|
|
RunTest() *model.AppError
|
2016-08-15 18:47:31 +02:00
|
|
|
GetAllLdapUsers() ([]*model.User, *model.AppError)
|
2018-02-09 00:11:04 +01:00
|
|
|
UserFromLdapUser(ldapUser *ldap.Entry) *model.User
|
|
|
|
UserHasUpdateFromLdap(existingUser *model.User, currentLdapUser *model.User) bool
|
|
|
|
UpdateLocalLdapUser(existingUser *model.User, currentLdapUser *model.User) *model.User
|
2016-04-16 20:39:43 +02:00
|
|
|
}
|