Skip to content

Commit 3dee56e

Browse files
committed
Fixed encryption when running outside an Application
Attempting to use a .cnxml file from an interpreter would crash with an invalid token message. It was because we always set a key in the dConnectInfo class, whether one was passed in or not, and setting the key to None resulted in a default value being assigned, which did not match the values used to encrypt the password originally.
1 parent 1d288e0 commit 3dee56e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dabo/db/connect_info.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ def __init__(self, connInfo=None, **kwargs):
6464
# Necessary when using this class outside of a Dabo application. See the docstring
6565
# for the dabo.application.Application.CryptoKey property for the format needed.
6666
self._encryption = Encryption()
67-
self._encryption.set_key(kwargs.get("crypto_key"))
67+
crypto_key = kwargs.get("crypto_key")
68+
if crypto_key is not None:
69+
self._encryption.set_key(kwargs.get("crypto_key"))
6870

6971
if connInfo:
7072
self.setConnInfo(connInfo)

0 commit comments

Comments
 (0)