Skip to content

Commit

Permalink
Revert "Prefix secrets with DBT_ENV_SECRET_ for test env vars (#995)" (
Browse files Browse the repository at this point in the history
…#1012)

This reverts commit 5a4f958.
  • Loading branch information
mikealfare authored May 1, 2024
1 parent cd2e838 commit a6c6e5e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 26 deletions.
6 changes: 0 additions & 6 deletions .changes/unreleased/Under the Hood-20240425-153022.yaml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ jobs:
if: matrix.adapter == 'snowflake'
env:
SNOWFLAKE_TEST_ACCOUNT: ${{ secrets.SNOWFLAKE_TEST_ACCOUNT }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
SNOWFLAKE_TEST_PASSWORD: ${{ secrets.SNOWFLAKE_TEST_PASSWORD }}
SNOWFLAKE_TEST_USER: ${{ secrets.SNOWFLAKE_TEST_USER }}
SNOWFLAKE_TEST_WAREHOUSE: ${{ secrets.SNOWFLAKE_TEST_WAREHOUSE }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN: ${{ secrets.SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_ID: ${{ secrets.SNOWFLAKE_TEST_OAUTH_CLIENT_ID }}
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET: ${{ secrets.SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET }}
SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN: ${{ secrets.SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN }}
SNOWFLAKE_TEST_OAUTH_CLIENT_ID: ${{ secrets.SNOWFLAKE_TEST_OAUTH_CLIENT_ID }}
SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET: ${{ secrets.SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET }}
SNOWFLAKE_TEST_ALT_DATABASE: ${{ secrets.SNOWFLAKE_TEST_ALT_DATABASE }}
SNOWFLAKE_TEST_ALT_WAREHOUSE: ${{ secrets.SNOWFLAKE_TEST_ALT_WAREHOUSE }}
SNOWFLAKE_TEST_DATABASE: ${{ secrets.SNOWFLAKE_TEST_DATABASE }}
Expand Down
6 changes: 3 additions & 3 deletions scripts/werkzeug-refresh-token.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def _make_response(client_id, client_secret, refresh_token):
return Response(
textwrap.dedent(
f'''\
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN="{refresh_token}"
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_ID="{client_id}"
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET="{client_secret}"'''
SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN="{refresh_token}"
SNOWFLAKE_TEST_OAUTH_CLIENT_ID="{client_id}"
SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET="{client_secret}"'''
)
)

Expand Down
16 changes: 8 additions & 8 deletions test.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# SNOWFLAKE_TEST_ALT_DATABASE: Name of a secondary or alternate database to use for testing. You will need to create this database.
# SNOWFLAKE_TEST_ALT_WAREHOUSE: Name of the secondary warehouse to use for testing.
# SNOWFLAKE_TEST_DATABASE: Name of the primary database to use for testing.
# DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_ID: Client ID of the OAuth client integration. (only for oauth authentication)
# DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET: Client secret of your OAuth client id. (only for oauth authentication)
# DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN: Boolean value defaulted to True keep connection alive. (only for oauth authentication)
# DBT_ENV_SECRET_SNOWFLAKE_TEST_PASSWORD:Password used for your database user.
# SNOWFLAKE_TEST_OAUTH_CLIENT_ID: Client ID of the OAuth client integration. (only for oauth authentication)
# SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET: Client secret of your OAuth client id. (only for oauth authentication)
# SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN: Boolean value defaulted to True keep connection alive. (only for oauth authentication)
# SNOWFLAKE_TEST_PASSWORD:Password used for your database user.
# SNOWFLAKE_TEST_QUOTED_DATABASE: Name of database to be used from warehouse.
# SNOWFLAKE_TEST_USER: Username of database user
# SNOWFLAKE_TEST_WAREHOUSE: Warehouse name to be used as primary.
Expand All @@ -22,10 +22,10 @@ SNOWFLAKE_TEST_ACCOUNT=my_account_id
SNOWFLAKE_TEST_ALT_DATABASE=my_alt_database_name
SNOWFLAKE_TEST_ALT_WAREHOUSE=my_alt_warehouse_name
SNOWFLAKE_TEST_DATABASE=my_database_name
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_ID=my_oauth_id
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET=my_oauth_secret
DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN=TRUE
DBT_ENV_SECRET_SNOWFLAKE_TEST_PASSWORD=my_password
SNOWFLAKE_TEST_OAUTH_CLIENT_ID=my_oauth_id
SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET=my_oauth_secret
SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN=TRUE
SNOWFLAKE_TEST_PASSWORD=my_password
SNOWFLAKE_TEST_QUOTED_DATABASE=my_quoted_database_name
SNOWFLAKE_TEST_USER=my_username
SNOWFLAKE_TEST_WAREHOUSE=my_warehouse_name
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def dbt_profile_target():
"threads": 4,
"account": os.getenv("SNOWFLAKE_TEST_ACCOUNT"),
"user": os.getenv("SNOWFLAKE_TEST_USER"),
"password": os.getenv("DBT_ENV_SECRET_SNOWFLAKE_TEST_PASSWORD"),
"password": os.getenv("SNOWFLAKE_TEST_PASSWORD"),
"database": os.getenv("SNOWFLAKE_TEST_DATABASE"),
"warehouse": os.getenv("SNOWFLAKE_TEST_WAREHOUSE"),
}
6 changes: 3 additions & 3 deletions tests/functional/oauth/test_oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def dbt_profile_target(self):
"threads": 4,
"account": os.getenv("SNOWFLAKE_TEST_ACCOUNT"),
"user": os.getenv("SNOWFLAKE_TEST_USER"),
"oauth_client_id": os.getenv("DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_ID"),
"oauth_client_secret": os.getenv("DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET"),
"token": os.getenv("DBT_ENV_SECRET_SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN"),
"oauth_client_id": os.getenv("SNOWFLAKE_TEST_OAUTH_CLIENT_ID"),
"oauth_client_secret": os.getenv("SNOWFLAKE_TEST_OAUTH_CLIENT_SECRET"),
"token": os.getenv("SNOWFLAKE_TEST_OAUTH_REFRESH_TOKEN"),
"database": os.getenv("SNOWFLAKE_TEST_DATABASE"),
"warehouse": os.getenv("SNOWFLAKE_TEST_WAREHOUSE"),
"authenticator": "oauth",
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ skip_install = true
passenv =
DBT_*
SNOWFLAKE_TEST_*
DBT_ENV_SECRET_SNOWFLAKE_TEST_*
PYTEST_ADDOPTS
DD_CIVISIBILITY_AGENTLESS_ENABLED
DD_API_KEY
Expand Down

0 comments on commit a6c6e5e

Please sign in to comment.