Skip to content

Commit

Permalink
Added support of oAuth authentication (#118)
Browse files Browse the repository at this point in the history
Co-authored-by: nrodriguezmicrofocus <[email protected]>
Co-authored-by: nrodriguezmicrofocus <[email protected]>
  • Loading branch information
3 people authored Nov 30, 2023
1 parent 8b03263 commit 8ae11fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
12 changes: 7 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
### 1.6.0

#### Features:
- Added support for [`dbt-core version 1.6.0`](https://github.com/dbt-labs/dbt-core/discussions/7958) according to DBT guidelines.
- new `clone` command
- Droped support for Python 3.7
- Added support for [`dbt-core version 1.6.0`](https://github.com/dbt-labs/dbt-core/discussions/7958) according to DBT guidelines.
- Added support of oAuth authentication.
- New `clone` command.
- Droped support for Python 3.7.

#### Fixes:
- ensure support for revamped `dbt debug`
- new limit arg for `adapter.execute()`
- Ensure support for revamped `dbt debug`.
- New limit arg for `adapter.execute()`
- Configuring composite unique key for incremental merge or insert+update strategy
- Added new functional tests and parameterize them by overriding fixtures:
- TestIncrementalConstraintsRollback
- TestTableContractSqlHeader
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ For more information on using dbt with Vertica, consult the [Vertica-Setup](http

## dbt-vertica Versions Tested
dbt-vertica has been developed using the following software and versions:
* Vertica Server 12.0.3-0
* Vertica Server 23.4.0-0
* Python 3.11
* vertica-python client 1.3.1
* dbt-core 1.5.0
* dbt-tests-adapter 1.5.0
* dbt-core 1.6.0
* dbt-tests-adapter 1.6.0

## Supported Features
### dbt Core Features
Expand Down Expand Up @@ -56,6 +56,7 @@ your-profile:
username: [your username]
password: [your password]
database: [database name]
oauth_access_token: [access token]
schema: [dbt schema]
connection_load_balance: True
backup_server_node: [list of backup hostnames or IPs]
Expand All @@ -74,6 +75,7 @@ your-profile:
| username | The username to use to connect to the server. | Yes | None | dbadmin |
| password | The password to use for authenticating to the server. | Yes | None | my_password |
| database | The name of the database running on the server. | Yes | None | my_db |
| oauth_access_token | To authenticate via OAuth, provide an OAuth Access Token that authorizes a user to the database. | No | "" | Default: "" |
| schema | The schema to build models into. | No | None | VMart |
| connection_load_balance | A Boolean value that indicates whether the connection can be redirected to a host in the database other than host. | No | true | true |
| backup_server_node | List of hosts to connect to if the primary host specified in the connection (host, port) is unreachable. Each item in the list should be either a host string (using default port 5433) or a (host, port) tuple. A host can be a host name or an IP address. | No | none | ['123.123.123.123','www.abc.com',('123.123.123.124',5433)]
Expand Down
3 changes: 2 additions & 1 deletion dbt/adapters/vertica/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class verticaCredentials(Credentials):
ssl: bool = False
port: int = 5433
timeout: int = 3600
oauth_access_token: str = ""
withMaterialization: bool = False
ssl_env_cafile: Optional[str] = None
ssl_uri: Optional[str] = None
Expand Down Expand Up @@ -97,7 +98,7 @@ def open(cls, connection):
'connection_load_balance':credentials.connection_load_balance,
'session_label': f'dbt_{credentials.username}',
'retries': credentials.retries,

'oauth_access_token': credentials.oauth_access_token,
'backup_server_node':credentials.backup_server_node,

}
Expand Down
3 changes: 3 additions & 0 deletions dbt/include/vertica/profile_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ prompts:
type: 'int'
username:
hint: 'dev username'
oauth_access_token:
hint: 'access token'
default: ''
password:
hint: 'dev password'
hide_input: true
Expand Down
2 changes: 2 additions & 0 deletions dbt/include/vertica/sample_profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ default:
username: [dev_username]
password: [dev_password]
database: [dbname]
oauth_access_token: [access token]
schema: [dev_schema]
threads: [1 or more]
connection_load_balance: [True or False]
Expand All @@ -19,6 +20,7 @@ default:
username: [prod_username]
password: [prod_password]
database: [dbname]
oauth_access_token: [access token]
schema: [prod_schema]
threads: [1 or more]
connection_load_balance: [True or False]
Expand Down

0 comments on commit 8ae11fe

Please sign in to comment.