credential

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareForCreateCredential

func PrepareForCreateCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store, credential string)

PrepareForCreateCredential only for test

func PrepareForCreateSecretCredential

func PrepareForCreateSecretCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password,
	store string, cred StringCredentials)

PrepareForCreateSecretCredential only for test

func PrepareForCreateUsernamePasswordCredential

func PrepareForCreateUsernamePasswordCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password,
	store string, cred UsernamePasswordCredential)

PrepareForCreateUsernamePasswordCredential only for test

func PrepareForCredentialListJSON

func PrepareForCredentialListJSON() string

PrepareForCredentialListJSON only for test

func PrepareForDeleteCredential

func PrepareForDeleteCredential(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store, id string)

PrepareForDeleteCredential only for test

func PrepareForGetCredentialList

func PrepareForGetCredentialList(roundTripper *mhttp.MockRoundTripper, rootURL, user, password, store string)

PrepareForGetCredentialList only for test

Types

type Credential

type Credential struct {
	Description string `json:"description"`
	DisplayName string
	Fingerprint interface{}
	FullName    string
	ID          string `json:"id"`
	TypeName    string
	Class       string `json:"$class"`
	Scope       string `json:"scope"`
}

Credential of Jenkins

type CredentialsManager

type CredentialsManager struct {
	core.JenkinsCore
}

CredentialsManager hold the info of credentials client

func (*CredentialsManager) Create

func (c *CredentialsManager) Create(store, credential string) (err error)

Create create a credential in Jenkins

func (*CredentialsManager) CreateSecret

func (c *CredentialsManager) CreateSecret(store string, cred StringCredentials) (err error)

CreateSecret create token credential in Jenkins

func (*CredentialsManager) CreateUsernamePassword

func (c *CredentialsManager) CreateUsernamePassword(store string, cred UsernamePasswordCredential) (err error)

CreateUsernamePassword create username and password credential in Jenkins

func (*CredentialsManager) Delete

func (c *CredentialsManager) Delete(store, id string) (err error)

Delete removes a credential by id from a store

func (*CredentialsManager) GetList

func (c *CredentialsManager) GetList(store string) (credentialList List, err error)

GetList returns the credential list

type List

type List struct {
	Description     string
	DisplayName     string
	FullDisplayName string
	FullName        string
	Global          bool
	URLName         string
	Credentials     []Credential
}

List contains many credentials

type StringCredentials

type StringCredentials struct {
	Credential `json:",inline"`
	Secret     string `json:"secret"`
}

StringCredentials hold a token

type UsernamePasswordCredential

type UsernamePasswordCredential struct {
	Credential `json:",inline"`
	Username   string `json:"username"`
	Password   string `json:"password"`
}

UsernamePasswordCredential hold the username and password

Jump to

Keyboard shortcuts

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