ldap

package
v1.6.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	auth.DefaultAuthenticateHelper
}

Auth implements AuthenticateHelper interface to authenticate against LDAP

func (*Auth) Authenticate

func (l *Auth) Authenticate(m models.AuthModel) (*models.User, error)

Authenticate checks user's credential against LDAP based on basedn template and LDAP URL, if the check is successful a dummy record will be inserted into DB, such that this user can be associated to other entities in the system.

func (*Auth) OnBoardGroup added in v1.5.0

func (l *Auth) OnBoardGroup(u *models.UserGroup, altGroupName string) error

OnBoardGroup -- Create Group in harbor DB, if altGroupName is not empty, take the altGroupName as groupName in harbor DB.

func (*Auth) OnBoardUser

func (l *Auth) OnBoardUser(u *models.User) error

OnBoardUser will check if a user exists in user table, if not insert the user and put the id in the pointer of user model, if it does exist, return the user's profile.

func (*Auth) PostAuthenticate

func (l *Auth) PostAuthenticate(u *models.User) error

PostAuthenticate -- If user exist in harbor DB, sync email address, if not exist, call OnBoardUser

func (*Auth) SearchGroup added in v1.5.0

func (l *Auth) SearchGroup(groupKey string) (*models.UserGroup, error)

SearchGroup -- Search group in ldap authenticator, groupKey is LDAP group DN.

func (*Auth) SearchUser

func (l *Auth) SearchUser(username string) (*models.User, error)

SearchUser -- Search user in ldap

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL