Skip to content

Commit

Permalink
Destination BigQuery: Enabling Application Default Credentials (#14784)
Browse files Browse the repository at this point in the history
* Enabling different bigquery authentications

Current implementation only accepts Service Accounts. For developers
it is very desirable that we can login with Application Default Credentials
(ADC) https://cloud.google.com/sdk/gcloud/reference/auth/application-default

* bump version and update doc

* auto-bump connector version [ci skip]

Co-authored-by: marcosmarxm <[email protected]>
Co-authored-by: Octavia Squidington III <[email protected]>
  • Loading branch information
3 people authored Aug 3, 2022
1 parent 2a0c57b commit 76c4053
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- name: BigQuery
destinationDefinitionId: 22f6c74f-5699-40ff-833c-4a879ea40133
dockerRepository: airbyte/destination-bigquery
dockerImageTag: 1.1.13
dockerImageTag: 1.1.14
documentationUrl: https://docs.airbyte.io/integrations/destinations/bigquery
icon: bigquery.svg
resourceRequirements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
supported_destination_sync_modes:
- "overwrite"
- "append"
- dockerImage: "airbyte/destination-bigquery:1.1.13"
- dockerImage: "airbyte/destination-bigquery:1.1.14"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/destinations/bigquery"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ ENV ENABLE_SENTRY true

COPY --from=build /airbyte /airbyte

LABEL io.airbyte.version=1.1.13
LABEL io.airbyte.version=1.1.14
LABEL io.airbyte.name=airbyte/destination-bigquery
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.codepoetics.protonpack.StreamUtils;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.bigquery.BigQuery;
import com.google.cloud.bigquery.BigQueryOptions;
import com.google.cloud.bigquery.Job;
Expand Down Expand Up @@ -176,14 +175,14 @@ private static GoogleCredentials getServiceAccountCredentials(final JsonNode con
if (!BigQueryUtils.isUsingJsonCredentials(config)) {
LOGGER.info("No service account key json is provided. It is required if you are using Airbyte cloud.");
LOGGER.info("Using the default service account credential from environment.");
return ServiceAccountCredentials.getApplicationDefault();
return GoogleCredentials.getApplicationDefault();
}

// The JSON credential can either be a raw JSON object, or a serialized JSON object.
final String credentialsString = config.get(BigQueryConsts.CONFIG_CREDS).isObject()
? Jsons.serialize(config.get(BigQueryConsts.CONFIG_CREDS))
: config.get(BigQueryConsts.CONFIG_CREDS).asText();
return ServiceAccountCredentials.fromStream(
return GoogleCredentials.fromStream(
new ByteArrayInputStream(credentialsString.getBytes(Charsets.UTF_8)));
}

Expand Down
3 changes: 2 additions & 1 deletion docs/integrations/destinations/bigquery.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ Now that you have set up the BigQuery destination connector, check out the follo

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:-----------------------------------------------------------|:------------------------------------------------------------------------------------------------|
| 1.1.13 | 2022-00-02 | [15180](https://github.com/airbytehq/airbyte/pull/15180) | Fix standard loading mode |
| 1.1.14 | 2022-08-03 | [14784](https://github.com/airbytehq/airbyte/pull/14784) | Enabling Application Default Credentials |
| 1.1.13 | 2022-08-02 | [15180](https://github.com/airbytehq/airbyte/pull/15180) | Fix standard loading mode |
| 1.1.12 | 2022-08-02 | [14801](https://github.com/airbytehq/airbyte/pull/14801) | Fix multiply log bindings |
| 1.1.11 | 2022-06-24 | [14114](https://github.com/airbytehq/airbyte/pull/14114) | Remove "additionalProperties": false from specs for connectors with staging |
| 1.1.10 | 2022-06-16 | [13852](https://github.com/airbytehq/airbyte/pull/13852) | Updated stacktrace format for any trace message errors |
Expand Down

0 comments on commit 76c4053

Please sign in to comment.