Documentation ¶
Index ¶
Constants ¶
const ( KeyboardInteractiveName = "ssh-keyboard-interactive" PasswordName = "ssh-password" PasswordCallbackName = "ssh-password-callback" PublicKeysName = "ssh-public-keys" PublicKeysCallbackName = "ssh-public-key-callback" )
The names of the AuthMethod implementations. To be returned by the Name() method. Most git servers only allow PublicKeysName and PublicKeysCallbackName.
const DefaultSSHUsername = "git"
Variables ¶
var DefaultClient = common.NewClient(&runner{})
DefaultClient is the default SSH client.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod interface {
// contains filtered or unexported methods
}
AuthMethod is the interface all auth methods for the ssh client must implement. The clientConfig method returns the ssh client configuration needed to establish an ssh connection.
type KeyboardInteractive ¶
type KeyboardInteractive struct { User string Challenge ssh.KeyboardInteractiveChallenge }
KeyboardInteractive implements AuthMethod by using a prompt/response sequence controlled by the server.
func (*KeyboardInteractive) Name ¶
func (a *KeyboardInteractive) Name() string
func (*KeyboardInteractive) String ¶
func (a *KeyboardInteractive) String() string
type PasswordCallback ¶
PasswordCallback implements AuthMethod by using a callback to fetch the password.
func (*PasswordCallback) Name ¶
func (a *PasswordCallback) Name() string
func (*PasswordCallback) String ¶
func (a *PasswordCallback) String() string
type PublicKeys ¶
PublicKeys implements AuthMethod by using the given key pairs.
func (*PublicKeys) Name ¶
func (a *PublicKeys) Name() string
func (*PublicKeys) String ¶
func (a *PublicKeys) String() string
type PublicKeysCallback ¶
PublicKeysCallback implements AuthMethod by asking a ssh.agent.Agent to act as a signer.
func NewSSHAgentAuth ¶
func NewSSHAgentAuth(user string) (*PublicKeysCallback, error)
Opens a pipe with the ssh agent and uses the pipe as the implementer of the public key callback function.
func (*PublicKeysCallback) Name ¶
func (a *PublicKeysCallback) Name() string
func (*PublicKeysCallback) String ¶
func (a *PublicKeysCallback) String() string