infrastructure

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveSignerFromGitConfig added in v0.3.0

func ResolveSignerFromGitConfig(
	gpgSign, signingFormat, signingKey, gpgKeyPath, gpgPassphrase, appName string,
) (globalEntities.CommitSigner, error)

ResolveSignerFromGitConfig determines if and how commits should be signed based on git configuration values. Returns nil if signing is not configured (gpgSign is not "true").

Parameters map to standard git config values:

  • gpgSign: commit.gpgsign
  • signingFormat: gpg.format ("ssh" for SSH signing, anything else for GPG)
  • signingKey: user.signingkey (key ID for GPG, file path for SSH)
  • gpgKeyPath: optional file path to exported GPG key (empty = auto-detect from keyring)
  • gpgPassphrase: GPG key passphrase (empty = prompt interactively)
  • appName: application name used for GPG key path generation (e.g., "autobump")

Types

type GPGSigner

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

GPGSigner signs commits using a GPG key.

func NewGPGSigner

func NewGPGSigner(key *openpgp.Entity) *GPGSigner

NewGPGSigner creates a new GPGSigner with the given GPG key entity.

func (*GPGSigner) Key

func (s *GPGSigner) Key() *openpgp.Entity

Key returns the underlying GPG key entity for use with go-git's SignKey option.

func (*GPGSigner) Sign

func (s *GPGSigner) Sign(_ context.Context, commitContent []byte) (string, error)

Sign signs the commit content using the GPG key and returns the armored signature.

type SSHSigner

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

SSHSigner signs commits using an SSH key.

func NewSSHSigner

func NewSSHSigner(keyPath string) *SSHSigner

NewSSHSigner creates a new SSHSigner with the given SSH key file path.

func (*SSHSigner) Sign

func (s *SSHSigner) Sign(ctx context.Context, commitContent []byte) (string, error)

Sign signs the commit content using ssh-keygen and returns the SSH signature.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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