$99 GRAYBYTE WORDPRESS FILE MANAGER $46

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model/

HOME
Current File : /opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/model//tls_check.py
import logging
import threading

from playhouse.sqlite_ext import SqliteExtDatabase


class OverridingReset(Exception):
    """
    Overriding reset could be a signal of logic error
    thus need to be explicitly handled in all places where
    this exception is expected to occur.
    """

    pass


logger = logging.getLogger(__name__)
_thread_local_storage = threading.local()


class SqliteDatabaseWrapper(SqliteExtDatabase):
    def execute_sql(self, *args, **kwargs):
        _validate(*args, **kwargs)
        return super().execute_sql(*args, **kwargs)


def reset(new_value=None):
    if hasattr(_thread_local_storage, "thread_ident_memo"):
        raise OverridingReset()

    _thread_local_storage.thread_ident_memo = (
        new_value or threading.get_ident()
    )


def _validate(*args, **kwargs):
    thread_ident_memo = getattr(
        _thread_local_storage, "thread_ident_memo", None
    )

    if thread_ident_memo is None:
        logger.error("wrong thread or _validate() was not preceded by reset()")

    elif thread_ident_memo != threading.get_ident():
        logger.error(
            "thread_ident_memo check failed [%r != %r]\n"
            "context:\nargs: %s\nkwargs: %s",
            thread_ident_memo,
            threading.get_ident(),
            args,
            kwargs,
        )


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2026 8.45 AM
root / root
0755
__pycache__
--
3 Mar 2026 8.45 AM
root / root
0755
__init__.py
0.94 KB
23 Jan 2026 1.13 PM
root / root
0644
analyst_cleanup.py
3.401 KB
23 Jan 2026 1.13 PM
root / root
0644
event_hook.py
1.741 KB
23 Jan 2026 1.13 PM
root / root
0644
icontact.py
1.155 KB
23 Jan 2026 1.13 PM
root / root
0644
infected_domain.py
4.236 KB
23 Jan 2026 1.13 PM
root / root
0644
instance.py
0.523 KB
23 Jan 2026 1.13 PM
root / root
0644
messages_to_send.py
1.371 KB
23 Jan 2026 1.13 PM
root / root
0644
simplification.py
5.013 KB
23 Jan 2026 1.13 PM
root / root
0644
tls_check.py
1.289 KB
23 Jan 2026 1.13 PM
root / root
0644
wordpress_incident.py
13.016 KB
23 Jan 2026 1.13 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF