Exemplo n.º 1
0
    def _initialize_fernet_key(cls):
        db_session = Database.create_session()

        try:
            password_encryption_key_setting = DatabaseAccess.query_setting(
                db_session, 'password_encryption_key')

            if password_encryption_key_setting is not None:
                fernet_key = password_encryption_key_setting.value.encode()
                cls._fernet = Fernet(fernet_key)
        finally:
            db_session.close()
Exemplo n.º 2
0
 def query_setting(cls, db_session, setting_name):
     return DatabaseAccess.query_setting(db_session, setting_name)