Exemplo n.º 1
0
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"],
                ])
Exemplo n.º 2
0
 def _result_processor(self, value):
     try:
         if self.encrypted:
             value = decrypt(value, _raise=True)
         return json.loads(value)
     except Exception:
         return self.type()
Exemplo n.º 3
0
    def _result_processor(self, value):
        if value is None:
            return None

        return decrypt(value) if value else ''
Exemplo n.º 4
0
 def _result_processor(self, value):
     return decrypt(value) if value else ''
Exemplo n.º 5
0
 def pwenc_decrypt(self, encrypted=None):
     if not encrypted:
         return ""
     return decrypt(encrypted)
Exemplo n.º 6
0
 def pwenc_decrypt(self, encrypted=None):
     if not encrypted:
         return ""
     return decrypt(encrypted)