agentidentity

package
v1.0.0-rc.17 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 31 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

Index

Constants

View Source
const (
	HostReasonKeyUnusable = "key_unusable"
	HostReasonUnknownHost = "unknown_host"
	HostReasonUnreachable = "unreachable"
	HostReasonRejected    = "key_rejected"
	HostReasonFailed      = "failed"
)
View Source
const (
	PersonFromOverride  = "override"
	PersonFromGit       = "git"
	PersonFromGitConfig = "gitconfig"
)
View Source
const (
	ConfigName     = "agent-git-name"
	ConfigEmail    = "agent-git-email"
	ConfigKey      = "agent-git-key"
	ConfigSign     = "agent-git-sign"
	ConfigCreditMe = "agent-git-credit-me"
	ConfigCreditAs = "agent-git-credit-as"
)
View Source
const GeneratedKeyName = "contenox_agent_ed25519"

Variables

This section is empty.

Functions

func CoAuthorTrailer

func CoAuthorTrailer(person Person) string

func Save

func Save(ctx context.Context, store runtimetypes.Store, identity Identity) error

func UserGitIdentity

func UserGitIdentity() (object.Signature, error)

func VerifySignature

func VerifySignature(armored, message []byte) (ssh.PublicKey, error)

Types

type CommitSigner

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

func NewCommitSigner

func NewCommitSigner(signer ssh.Signer) *CommitSigner

func (*CommitSigner) Sign

func (s *CommitSigner) Sign(message io.Reader) ([]byte, error)

type HostCheck

type HostCheck struct {
	Host    string `json:"host"`
	OK      bool   `json:"ok"`
	Account string `json:"account,omitempty"`
	Reason  string `json:"reason,omitempty"`
	Message string `json:"message"`
}

type Identity

type Identity struct {
	Name     string `json:"name"`
	Email    string `json:"email"`
	Key      string `json:"key"`
	Sign     bool   `json:"sign"`
	CreditMe bool   `json:"creditMe"`
	CreditAs string `json:"creditAs"`
}

func Load

func Load(ctx context.Context, store runtimetypes.Store) Identity

func (Identity) Active

func (i Identity) Active() bool

func (Identity) Credit

func (i Identity) Credit(ctx context.Context, repoDir string) (Person, bool)

func (Identity) Normalized

func (i Identity) Normalized() Identity

func (Identity) Validate

func (i Identity) Validate() error

type Key

type Key struct {
	Ref         string `json:"ref"`
	Label       string `json:"label"`
	Type        string `json:"type"`
	Fingerprint string `json:"fingerprint"`
	PublicKey   string `json:"publicKey"`
	Source      string `json:"source"`
	Usable      bool   `json:"usable"`
	Problem     string `json:"problem,omitempty"`
}

type KeySource

type KeySource struct {
	SSHDir string
	Agent  func() (agent.ExtendedAgent, func(), error)
}

func DefaultKeySource

func DefaultKeySource() KeySource

func (KeySource) CheckHost

func (src KeySource) CheckHost(ctx context.Context, ref, host string) HostCheck

func (KeySource) CheckSigning

func (src KeySource) CheckSigning(ref string) SigningCheck

func (KeySource) Discover

func (src KeySource) Discover() []Key

func (KeySource) Generate

func (src KeySource) Generate(comment string) (Key, error)

func (KeySource) HostKeyCallback

func (src KeySource) HostKeyCallback(alias string) (ssh.HostKeyCallback, []string, error)

func (KeySource) Resolve

func (src KeySource) Resolve(ctx context.Context, identity Identity, repoDir string) (*localtools.GitIdentity, error)

func (KeySource) Resolver

func (KeySource) Signer

func (src KeySource) Signer(ref string) (ssh.Signer, func(), error)

type Person

type Person struct {
	Name   string `json:"name"`
	Email  string `json:"email"`
	Source string `json:"source"`
}

func DefaultPerson

func DefaultPerson(ctx context.Context) (Person, error)

func ParsePerson

func ParsePerson(raw string) (Person, error)

func RepositoryPerson

func RepositoryPerson(ctx context.Context, repoDir string) (Person, error)

func (Person) String

func (p Person) String() string

type SigningCheck

type SigningCheck struct {
	OK          bool   `json:"ok"`
	Fingerprint string `json:"fingerprint,omitempty"`
	Message     string `json:"message"`
}

Jump to

Keyboard shortcuts

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