public class JGitUserInteraction
extends java.lang.Object
implements org.apache.sshd.client.auth.keyboard.UserInteraction
UserInteraction
callback implementation based on a
CredentialsProvider
.Modifier and Type | Class and Description |
---|---|
private static class |
JGitUserInteraction.SessionAuthMarker
A
SessionListener that removes itself from the session when
authentication is done or the session is closed. |
Modifier and Type | Field and 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 and Description |
---|
JGitUserInteraction(CredentialsProvider provider)
Creates a new
JGitUserInteraction for interactive password input
based on the given CredentialsProvider . |
Modifier and Type | Method and 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 a
URIish from the given remote address and user name. |
private final CredentialsProvider provider
private final java.util.Map<org.apache.sshd.common.session.Session,org.apache.sshd.common.session.SessionListener> ongoing
public JGitUserInteraction(CredentialsProvider provider)
JGitUserInteraction
for interactive password input
based on the given CredentialsProvider
.provider
- to usepublic boolean isInteractionAllowed(org.apache.sshd.client.session.ClientSession session)
isInteractionAllowed
in interface org.apache.sshd.client.auth.keyboard.UserInteraction
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)
interactive
in interface org.apache.sshd.client.auth.keyboard.UserInteraction
public java.lang.String getUpdatedPassword(org.apache.sshd.client.session.ClientSession session, java.lang.String prompt, java.lang.String lang)
getUpdatedPassword
in interface org.apache.sshd.client.auth.keyboard.UserInteraction
public static URIish toURI(java.lang.String userName, java.net.InetSocketAddress remote)
URIish
from the given remote address and user name.userName
- for the uriremote
- address of the remote hostSshConstants.SSH_SCHEME
as scheme