From 91b058977f8680b6f15b7970fef6e4c6d38d124b Mon Sep 17 00:00:00 2001 From: Peter Kioko Date: Wed, 31 May 2023 11:05:14 -0400 Subject: [PATCH] Add OIDC auth support This allows authentication with Exasol by specifying either an OIDC access_token or refresh_token in the dbt profiles.yml config (instead of user+password) --- dbt/adapters/exasol/connections.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dbt/adapters/exasol/connections.py b/dbt/adapters/exasol/connections.py index 806292c..71263ef 100644 --- a/dbt/adapters/exasol/connections.py +++ b/dbt/adapters/exasol/connections.py @@ -70,10 +70,13 @@ class ExasolCredentials(Credentials): """Profile parameters for Exasol in dbt profiles.yml""" dsn: str - user: str - password: str database: str schema: str + # One of user+pass, access_token, or refresh_token needs to be specified in profiles.yml + user: str = "" + password: str = "" + access_token: str = "" + refresh_token: str = "" # optional statements that can be set in profiles.yml # some options might interfere with dbt, so caution is advised connection_timeout: int = pyexasol.constant.DEFAULT_CONNECTION_TIMEOUT @@ -193,6 +196,8 @@ def _connect(): dsn=credentials.dsn, user=credentials.user, password=credentials.password, + access_token=credentials.access_token, + refresh_token=credentials.refresh_token, autocommit=True, connection_timeout=credentials.connection_timeout, socket_timeout=credentials.socket_timeout,