Documentation ¶
Overview ¶
Package credentials provides the implementations for the credentials
Package credentials provides the implementations for the credentials
Index ¶
- func CreateGitHubAppJWT(appId int64, privateKey *rsa.PrivateKey) (string, error)
- type EmptyCredential
- type GitHubInstallationTokenCredential
- func (t *GitHubInstallationTokenCredential) AddToCloneOptions(options *git.CloneOptions)
- func (t *GitHubInstallationTokenCredential) AddToPushOptions(options *git.PushOptions, owner string)
- func (t *GitHubInstallationTokenCredential) GetAsContainerAuthenticator(owner string) authn.Authenticator
- func (t *GitHubInstallationTokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource
- func (t *GitHubInstallationTokenCredential) GetCacheKey() string
- func (t *GitHubInstallationTokenCredential) SetAuthorizationHeader(req *http.Request)
- type GitHubTokenCredential
- func (t *GitHubTokenCredential) AddToCloneOptions(options *git.CloneOptions)
- func (t *GitHubTokenCredential) AddToPushOptions(options *git.PushOptions, owner string)
- func (t *GitHubTokenCredential) GetAsContainerAuthenticator(owner string) authn.Authenticator
- func (t *GitHubTokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource
- func (t *GitHubTokenCredential) GetCacheKey() string
- func (t *GitHubTokenCredential) SetAuthorizationHeader(req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGitHubAppJWT ¶ added in v0.0.38
func CreateGitHubAppJWT(appId int64, privateKey *rsa.PrivateKey) (string, error)
CreateGitHubAppJWT creates a JWT token for a GitHub App
Types ¶
type EmptyCredential ¶
type EmptyCredential struct { }
EmptyCredential is an empty credential whose operations are no-ops
func NewEmptyCredential ¶
func NewEmptyCredential() *EmptyCredential
NewEmptyCredential creates a new EmptyCredential
func (*EmptyCredential) AddToCloneOptions ¶
func (*EmptyCredential) AddToCloneOptions(*git.CloneOptions)
AddToCloneOptions is a no-op
func (*EmptyCredential) AddToPushOptions ¶
func (*EmptyCredential) AddToPushOptions(*git.PushOptions, string)
AddToPushOptions is a no-op
func (*EmptyCredential) SetAuthorizationHeader ¶
func (*EmptyCredential) SetAuthorizationHeader(*http.Request)
SetAuthorizationHeader is a no-op
type GitHubInstallationTokenCredential ¶ added in v0.0.37
type GitHubInstallationTokenCredential struct {
// contains filtered or unexported fields
}
GitHubInstallationTokenCredential is a credential that uses a GitHub installation access token
func NewGitHubInstallationTokenCredential ¶ added in v0.0.37
func NewGitHubInstallationTokenCredential( ctx context.Context, appId int64, privateKey *rsa.PrivateKey, endpoint string, installationId int64, ) *GitHubInstallationTokenCredential
NewGitHubInstallationTokenCredential creates a new GitHubInstallationTokenCredential from the installationId
func (*GitHubInstallationTokenCredential) AddToCloneOptions ¶ added in v0.0.37
func (t *GitHubInstallationTokenCredential) AddToCloneOptions(options *git.CloneOptions)
AddToCloneOptions adds the credential to the git clone options
func (*GitHubInstallationTokenCredential) AddToPushOptions ¶ added in v0.0.37
func (t *GitHubInstallationTokenCredential) AddToPushOptions(options *git.PushOptions, owner string)
AddToPushOptions adds the credential to the git push options
func (*GitHubInstallationTokenCredential) GetAsContainerAuthenticator ¶ added in v0.0.37
func (t *GitHubInstallationTokenCredential) GetAsContainerAuthenticator(owner string) authn.Authenticator
GetAsContainerAuthenticator returns the token as a container registry authenticator
func (*GitHubInstallationTokenCredential) GetAsOAuth2TokenSource ¶ added in v0.0.37
func (t *GitHubInstallationTokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource
GetAsOAuth2TokenSource returns the token as an OAuth2 token source
func (*GitHubInstallationTokenCredential) GetCacheKey ¶ added in v0.0.37
func (t *GitHubInstallationTokenCredential) GetCacheKey() string
GetCacheKey returns the cache key used to look up the REST client
func (*GitHubInstallationTokenCredential) SetAuthorizationHeader ¶ added in v0.0.37
func (t *GitHubInstallationTokenCredential) SetAuthorizationHeader(req *http.Request)
SetAuthorizationHeader sets the authorization header on the request
type GitHubTokenCredential ¶
type GitHubTokenCredential struct {
// contains filtered or unexported fields
}
GitHubTokenCredential is a credential that uses a token
func NewGitHubTokenCredential ¶
func NewGitHubTokenCredential(token string) *GitHubTokenCredential
NewGitHubTokenCredential creates a new GitHubTokenCredential from the token
func (*GitHubTokenCredential) AddToCloneOptions ¶
func (t *GitHubTokenCredential) AddToCloneOptions(options *git.CloneOptions)
AddToCloneOptions adds the credential to the git clone options
func (*GitHubTokenCredential) AddToPushOptions ¶
func (t *GitHubTokenCredential) AddToPushOptions(options *git.PushOptions, owner string)
AddToPushOptions adds the credential to the git push options
func (*GitHubTokenCredential) GetAsContainerAuthenticator ¶
func (t *GitHubTokenCredential) GetAsContainerAuthenticator(owner string) authn.Authenticator
GetAsContainerAuthenticator returns the token as a container registry authenticator
func (*GitHubTokenCredential) GetAsOAuth2TokenSource ¶
func (t *GitHubTokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource
GetAsOAuth2TokenSource returns the token as an OAuth2 token source
func (*GitHubTokenCredential) GetCacheKey ¶
func (t *GitHubTokenCredential) GetCacheKey() string
GetCacheKey returns the cache key used to look up the REST client
func (*GitHubTokenCredential) SetAuthorizationHeader ¶
func (t *GitHubTokenCredential) SetAuthorizationHeader(req *http.Request)
SetAuthorizationHeader sets the authorization header on the request