Class JGitUserInteraction
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.JGitUserInteraction
-
- All Implemented Interfaces:
org.apache.sshd.client.auth.keyboard.UserInteraction
public class JGitUserInteraction extends java.lang.Object implements org.apache.sshd.client.auth.keyboard.UserInteractionAUserInteractioncallback implementation based on aCredentialsProvider.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classJGitUserInteraction.SessionAuthMarkerASessionListenerthat removes itself from the session when authentication is done or the session is closed.
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<org.apache.sshd.common.session.Session,org.apache.sshd.common.session.SessionListener>ongoingWe need to reset the JGit credentials provider if we have repeated attempts.private CredentialsProviderprovider
-
Constructor Summary
Constructors Constructor Description JGitUserInteraction(CredentialsProvider provider)Creates a newJGitUserInteractionfor interactive password input based on the givenCredentialsProvider.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetUpdatedPassword(org.apache.sshd.client.session.ClientSession session, java.lang.String prompt, java.lang.String lang)java.lang.String[]interactive(org.apache.sshd.client.session.ClientSession session, java.lang.String name, java.lang.String instruction, java.lang.String lang, java.lang.String[] prompt, boolean[] echo)booleanisInteractionAllowed(org.apache.sshd.client.session.ClientSession session)static URIishtoURI(java.lang.String userName, java.net.InetSocketAddress remote)Creates aURIishfrom the given remote address and user name.
-
-
-
Field Detail
-
provider
private final CredentialsProvider provider
-
ongoing
private final java.util.Map<org.apache.sshd.common.session.Session,org.apache.sshd.common.session.SessionListener> ongoing
We need to reset the JGit credentials provider if we have repeated attempts.
-
-
Constructor Detail
-
JGitUserInteraction
public JGitUserInteraction(CredentialsProvider provider)
Creates a newJGitUserInteractionfor interactive password input based on the givenCredentialsProvider.- Parameters:
provider- to use
-
-
Method Detail
-
isInteractionAllowed
public boolean isInteractionAllowed(org.apache.sshd.client.session.ClientSession session)
- Specified by:
isInteractionAllowedin interfaceorg.apache.sshd.client.auth.keyboard.UserInteraction
-
interactive
public java.lang.String[] interactive(org.apache.sshd.client.session.ClientSession session, java.lang.String name, java.lang.String instruction, java.lang.String lang, java.lang.String[] prompt, boolean[] echo)- Specified by:
interactivein interfaceorg.apache.sshd.client.auth.keyboard.UserInteraction
-
getUpdatedPassword
public java.lang.String getUpdatedPassword(org.apache.sshd.client.session.ClientSession session, java.lang.String prompt, java.lang.String lang)- Specified by:
getUpdatedPasswordin interfaceorg.apache.sshd.client.auth.keyboard.UserInteraction
-
toURI
public static URIish toURI(java.lang.String userName, java.net.InetSocketAddress remote)
Creates aURIishfrom the given remote address and user name.- Parameters:
userName- for the uriremote- address of the remote host- Returns:
- the uri, with
SshConstants.SSH_SCHEMEas scheme
-
-