Class GitCredentialsProviderFactory

java.lang.Object
org.springframework.cloud.config.server.support.GitCredentialsProviderFactory

public class GitCredentialsProviderFactory extends Object
A CredentialsProvider factory for Git repositories. Can handle AWS CodeCommit repositories and other repositories with username/password.
Author:
Don Laidlaw, Gareth Clay
  • Field Details

    • logger

      protected org.apache.commons.logging.Log logger
    • awsCodeCommitEnabled

      protected boolean awsCodeCommitEnabled
      Enable the AWS Code Commit credentials provider for Git URI's that match the AWS Code Commit pattern of https://git-codecommit.${AWS_REGION}.amazonaws.com/${repoPath}. Enabled by default.
  • Constructor Details

    • GitCredentialsProviderFactory

      public GitCredentialsProviderFactory()
  • Method Details

    • createFor

      @Deprecated public org.eclipse.jgit.transport.CredentialsProvider createFor(String uri, String username, String password, String passphrase)
      Search for a credential provider that will handle the specified URI. If not found, and the username or passphrase has text, then create a default using the provided username and password or passphrase. Otherwise null.
      Parameters:
      uri - the URI of the repository (cannot be null)
      username - the username provided for the repository (may be null)
      password - the password provided for the repository (may be null)
      passphrase - the passphrase to unlock the ssh private key (may be null)
      Returns:
      the first matched credentials provider or the default or null.
    • createFor

      public org.eclipse.jgit.transport.CredentialsProvider createFor(String uri, String username, String password, String passphrase, boolean skipSslValidation)
      Search for a credential provider that will handle the specified URI. If not found, and the username or passphrase has text, then create a default using the provided username and password or passphrase. If skipSslValidation is true and the URI has an https scheme, the default credential provider's behaviour is modified to suppress any SSL validation errors that occur when communicating via the URI. Otherwise null.
      Parameters:
      uri - the URI of the repository (cannot be null)
      username - the username provided for the repository (may be null)
      password - the password provided for the repository (may be null)
      passphrase - the passphrase to unlock the ssh private key (may be null)
      skipSslValidation - whether to skip SSL validation when connecting via HTTPS
      Returns:
      the first matched credentials provider or the default or null.
    • isAwsCodeCommitEnabled

      public boolean isAwsCodeCommitEnabled()
      Returns:
      the awsCodeCommitEnabled
    • setAwsCodeCommitEnabled

      public void setAwsCodeCommitEnabled(boolean awsCodeCommitEnabled)
      Parameters:
      awsCodeCommitEnabled - the awsCodeCommitEnabled to set