Fix Credentials sent via env (#9071)

* Fix Credentials sent via env

* add new env var

* fix lint

* Add Comment
This commit is contained in:
Ayush Shah 2022-11-30 20:07:24 +05:30 committed by GitHub
parent 42fe8617f6
commit 2b2eadf611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -67,6 +67,7 @@ jobs:
env:
E2E_TEST: ${{ matrix.e2e-test }}
E2E_BQ_PROJECT_ID: ${{ secrets.E2E_BQ_PROJECT_ID }}
E2E_BQ_PRIVATE_KEY: ${{ secrets.E2E_BQ_PRIVATE_KEY }}
run: |
source env/bin/activate
python -m pytest -c ingestion/setup.cfg ingestion/tests/cli_e2e/test_cli_$E2E_TEST.py

View File

@ -77,6 +77,8 @@ def build_google_credentials_dict(gcs_values: GCSValues) -> Dict[str, str]:
:return: Dictionary with credentials
"""
private_key_str = gcs_values.privateKey.get_secret_value()
# adding the replace string here to escape line break if passed from env
private_key_str = private_key_str.replace("\\n", "\n")
validate_private_key(private_key_str)
return {

View File

@ -11,7 +11,7 @@ source:
type: service_account
projectId: $E2E_BQ_PROJECT_ID
privateKeyId: $CYPRESS_BQ_PRIVATE_KEY_ID
privateKey: $CYPRESS_BQ_PRIVATE_KEY
privateKey: $E2E_BQ_PRIVATE_KEY
clientEmail: $CYPRESS_BQ_CLIENT_EMAIL
clientId: $CYPRESS_BQ_CLIENT_ID
sourceConfig: