Documentation
¶
Overview ¶
Package ssh provides transparent SSH authentication support for Git operations
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSSHCloneURL ¶
GetSSHCloneURL converts HTTPS URLs to SSH URLs for Git hosting providers
Types ¶
type AgentAuth ¶
type AgentAuth struct {
// contains filtered or unexported fields
}
AgentAuth implements SSH agent authentication
func (*AgentAuth) Auth ¶
func (a *AgentAuth) Auth() (ssh.AuthMethod, error)
Auth returns the SSH authentication method for agent auth
type AuthMethod ¶
type AuthMethod interface {
Name() string
Auth() (ssh.AuthMethod, error)
Available() bool
}
AuthMethod represents an SSH authentication method
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator manages SSH authentication methods
func NewAuthenticator ¶
func NewAuthenticator(config *Config) (*Authenticator, error)
NewAuthenticator creates a new SSH authenticator with auto-detection
func (*Authenticator) GetAuthMethods ¶
func (a *Authenticator) GetAuthMethods() []ssh.AuthMethod
GetAuthMethods returns all available SSH authentication methods GetAuthMethods returns the available SSH authentication methods
func (*Authenticator) TestConnection ¶
TestConnection tests SSH connectivity to a host
type Config ¶
type Config struct {
// SSH agent socket path (auto-detected if not provided)
AgentSocket string
// SSH key file paths (auto-detected if not provided)
KeyFiles []string
// SSH config file path (defaults to ~/.ssh/config)
ConfigFile string
// Host-specific configurations
HostConfigs map[string]*HostConfig
// Timeout for SSH operations
Timeout time.Duration
// Enable verbose logging
Verbose bool
}
Config holds SSH configuration and authentication methods
type GitSSHWrapper ¶
type GitSSHWrapper struct {
// contains filtered or unexported fields
}
GitSSHWrapper provides Git-specific SSH configuration
func NewGitSSHWrapper ¶
func NewGitSSHWrapper(config *Config) (*GitSSHWrapper, error)
NewGitSSHWrapper creates a new Git SSH wrapper
func (*GitSSHWrapper) Cleanup ¶
func (w *GitSSHWrapper) Cleanup() error
Cleanup removes temporary files
func (*GitSSHWrapper) SetupGitSSH ¶
func (w *GitSSHWrapper) SetupGitSSH() error
SetupGitSSH configures Git to use SSH authentication
type HostConfig ¶
type HostConfig struct {
Hostname string
Port int
User string
IdentityFile string
ProxyCommand string
// Additional SSH options
Options map[string]string
}
HostConfig contains SSH configuration for a specific host
type KeyAuth ¶
type KeyAuth struct {
// contains filtered or unexported fields
}
KeyAuth implements SSH key file authentication
func (*KeyAuth) Auth ¶
func (a *KeyAuth) Auth() (ssh.AuthMethod, error)
Auth returns the SSH authentication method for key auth