Skip to content

Commit

Permalink
GenerixSQL: update docker image with cryptography (#34754)
Browse files Browse the repository at this point in the history
* add cryptography

* Empty-Commit to trigger build

* workarond for freetds-1.1.39

---------

Co-authored-by: sapirshuker <[email protected]>
  • Loading branch information
ilappe and sapirshuker authored Dec 19, 2024
1 parent 6589ea1 commit 9c06eb3
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docker/genericsql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libc-dev \
libssl-dev \
unixodbc-dev \
&& wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.1.39.tar.gz \
# && wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.1.39.tar.gz \
&& wget --no-check-certificate https://www.freetds.org/files/stable/freetds-1.1.39.tar.gz \
&& tar -xzf freetds-1.1.39.tar.gz \
&& cd freetds-1.1.39 \
&& ./configure --with-openssl --with-unixodbc=/usr --enable-msdblib \
Expand Down
1 change: 1 addition & 0 deletions docker/genericsql/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ psycopg2-binary = "*"
pyodbc = "*"
cx-oracle = "*"
expiringdict = "*"
cryptography = "*"

[requires]
python_version = "3.11"
197 changes: 195 additions & 2 deletions docker/genericsql/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion docker/genericsql/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import psycopg2
import cx_Oracle
import teradatasqlalchemy
import pymysql

assert 'FreeTDS' in pyodbc.drivers()
assert 'ODBC Driver 18 for SQL Server' in pyodbc.drivers(), pyodbc.drivers()
Expand All @@ -15,7 +16,6 @@
except Exception as ex:
assert 'ORA-12162' in str(ex)


# freetds test
engine = sqlalchemy.create_engine('mssql+pyodbc:///testuser:[email protected]:1433/TEST?driver=FreeTDS')
try:
Expand All @@ -26,4 +26,11 @@
# teradata test: raises sqlalchemy.exc.NoSuchModuleError if the plugin is not installed
eng = sqlalchemy.create_engine('teradatasql://guest:foo@bar')

# test there no missing 'cryptography' module
try:
pymysql._auth.sha2_rsa_encrypt(b'test', b'test', 'test')
except TypeError as ex:
assert "argument 'data': from_buffer() cannot return the address of a unicode object" in str(ex)


print("All is good. All imported successfully")

0 comments on commit 9c06eb3

Please sign in to comment.