-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADAP-882] [Feature] Allow base64-service-account-json key auth #923
Comments
Thanks for this suggestion @ismailsimsek ! Currently, there are two service account methods available in dbt-bigquery:
Did you already see the second method? Assuming so, how would you imagine your suggestion being implemented? Here's the relevant code within dbt-bigquery that interfaces with BigQuery: dbt-bigquery/dbt/adapters/bigquery/connections.py Lines 330 to 336 in 27ade3d
Here are the BigQuery docs for the two different methods:
|
@dbeatty10 from dbt side, this should work: # new method
elif method == BigQueryConnectionMethod.SERVICE_ACCOUNT_BASE64_JSON:
sa_json_base64 = profile_credentials.keyfile_base64_json
sa_json_content = base64.b64decode(details_base64.encode("utf-8")).decode("utf-8")
return creds.from_service_account_info(info=sa_json_content) from bigquery lib this method could be used def from_service_account_info(cls, info, **kwargs): |
What do you think of this @dataders ? The proposal is to add a third method named
Two alternatives to consider:
|
@dbeatty10 I support this. In fact, I'd love to mainstream key handling into the default implementation. imo, a single implementation reduces risk. Happy to accept a PR adding support for In a larger theme of authentication, I'd love to handle token handling as it related to cloud providers such as AWS and Azure. dbt-labs/dbt-postgres#14 is one example and MSFT adapter family token-handling (source) is another. |
I saw this issue and was wondering if you would accept a reimplementation of I can implement an
Then a simple if-else will decode the base64 or leave the string as is.
|
PR has been submitted for review. @dataders |
Is this your first time submitting a feature request?
Describe the feature
Allow setting gcp service account as base64 value. currently it only supports setting file path. it should be possible to set base64 SA value using environment variable.
similar to dbt-labs/dbt-snowflake#436
implementation dbt-labs/dbt-snowflake#292
dbt-labs/dbt-core#6018
Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: