def upgrade(): conn = op.get_bind() for row in conn.execute("SELECT * FROM directoryservice_ldap").fetchall(): if row["ldap_binddn"] and decrypt(row["ldap_binddn"]): # New (>= 12.0) configurations have ldap_binddn erroneously encrypted instead of ldap_bindpw # due to fd623d849d1abee8c5786128b150e92209ba1f69 conn.execute( "UPDATE directoryservice_ldap SET ldap_binddn = ?, ldap_bindpw = ? WHERE id = ?", [ decrypt(row["ldap_binddn"]), encrypt(row["ldap_bindpw"]), row["id"], ])
def _result_processor(self, value): try: if self.encrypted: value = decrypt(value, _raise=True) return json.loads(value) except Exception: return self.type()
def _result_processor(self, value): if value is None: return None return decrypt(value) if value else ''
def _result_processor(self, value): return decrypt(value) if value else ''
def pwenc_decrypt(self, encrypted=None): if not encrypted: return "" return decrypt(encrypted)