Package org.craftercms.commons.git.auth
Class SshPrivateKeyAuthConfigurator
java.lang.Object
org.craftercms.commons.git.auth.AbstractSshAuthConfigurator
org.craftercms.commons.git.auth.SshPrivateKeyAuthConfigurator
- All Implemented Interfaces:
GitAuthenticationConfigurator
GitAuthenticationConfigurator that configures the TransportCommand to use SSH with private key
authentication.
The file path of the private key and it's passphrase can be provided, but are not necessary, specially when the
private key has already been loaded into the SSH agent.- Author:
- avasquez
-
Field Summary
FieldsFields inherited from class org.craftercms.commons.git.auth.AbstractSshAuthConfigurator
sshConfig -
Constructor Summary
ConstructorsConstructorDescriptionSshPrivateKeyAuthConfigurator(File sshConfig, String privateKeyPath, String passphrase) -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureAuthentication(org.eclipse.jgit.api.TransportCommand<?, ?> command) Configures the authentication of the givenTransportCommandbased on a specific authentication strategy, like HTTP basic authentication, SSH username/password authentication and SSH RSA key pair authentication.protected org.eclipse.jgit.transport.SshSessionFactory
-
Field Details
-
privateKeyPath
-
passphrase
-
-
Constructor Details
-
SshPrivateKeyAuthConfigurator
-
-
Method Details
-
configureAuthentication
public void configureAuthentication(org.eclipse.jgit.api.TransportCommand<?, ?> command) Description copied from interface:GitAuthenticationConfiguratorConfigures the authentication of the givenTransportCommandbased on a specific authentication strategy, like HTTP basic authentication, SSH username/password authentication and SSH RSA key pair authentication.- Specified by:
configureAuthenticationin interfaceGitAuthenticationConfigurator- Overrides:
configureAuthenticationin classAbstractSshAuthConfigurator- Parameters:
command- the command to configure
-
createSessionFactory
protected org.eclipse.jgit.transport.SshSessionFactory createSessionFactory()- Specified by:
createSessionFactoryin classAbstractSshAuthConfigurator
-