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.UserInteraction
AUserInteraction
callback implementation based on aCredentialsProvider
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JGitUserInteraction.SessionAuthMarker
ASessionListener
that 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>
ongoing
We need to reset the JGit credentials provider if we have repeated attempts.private CredentialsProvider
provider
-
Constructor Summary
Constructors Constructor Description JGitUserInteraction(CredentialsProvider provider)
Creates a newJGitUserInteraction
for interactive password input based on the givenCredentialsProvider
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getUpdatedPassword(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)
boolean
isInteractionAllowed(org.apache.sshd.client.session.ClientSession session)
static URIish
toURI(java.lang.String userName, java.net.InetSocketAddress remote)
Creates aURIish
from 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 newJGitUserInteraction
for 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:
isInteractionAllowed
in 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:
interactive
in 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:
getUpdatedPassword
in interfaceorg.apache.sshd.client.auth.keyboard.UserInteraction
-
toURI
public static URIish toURI(java.lang.String userName, java.net.InetSocketAddress remote)
Creates aURIish
from the given remote address and user name.- Parameters:
userName
- for the uriremote
- address of the remote host- Returns:
- the uri, with
SshConstants.SSH_SCHEME
as scheme
-
-