Skip to content

Commit

Permalink
Fix ContextBuilder bug when using credentials supplier with azureblob
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Smiley authored and gaul committed Aug 6, 2024
1 parent 6ef293d commit d62322c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions core/src/main/java/org/jclouds/ContextBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import org.jclouds.providers.config.BindProviderMetadataContextAndCredentials;
import org.jclouds.providers.internal.UpdateProviderMetadataFromProperties;
import org.jclouds.reflect.Invocation;
import org.jclouds.rest.ApiContext;
import org.jclouds.rest.ConfiguresCredentialStore;
import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.HttpApiMetadata;
Expand Down Expand Up @@ -364,10 +365,16 @@ private Properties currentStateToUnexpandedProperties() {
defaults.setProperty(PROPERTY_API, apiMetadata.getName());
defaults.setProperty(PROPERTY_API_VERSION, apiVersion);
defaults.setProperty(PROPERTY_BUILD_VERSION, buildVersion);
if (identity.isPresent())
defaults.setProperty(PROPERTY_IDENTITY, identity.get());
if (credential != null)
defaults.setProperty(PROPERTY_CREDENTIAL, credential);
if (credentialsSupplierOption.isPresent()) {
Credentials credentials = credentialsSupplierOption.get().get();
defaults.setProperty(PROPERTY_IDENTITY, credentials.identity);
defaults.setProperty(PROPERTY_CREDENTIAL, credentials.credential);
} else {
if (identity.isPresent())
defaults.setProperty(PROPERTY_IDENTITY, identity.get());
if (credential != null)
defaults.setProperty(PROPERTY_CREDENTIAL, credential);
}
if (overrides.isPresent())
putAllAsString(overrides.get(), defaults);
putAllAsString(propertiesPrefixedWithJcloudsApiOrProviderId(getSystemProperties(), apiMetadata.getId(), providerId), defaults);
Expand Down

0 comments on commit d62322c

Please sign in to comment.