git

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FieldNameGitCredentialUsername = "username"
	FieldNameGitCredentialPassword = "password"

	StorageKeyConfigurationGitCredential = "configuration_git_credential"
)

Variables

View Source
var ErrCloneSizeLimitExceeded = errors.New("clone size limit exceeded")

ErrCloneSizeLimitExceeded is returned when the repository size exceeds MaxCloneSizeBytes during in-memory clone.

Functions

func AddWorktreeFilesToTar

func AddWorktreeFilesToTar(tw *tar.Writer, gitRepo *git.Repository) error

func CloneInMemory

func CloneInMemory(url string, opts CloneOptions) (*git.Repository, error)

func CredentialsPaths

func CredentialsPaths() []*framework.Path

func DeleteGitCredential

func DeleteGitCredential(ctx context.Context, storage logical.Storage) error

func ForEachFile added in v0.2.0

func ForEachFile(billyFS billy.Filesystem, fileFunc func(path, link string, fileReader io.Reader, info os.FileInfo) error) error

ForEachFile walks all files in the given billy filesystem and calls fileFunc for each.

func ForEachWorktreeFile

func ForEachWorktreeFile(gitRepo *git.Repository, fileFunc func(path, link string, fileReader io.Reader, info os.FileInfo) error) error

func IsAncestor

func IsAncestor(gitRepo *git.Repository, ancestorCommit, descendantCommit string) (bool, error)

func NewNotEnoughVerifiedPGPSignaturesError

func NewNotEnoughVerifiedPGPSignaturesError(number int) error

func PutGitCredential

func PutGitCredential(ctx context.Context, storage logical.Storage, gitCredential GitCredential) error

func ReadWorktreeFile

func ReadWorktreeFile(gitRepo *git.Repository, path string) ([]byte, error)

func VerifyCommitSignatures

func VerifyCommitSignatures(repo *git.Repository, commit string, trustedPGPPublicKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) error

func VerifyTagSignatures

func VerifyTagSignatures(repo *git.Repository, tagName string, trustedPGPPublicKeys []string, requiredNumberOfVerifiedSignatures int, logger hclog.Logger) error

Types

type CloneOptions

type CloneOptions struct {
	TagName           string
	BranchName        string
	ReferenceName     string
	RecurseSubmodules git.SubmoduleRecursivity
	Auth              transport.AuthMethod
	CABundle          []byte
	// MaxCloneSizeBytes limits total size of objects stored during in-memory clone (0 = no limit).
	// When exceeded, clone fails with ErrCloneSizeLimitExceeded. Use to prevent OOM on large or malicious repos.
	MaxCloneSizeBytes int64
}

type GitCredential

type GitCredential struct {
	Username string `structs:"username" json:"username"`
	Password string `structs:"password" json:"password"`
}

func GetGitCredential

func GetGitCredential(ctx context.Context, storage logical.Storage) (*GitCredential, error)

type NotEnoughVerifiedPGPSignaturesError

type NotEnoughVerifiedPGPSignaturesError struct {
	Number int
}

func (*NotEnoughVerifiedPGPSignaturesError) Error

Jump to

Keyboard shortcuts

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