Class SshAgentSessionFactory


  • public class SshAgentSessionFactory
    extends org.eclipse.jgit.transport.JschConfigSessionFactory
    SSH-Agent enabler. A JschConfigSessionFactory which sets the Preferred authentication method to Publickey, and tries to use a NetCat Socket Factory to reach a ssh-agent process via it's Unix Socket as identified by environment var SSH_AUTH_SOCK. Note that this requires the 'nc' binary installed and available on PATH!
    Author:
    Johan Ström johan@pistonlabs.com
    • Constructor Summary

      Constructors 
      Constructor Description
      SshAgentSessionFactory​(org.apache.maven.plugin.logging.Log log, String knownHostsOrNull, String identityFile, String passphraseOrNull)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void configure​(org.eclipse.jgit.transport.OpenSshConfig.Host host, com.jcraft.jsch.Session sn)  
      protected com.jcraft.jsch.JSch createDefaultJSch​(org.eclipse.jgit.util.FS fs)  
      • Methods inherited from class org.eclipse.jgit.transport.JschConfigSessionFactory

        configureJSch, createSession, getJSch, getSession, getType
      • Methods inherited from class org.eclipse.jgit.transport.SshSessionFactory

        getInstance, getLocalUserName, releaseSession, setInstance
    • Constructor Detail

      • SshAgentSessionFactory

        public SshAgentSessionFactory​(org.apache.maven.plugin.logging.Log log,
                                      String knownHostsOrNull,
                                      String identityFile,
                                      String passphraseOrNull)
    • Method Detail

      • configure

        protected void configure​(org.eclipse.jgit.transport.OpenSshConfig.Host host,
                                 com.jcraft.jsch.Session sn)
        Overrides:
        configure in class org.eclipse.jgit.transport.JschConfigSessionFactory
      • createDefaultJSch

        protected com.jcraft.jsch.JSch createDefaultJSch​(org.eclipse.jgit.util.FS fs)
                                                  throws com.jcraft.jsch.JSchException
        Overrides:
        createDefaultJSch in class org.eclipse.jgit.transport.JschConfigSessionFactory
        Throws:
        com.jcraft.jsch.JSchException