Class 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
    A UserInteraction callback implementation based on a CredentialsProvider.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  JGitUserInteraction.SessionAuthMarker
      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 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  
      • 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
    • 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 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

        serverVersionInfo, welcome
    • Field Detail

      • 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.
    • Method Detail

      • 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 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 interface org.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 interface org.apache.sshd.client.auth.keyboard.UserInteraction
      • toURI

        public static URIish toURI​(java.lang.String userName,
                                   java.net.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