Class CredentialsProviderImpl


  • public class CredentialsProviderImpl
    extends org.eclipse.jgit.transport.CredentialsProvider
    Provides the credential to authenticate Git connection.

    For HTTP transport we work through CredentialsProvider, in which case this must be supplied with a StandardUsernamePasswordCredentials. For SSH transport, TrileadSessionFactory downcasts CredentialsProvider to this class.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      com.cloudbees.plugins.credentials.common.StandardUsernameCredentials cred
      Credential that should be used.
      TaskListener listener  
    • Constructor Summary

      Constructors 
      Constructor Description
      CredentialsProviderImpl​(TaskListener listener, com.cloudbees.plugins.credentials.common.StandardUsernameCredentials cred)
      Constructor for CredentialsProviderImpl.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean get​(org.eclipse.jgit.transport.URIish uri, org.eclipse.jgit.transport.CredentialItem... items)
      If username/password is given, use it for HTTP auth.
      boolean isInteractive()
      boolean supports​(org.eclipse.jgit.transport.CredentialItem... items)
      If username/password is given, use it for HTTP auth.
      • Methods inherited from class org.eclipse.jgit.transport.CredentialsProvider

        get, getDefault, isAnyNull, reset, setDefault
    • Field Detail

      • cred

        public final com.cloudbees.plugins.credentials.common.StandardUsernameCredentials cred
        Credential that should be used.
    • Constructor Detail

      • CredentialsProviderImpl

        public CredentialsProviderImpl​(TaskListener listener,
                                       com.cloudbees.plugins.credentials.common.StandardUsernameCredentials cred)
        Constructor for CredentialsProviderImpl.
        Parameters:
        listener - a TaskListener object.
        cred - a StandardUsernameCredentials object.
    • Method Detail

      • isInteractive

        public boolean isInteractive()
        Specified by:
        isInteractive in class org.eclipse.jgit.transport.CredentialsProvider
      • supports

        public boolean supports​(org.eclipse.jgit.transport.CredentialItem... items)
        If username/password is given, use it for HTTP auth.
        Specified by:
        supports in class org.eclipse.jgit.transport.CredentialsProvider
      • get

        public boolean get​(org.eclipse.jgit.transport.URIish uri,
                           org.eclipse.jgit.transport.CredentialItem... items)
                    throws org.eclipse.jgit.errors.UnsupportedCredentialItem
        If username/password is given, use it for HTTP auth.
        Specified by:
        get in class org.eclipse.jgit.transport.CredentialsProvider
        Throws:
        org.eclipse.jgit.errors.UnsupportedCredentialItem