users

package
v2.1.75 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAccountReference

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

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

CreateUser creates a new default User

func DeleteUser

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

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

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

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

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

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

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

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

Jump to

Keyboard shortcuts

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