jx: github.com/jenkins-x/jx/pkg/users Index | Files

package users

import "github.com/jenkins-x/jx/pkg/users"

Index

Package Files

git.go user_details.go users.go

func AddAccountReference Uses

func AddAccountReference(user *jenkinsv1.User, gitProviderKey string, id string) *jenkinsv1.User

AddAccountReference adds an account reference and label (created from gitProviderKey and id) to the user

func CreateUser Uses

func CreateUser(ns string, login string, name string, email string) *jenkinsv1.User

CreateUser creates a new default User

func DeleteUser Uses

func DeleteUser(jxClient versioned.Interface, ns string, userName string) error

DeleteUser deletes the user resource but does not uninstall the underlying namespaces

func GetUsers Uses

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 Uses

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

type GitUserResolver Uses

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 Uses

func (r *GitUserResolver) GitProviderKey() string

GitProviderKey returns the provider key for this GitUserResolver

func (*GitUserResolver) GitSignatureAsUser Uses

func (r *GitUserResolver) GitSignatureAsUser(signature *object.Signature) (*jenkinsv1.User, error)

GitSignatureAsUser resolves the signature to a Jenkins X User

func (*GitUserResolver) GitUserLogin Uses

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 Uses

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 Uses

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 Uses

func (r *GitUserResolver) Resolve(user *gits.GitUser) (*jenkinsv1.User, error)

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 Uses

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 Uses

func (r *GitUserResolver) UserToGitUser(id string, user *jenkinsv1.User) *gits.GitUser

UserToGitUser performs type conversion from a Jenkins X User to a Git User

type UserDetailService Uses

type UserDetailService struct {
    // contains filtered or unexported fields
}

func NewUserDetailService Uses

func NewUserDetailService(jxClient versioned.Interface, namespace string) UserDetailService

func (*UserDetailService) CreateOrUpdateUser Uses

func (this *UserDetailService) CreateOrUpdateUser(u *v1.UserDetails) error

Package users imports 11 packages (graph) and is imported by 7 packages. Updated 2019-07-29. Refresh now. Tools for package owners.