>From Michael Blow <[email protected]>:
Michael Blow has uploaded this change for review. (
https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17607 )
Change subject: [NO ISSUE][*DB] Apply missing change for GCS anonymous
......................................................................
[NO ISSUE][*DB] Apply missing change for GCS anonymous
Change-Id: I20aff3a73a822ff8627af685cd33b904384d6905
---
M
asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
1 file changed, 13 insertions(+), 4 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb
refs/changes/07/17607/1
diff --git
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
index 3efb041..6183a88 100644
---
a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
+++
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java
@@ -58,6 +58,7 @@
import com.google.api.gax.paging.Page;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.BaseServiceException;
+import com.google.cloud.NoCredentials;
import com.google.cloud.storage.Blob;
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.StorageOptions;
@@ -101,15 +102,14 @@
} catch (IOException ex) {
throw CompilationException.create(EXTERNAL_SOURCE_ERROR,
getMessageOrToString(ex));
}
- }
-
- // json credentials
- if (jsonCredentials != null) {
+ } else if (jsonCredentials != null) {
try (InputStream credentialsStream = new
ByteArrayInputStream(jsonCredentials.getBytes())) {
builder.setCredentials(GoogleCredentials.fromStream(credentialsStream));
} catch (IOException ex) {
throw new CompilationException(EXTERNAL_SOURCE_ERROR,
getMessageOrToString(ex));
}
+ } else {
+ builder.setCredentials(NoCredentials.getInstance());
}
if (endpoint != null) {
--
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17607
To unsubscribe, or for help writing mail filters, visit
https://asterix-gerrit.ics.uci.edu/settings
Gerrit-Project: asterixdb
Gerrit-Branch: trinity
Gerrit-Change-Id: I20aff3a73a822ff8627af685cd33b904384d6905
Gerrit-Change-Number: 17607
Gerrit-PatchSet: 1
Gerrit-Owner: Michael Blow <[email protected]>
Gerrit-MessageType: newchange