Documentation ¶
Index ¶
- type Auth
- func (a *Auth) Authenticate(ctx context.Context, m models.AuthModel) (*models.User, error)
- func (a *Auth) OnBoardGroup(ctx context.Context, u *model.UserGroup, _ string) error
- func (a *Auth) OnBoardUser(ctx context.Context, u *models.User) error
- func (a *Auth) PostAuthenticate(ctx context.Context, u *models.User) error
- func (a *Auth) SearchGroup(ctx context.Context, groupKey string) (*model.UserGroup, error)
- func (a *Auth) SearchUser(ctx context.Context, username string) (*models.User, error)
- func (a *Auth) VerifyToken(ctx context.Context, token 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 sync.Mutex Endpoint string TokenReviewEndpoint string SkipSearch bool // contains filtered or unexported fields }
Auth implements HTTP authenticator the required attributes. The attribute Endpoint is the HTTP endpoint to which the POST request should be issued for authentication
func (*Auth) Authenticate ¶
Authenticate issues http POST request to Endpoint if it returns 200 the authentication is considered success.
func (*Auth) OnBoardGroup ¶
OnBoardGroup create user group entity in Harbor DB, altGroupName is not used.
func (*Auth) OnBoardUser ¶
OnBoardUser delegates to dao pkg to insert/update data in DB.
func (*Auth) PostAuthenticate ¶
PostAuthenticate generates the user model and on board the user.
func (*Auth) SearchGroup ¶
SearchGroup search group exist in the authentication provider, for HTTP auth, if SkipSearch is true, it assume this group exist in authentication provider.
func (*Auth) SearchUser ¶
SearchUser returns nil as authproxy does not have such capability. When SkipSearch is set it always return the default model, the username will be switch to lowercase if it's configured as case-insensitive