>From Michael Blow <[email protected]>: Michael Blow has submitted this change. ( 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 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17607 Reviewed-by: Hussain Towaileb <[email protected]> Tested-by: Michael Blow <[email protected]> --- M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/util/google/gcs/GCSUtils.java 1 file changed, 16 insertions(+), 4 deletions(-) Approvals: Hussain Towaileb: Looks good to me, approved Michael Blow: Verified 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: 2 Gerrit-Owner: Michael Blow <[email protected]> Gerrit-Reviewer: Hussain Towaileb <[email protected]> Gerrit-Reviewer: Michael Blow <[email protected]> Gerrit-CC: Anon. E. Moose #1000171 Gerrit-CC: Jenkins <[email protected]> Gerrit-MessageType: merged
