Documentation ¶
Index ¶
- type Auth
- func (l *Auth) Authenticate(ctx context.Context, m models.AuthModel) (*models.User, error)
- func (l *Auth) OnBoardGroup(ctx context.Context, u *ugModel.UserGroup, altGroupName string) error
- func (l *Auth) OnBoardUser(ctx context.Context, u *models.User) error
- func (l *Auth) PostAuthenticate(ctx context.Context, u *models.User) error
- func (l *Auth) SearchGroup(ctx context.Context, groupKey string) (*ugModel.UserGroup, error)
- func (l *Auth) SearchUser(ctx context.Context, username string) (*models.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { auth.DefaultAuthenticateHelper // contains filtered or unexported fields }
Auth implements AuthenticateHelper interface to authenticate against LDAP
func (*Auth) Authenticate ¶
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 ¶
OnBoardGroup -- Create Group in harbor DB, if altGroupName is not empty, take the altGroupName as groupName in harbor DB.
func (*Auth) OnBoardUser ¶
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 ¶
PostAuthenticate -- If user exist in harbor DB, sync email address, if not exist, call OnBoardUser
func (*Auth) SearchGroup ¶
SearchGroup -- Search group in ldap authenticator, groupKey is LDAP group DN.