Merge branch '4.1.x'

This commit is contained in:
Ryan Baxter
2024-12-13 20:00:47 -05:00
2 changed files with 3 additions and 10 deletions

View File

@@ -27,12 +27,12 @@
<micrometer-docs-generator.inclusionPattern>.*</micrometer-docs-generator.inclusionPattern>
<micrometer-docs-generator.outputPath>${maven.multiModuleProjectDirectory}/docs/modules/ROOT/partials/</micrometer-docs-generator.outputPath>
</properties>
<!-- <dependencies>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
</dependencies> -->
</dependencies>
<build>
<sourceDirectory>src/main/asciidoc</sourceDirectory>
</build>

View File

@@ -88,17 +88,10 @@ public class GitCredentialsProviderFactory {
aws.setPassword(password);
provider = aws;
}
else if (hasText(username)) {
else if (hasText(username) && password != null) {
this.logger.debug("Constructing UsernamePasswordCredentialsProvider for URI " + uri);
provider = new UsernamePasswordCredentialsProvider(username, password.toCharArray());
}
else if (hasText(username) && !hasText(passphrase)) {
// useful for token based login gh-1602
// see
// https://stackoverflow.com/questions/28073266/how-to-use-jgit-to-push-changes-to-remote-with-oauth-access-token
this.logger.debug("Constructing UsernamePasswordCredentialsProvider for URI " + uri);
provider = new UsernamePasswordCredentialsProvider(username, (String) null);
}
else if (hasText(passphrase)) {
this.logger.debug("Constructing PassphraseCredentialsProvider for URI " + uri);
provider = new PassphraseCredentialsProvider(passphrase);