github

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitHubAppAuthInstallationIDKey = "github_app_installation_id"
	GitHubAppAuthIDKey             = "github_app_id"
	GitHubAppAuthPrivateKeyKey     = "github_app_private_key"
)
View Source
const (
	GithubAppIDKey             = "github_app_id"
	GithubAppInstallationIDKey = "github_app_installation_id"
	GithubAppPrivateKeyKey     = "github_app_private_key"
)

Variables

View Source
var ErrNotGithubAppSecret = errors.New("not a GitHub App secret")

Functions

func GetGithubAppAuthFromSecret

func GetGithubAppAuthFromSecret(creds *corev1.Secret, getter AppAuthGetter) (*httpgit.BasicAuth, error)

func HasGitHubAppKeys

func HasGitHubAppKeys(secret *corev1.Secret) bool

HasGitHubAppKeys checks if the provided Kubernetes secret contains the necessary keys for a GitHub App: app ID, installation ID, and private key.

Types

type AppAuthGetter

type AppAuthGetter interface {
	Get(appID, insID int64, pem []byte) (*httpgit.BasicAuth, error)
}

type DefaultAppAuthGetter

type DefaultAppAuthGetter struct{}

func (DefaultAppAuthGetter) Get

func (DefaultAppAuthGetter) Get(appID, insID int64, pem []byte) (*httpgit.BasicAuth, error)

type GitHubApp

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

func NewApp

func NewApp(appID, installID int64, pem []byte) *GitHubApp

NewApp creates a new GitHubApp instance with the provided app ID, installation ID, and private key, and returns a pointer to it.

func (*GitHubApp) GetToken

func (app *GitHubApp) GetToken(ctx context.Context) (string, error)

GetToken retrieves a GitHub App installation token using the provided app ID, installation ID, and private key (PEM format). It returns the token as a string or an error if the process fails.

Jump to

Keyboard shortcuts

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