gitcred

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitcred is the seam between the mirror and the source of the password that it gives to a git remote. The mirror owns the interface. passwordfile reads a file that an operator keeps, and forgeapp exchanges the key of a forge application for a short-lived token.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential interface {
	// Use returns the credential for one git run, and a function that removes any file that Use made. A caller calls the function
	// when the run ends. The password stays in a file that the askpass helper reads, never in an argument.
	Use(ctx context.Context) (gitremote.Cred, func(), error)
}

Credential supplies the password of one remote.

type Error

type Error struct {
	Kind Kind
	Msg  string
}

Error is a failure to get a credential. Its text never holds a token or a key.

func (*Error) Error

func (e *Error) Error() string

type Kind

type Kind int

Kind says why a credential could not be had.

const (
	// Local means that the failure is in ward: a key or a file that is not usable.
	Local Kind = iota
	// Unreachable means that the service that issues the credential did not answer or answered nonsense.
	Unreachable
	// Auth means that the service refused the key.
	Auth
)

Directories

Path Synopsis
Package credtest is the conformance suite of gitcred.Credential.
Package credtest is the conformance suite of gitcred.Credential.
Package forgeapp is the gitcred.Credential of a GitHub App installation.
Package forgeapp is the gitcred.Credential of a GitHub App installation.
Package passwordfile is the gitcred.Credential of a password or token that an operator keeps in a file.
Package passwordfile is the gitcred.Credential of a password or token that an operator keeps in a file.

Jump to

Keyboard shortcuts

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