This is an automated email from the ASF dual-hosted git repository.
gaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds.git
The following commit(s) were added to refs/heads/master by this push:
new d62322c2ac Fix ContextBuilder bug when using credentials supplier with
azureblob
d62322c2ac is described below
commit d62322c2acf167d1a43c123f58fc41907f3d129c
Author: Max Smiley <[email protected]>
AuthorDate: Wed Jul 24 22:11:44 2024 +0000
Fix ContextBuilder bug when using credentials supplier with azureblob
---
core/src/main/java/org/jclouds/ContextBuilder.java | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/core/src/main/java/org/jclouds/ContextBuilder.java
b/core/src/main/java/org/jclouds/ContextBuilder.java
index 7c6cbc5991..6588a56ae0 100644
--- a/core/src/main/java/org/jclouds/ContextBuilder.java
+++ b/core/src/main/java/org/jclouds/ContextBuilder.java
@@ -74,6 +74,7 @@ import org.jclouds.providers.Providers;
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;
@@ -364,10 +365,16 @@ public class ContextBuilder {
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);