Documentation ¶
Index ¶
- func AddAccountReference(user *jenkinsv1.User, gitProviderKey string, id string) *jenkinsv1.User
- func CreateUser(ns string, login string, name string, email string) *jenkinsv1.User
- func DeleteUser(jxClient versioned.Interface, ns string, userName string) error
- func GetUsers(jxClient versioned.Interface, ns string) (map[string]*jenkinsv1.User, []string, error)
- func Resolve(id string, providerKey string, jxClient versioned.Interface, namespace string, ...) (*jenkinsv1.User, error)
- type GitUserResolver
- func (r *GitUserResolver) GitProviderKey() string
- func (r *GitUserResolver) GitSignatureAsUser(signature *object.Signature) (*jenkinsv1.User, error)
- func (r *GitUserResolver) GitUserLogin(user *jenkinsv1.User) string
- func (r *GitUserResolver) GitUserSliceAsUserDetailsSlice(users []gits.GitUser) ([]jenkinsv1.UserDetails, error)
- func (r *GitUserResolver) GitUserToUser(gitUser *gits.GitUser) *jenkinsv1.User
- func (r *GitUserResolver) Resolve(user *gits.GitUser) (*jenkinsv1.User, error)
- func (r *GitUserResolver) UpdateUserFromPRAuthor(author *jenkinsv1.User, pullRequest *gits.GitPullRequest, ...) (*jenkinsv1.User, error)
- func (r *GitUserResolver) UserToGitUser(id string, user *jenkinsv1.User) *gits.GitUser
- type UserDetailService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAccountReference ¶
AddAccountReference adds an account reference and label (created from gitProviderKey and id) to the user
func CreateUser ¶
CreateUser creates a new default User
func DeleteUser ¶
DeleteUser deletes the user resource but does not uninstall the underlying namespaces
func GetUsers ¶
func GetUsers(jxClient versioned.Interface, ns string) (map[string]*jenkinsv1.User, []string, error)
GetUsers returns the pending users with the sorted order of names
func Resolve ¶
func Resolve(id string, providerKey string, jxClient versioned.Interface, namespace string, selectUsers func(id string, users []jenkinsv1.User) (string, []jenkinsv1.User, *jenkinsv1.User, error)) (*jenkinsv1.User, error)
Resolve does the heavy lifting for user resolution. This function is not normally called directly but by a dedicated user resolver (e.g. GitUserResolver) * checking the user custom resources to see if the user is present there * calling selectUsers to try to identify the user as often user info is not complete in a git response
Types ¶
type GitUserResolver ¶
type GitUserResolver struct { GitProvider gits.GitProvider JXClient jenkninsv1client.Interface Namespace string }
GitUserResolver allows git users to be converted to Jenkins X users
func (*GitUserResolver) GitProviderKey ¶
func (r *GitUserResolver) GitProviderKey() string
GitProviderKey returns the provider key for this GitUserResolver
func (*GitUserResolver) GitSignatureAsUser ¶
GitSignatureAsUser resolves the signature to a Jenkins X User
func (*GitUserResolver) GitUserLogin ¶
func (r *GitUserResolver) GitUserLogin(user *jenkinsv1.User) string
GitUserLogin returns the login for the git provider, or an empty string if not found
func (*GitUserResolver) GitUserSliceAsUserDetailsSlice ¶
func (r *GitUserResolver) GitUserSliceAsUserDetailsSlice(users []gits.GitUser) ([]jenkinsv1.UserDetails, error)
GitUserSliceAsUserDetailsSlice resolves a slice of git users to a slice of Jenkins X User Details
func (*GitUserResolver) GitUserToUser ¶
func (r *GitUserResolver) GitUserToUser(gitUser *gits.GitUser) *jenkinsv1.User
GitUserToUser performs type conversion from a GitUser to a Jenkins X user, attaching the Git Provider account to Accounts
func (*GitUserResolver) Resolve ¶
Resolve will convert the GitUser to a Jenkins X user and attempt to complete the user info by: * checking the user custom resources to see if the user is present there * making a call to the gitProvider as often user info is not complete in a git response
func (*GitUserResolver) UpdateUserFromPRAuthor ¶
func (r *GitUserResolver) UpdateUserFromPRAuthor(author *jenkinsv1.User, pullRequest *gits.GitPullRequest, commits []*gits.GitCommit) (*jenkinsv1.User, error)
UpdateUserFromPRAuthor will attempt to use the
func (*GitUserResolver) UserToGitUser ¶
UserToGitUser performs type conversion from a Jenkins X User to a Git User
type UserDetailService ¶
type UserDetailService struct {
// contains filtered or unexported fields
}
func NewUserDetailService ¶
func NewUserDetailService(jxClient versioned.Interface, namespace string) UserDetailService
func (*UserDetailService) CreateOrUpdateUser ¶
func (this *UserDetailService) CreateOrUpdateUser(u *v1.UserDetails) error
func (*UserDetailService) FindByEmail ¶ added in v1.3.731
func (this *UserDetailService) FindByEmail(email string) *v1.UserDetails