Teradata / PyTd

A Python Module to make it easy to script powerful interactions with Teradata Database in a DevOps friendly way.
MIT License
108 stars 43 forks source link

Teradata Wallet using tdrest does not work #56

Closed AmeerHamzaJamil closed 7 years ago

AmeerHamzaJamil commented 7 years ago

Python: 3.5.1 PyTd: 15.10.0.18 Teradata: 14.10

Teradata Wallet works with Teradata ODBC Module: from teradata import tdodbc ODBCConnection = tdodbc.connect(system='TDSystem', username='TDUser', password='$tdwallet(TDWalletKey)')

But, it does not work with Teradata REST Module: from teradata import tdrest RESTConnection = tdrest.connect(host='TDHostName', system='TDSystem', username='TDUser', password='$tdwallet(TDWalletKey)')

NOTE: Teradata REST API is set up on the 'TDHostName' host and returns data using: from teradata import tdrest RESTConnection = tdrest.connect(host='TDHostName', system='TDSystem', username='TDUser', password='TDPassword')

Additionally, Teradata Wallet is set up on the 'TDHostName' host machine.

How can we use Teradata REST API along with Teradata Wallet to connect to Teradata?

escheie commented 7 years ago

Currently Teradata Wallet is not supported for REST connections. Its actually the ODBC driver that interfaces with Teradata Wallet and not the Python module directly which is why this functionality is not available for REST. Also, the thought was if Teradata Wallet is installed then ODBC could also be installed, so there isn't a strong reason to use REST in this scenario.

Is there a reason you want to install Teradata Wallet but not Teradata ODBC for use with the Python Module?

AmeerHamzaJamil commented 7 years ago

The environment (Cloud Foundry), in which the Python Application will run, is not compatible with Teradata ODBC.

I believe PyTd team is already looking into the issue of Connecting from Python to Teradata through Teradata ODBC in Cloud Foundry, as stated in the last few comments of the following issue: https://github.com/Teradata/PyTd/issues/43

However, for now, we have decided to use Teradata REST API to connect to Teradata.

Do you think that Teradata Wallet and/or PyTd team(s) will be open to making changes so Teradata Wallet is supported for REST connections?

escheie commented 7 years ago

After following up with the tdwallet team, it is not actually possible to support tdwallet with REST. The API for accessing a password from tdwallet is intentionally private and only accessible to Teradata clients such as ODBC. Access from a Python program cannot be implemented without exposing the API and therefore would make it possible for malware running as the user to access secrets from tdwallet.

AmeerHamzaJamil commented 7 years ago

Ah, yes, that makes sense. We will either try to work with Teradata ODBC or use Teradata REST API with an alternative to Teradata Wallet.

Thank you for your efforts and following up with the TDWallet team.