gitcredentials

package
v2.53.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeHelperConfig

type FakeHelperConfig struct {
	SelfExecutablePath string
	Helpers            map[string]Helper
}

func (*FakeHelperConfig) ConfigureOurs

func (hc *FakeHelperConfig) ConfigureOurs(hostname string) error

ConfigureOurs sets up the git credential helper chain to use the GitHub CLI credential helper for git repositories including gists.

func (*FakeHelperConfig) ConfiguredHelper

func (hc *FakeHelperConfig) ConfiguredHelper(hostname string) (Helper, error)

ConfiguredHelper returns the configured git credential helper for a given hostname.

type Helper

type Helper struct {
	Cmd string
}

A Helper represents a git credential helper configuration.

func (Helper) IsConfigured

func (h Helper) IsConfigured() bool

IsConfigured returns true if the helper has a non-empty command, i.e. the git config had an entry

func (Helper) IsOurs

func (h Helper) IsOurs() bool

IsOurs returns true if the helper command is the GitHub CLI credential helper

type HelperConfig

type HelperConfig struct {
	SelfExecutablePath string
	GitClient          *git.Client
}

A HelperConfig is used to configure and inspect the state of git credential helpers.

func (*HelperConfig) ConfigureOurs

func (hc *HelperConfig) ConfigureOurs(hostname string) error

ConfigureOurs sets up the git credential helper chain to use the GitHub CLI credential helper for git repositories including gists.

func (*HelperConfig) ConfiguredHelper

func (hc *HelperConfig) ConfiguredHelper(hostname string) (Helper, error)

ConfiguredHelper returns the configured git credential helper for a given hostname.

type Updater

type Updater struct {
	GitClient *git.Client
}

An Updater is used to update the git credentials for a given hostname.

func (*Updater) Update

func (u *Updater) Update(hostname, username, password string) error

Update updates the git credentials for a given hostname, first by rejecting any existing credentials and then approving the new credentials.

Jump to

Keyboard shortcuts

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