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 Object implements org.apache.sshd.client.auth.keyboard.UserInteraction
A UserInteraction callback implementation based on a CredentialsProvider.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static class 
    A SessionListener that removes itself from the session when authentication is done or the session is closed.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Map<org.apache.sshd.common.session.Session,org.apache.sshd.common.session.SessionListener>
    We need to reset the JGit credentials provider if we have repeated attempts.
    private final CredentialsProvider
     

    Fields inherited from interface org.apache.sshd.client.auth.keyboard.UserInteraction

    AUTO_DETECT_PASSWORD_PROMPT, CHECK_INTERACTIVE_PASSWORD_DELIM, DEFAULT_AUTO_DETECT_PASSWORD_PROMPT, DEFAULT_CHECK_INTERACTIVE_PASSWORD_DELIM, DEFAULT_INTERACTIVE_PASSWORD_PROMPT, INTERACTIVE_PASSWORD_PROMPT, NONE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new JGitUserInteraction for interactive password input based on the given CredentialsProvider.
  • Method Summary

    Modifier and Type
    Method
    Description
    getUpdatedPassword(org.apache.sshd.client.session.ClientSession session, String prompt, String lang)
     
    interactive(org.apache.sshd.client.session.ClientSession session, String name, String instruction, String lang, String[] prompt, boolean[] echo)
     
    boolean
    isInteractionAllowed(org.apache.sshd.client.session.ClientSession session)
     
    static URIish
    toURI(String userName, InetSocketAddress remote)
    Creates a URIish from the given remote address and user name.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.sshd.client.auth.keyboard.UserInteraction

    resolveAuthPasswordAttempt, resolveAuthPublicKeyIdentityAttempt, serverVersionInfo, welcome
  • Field Details

    • provider

      private final CredentialsProvider provider
    • ongoing

      private final 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 Details

  • Method Details

    • isInteractionAllowed

      public boolean isInteractionAllowed(org.apache.sshd.client.session.ClientSession session)
      Specified by:
      isInteractionAllowed in interface org.apache.sshd.client.auth.keyboard.UserInteraction
    • interactive

      public String[] interactive(org.apache.sshd.client.session.ClientSession session, String name, String instruction, String lang, String[] prompt, boolean[] echo)
      Specified by:
      interactive in interface org.apache.sshd.client.auth.keyboard.UserInteraction
    • getUpdatedPassword

      public String getUpdatedPassword(org.apache.sshd.client.session.ClientSession session, String prompt, String lang)
      Specified by:
      getUpdatedPassword in interface org.apache.sshd.client.auth.keyboard.UserInteraction
    • toURI

      public static URIish toURI(String userName, InetSocketAddress remote)
      Creates a URIish from the given remote address and user name.
      Parameters:
      userName - for the uri
      remote - address of the remote host
      Returns:
      the uri, with SshConstants.SSH_SCHEME as scheme