common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShouldRun

func ShouldRun() bool

ShouldRun reads stdin to determine if this authenticator should even be called. If this returns false, the Authenticator should not be run.

Types

type AppSecret

type AppSecret struct {
	AppId          string `json:"app_id"`
	InstallationId string `json:"installation_id"`
	PrivateKey     string `json:"private_key"`
}

AppSecret provides the necessary components for GitHub authentication as an installation.

type Authenticator

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

Authenticator is the entrypoint for authentication.

func NewAuthenticator

func NewAuthenticator(secretProvider SecretProvider) *Authenticator

NewAuthenticator creates an Authenticator

func (*Authenticator) Authenticate

func (auth *Authenticator) Authenticate() (string, error)

Authenticate provides the string output for a git credential command.

type SecretProvider

type SecretProvider interface {
	Credentials() (*AppSecret, error)
}

SecretProvider is the interface to anything that can provide the AppSecret for authentication.

Jump to

Keyboard shortcuts

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