예제 #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"],
                ])
예제 #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()
예제 #3
0
    def _result_processor(self, value):
        if value is None:
            return None

        return decrypt(value) if value else ''
예제 #4
0
 def _result_processor(self, value):
     return decrypt(value) if value else ''
예제 #5
0
 def pwenc_decrypt(self, encrypted=None):
     if not encrypted:
         return ""
     return decrypt(encrypted)
예제 #6
0
파일: notifier.py 프로젝트: freenas/freenas
 def pwenc_decrypt(self, encrypted=None):
     if not encrypted:
         return ""
     return decrypt(encrypted)