credentials

package
v0.0.79 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package credentials provides the implementations for the credentials

Package credentials provides the implementations for the credentials

Package credentials provides the implementations for the credentials

Package credentials provides the implementations for the credentials

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateGitHubAppJWT

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

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

GitHubInstallationTokenCredential is a credential that uses a GitHub installation access token

func NewGitHubInstallationTokenCredential

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

func (t *GitHubInstallationTokenCredential) AddToCloneOptions(options *git.CloneOptions)

AddToCloneOptions adds the credential to the git clone options

func (*GitHubInstallationTokenCredential) AddToPushOptions

func (t *GitHubInstallationTokenCredential) AddToPushOptions(options *git.PushOptions, owner string)

AddToPushOptions adds the credential to the git push options

func (*GitHubInstallationTokenCredential) GetAsContainerAuthenticator

func (t *GitHubInstallationTokenCredential) GetAsContainerAuthenticator(owner string) authn.Authenticator

GetAsContainerAuthenticator returns the token as a container registry authenticator

func (*GitHubInstallationTokenCredential) GetAsOAuth2TokenSource

func (t *GitHubInstallationTokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource

GetAsOAuth2TokenSource returns the token as an OAuth2 token source

func (*GitHubInstallationTokenCredential) GetCacheKey

func (t *GitHubInstallationTokenCredential) GetCacheKey() string

GetCacheKey returns the cache key used to look up the REST client

func (*GitHubInstallationTokenCredential) SetAuthorizationHeader

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

type GitLabTokenCredential

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

GitLabTokenCredential is a credential that uses a token

func NewGitLabTokenCredential

func NewGitLabTokenCredential(token string) *GitLabTokenCredential

NewGitLabTokenCredential creates a new GitLabTokenCredential from the token

func (*GitLabTokenCredential) AddToCloneOptions

func (t *GitLabTokenCredential) AddToCloneOptions(options *git.CloneOptions)

AddToCloneOptions adds the credential to the git clone options

func (*GitLabTokenCredential) AddToPushOptions

func (t *GitLabTokenCredential) AddToPushOptions(options *git.PushOptions, owner string)

AddToPushOptions adds the credential to the git push options

func (*GitLabTokenCredential) GetAsContainerAuthenticator

func (t *GitLabTokenCredential) GetAsContainerAuthenticator(owner string) authn.Authenticator

GetAsContainerAuthenticator returns the token as a container registry authenticator

func (*GitLabTokenCredential) GetAsOAuth2TokenSource

func (t *GitLabTokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource

GetAsOAuth2TokenSource returns the token as an OAuth2 token source

func (*GitLabTokenCredential) GetCacheKey

func (t *GitLabTokenCredential) GetCacheKey() string

GetCacheKey returns the cache key used to look up the REST client

func (*GitLabTokenCredential) GetCredential

func (t *GitLabTokenCredential) GetCredential() string

GetCredential implements the DirectCredential interface

func (*GitLabTokenCredential) SetAuthorizationHeader

func (t *GitLabTokenCredential) SetAuthorizationHeader(req *http.Request)

SetAuthorizationHeader sets the authorization header on the request

type OAuth2TokenCredential

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

OAuth2TokenCredential is a credential that uses an OAuth2 token

func NewOAuth2TokenCredential

func NewOAuth2TokenCredential(token string) *OAuth2TokenCredential

NewOAuth2TokenCredential creates a new OAuth2TokenCredential from the token

func (*OAuth2TokenCredential) GetAsOAuth2TokenSource

func (o *OAuth2TokenCredential) GetAsOAuth2TokenSource() oauth2.TokenSource

GetAsOAuth2TokenSource returns the token as an OAuth2 token source

Jump to

Keyboard shortcuts

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