|e>kQ7 d Z ddlZddlZddlZddlZddlZddlZddlZddl Z ddlZ ddlZddl mZ ej e ZdZej dd Ze d dz Zej d d ZdZdZd Z G d d ZdefdZ G d d Z e Z ej! e j" e Z#dS )u Lightweight message status publisher for asyncclient. Publishes MESSAGE_STATUS events to the local proxy which relays them to the EMQX broker via MQTT. Each call to report() submits an HTTP POST to a thread pool — no batching or internal queue. Usage:: publisher = MessageStatusPublisher() message_id_gen = Gen() msg = {...} message_id_gen.enrich(msg) # adds message_reporter_id / message_reporter_increment publisher.report(msg, reporter_id_gen) N) is_enabledz/var/imunify360/iaidIMUNIFY_PROXY_URLzhttp://127.0.0.1:11234/z/api/v1/mqtt-publishIMUNIFY_PROXY_API_KEY c 6 e Zd ZdZddZdefdZdeddfdZdS ) Genz_ID + monotonic counter generator. Each instance has its own UUID and its own counter. returnNc ~ t j j | _ d| _ t j | _ d S )Nr )uuiduuid4hexid_counter threadingLock_lockselfs g/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/internals/message_status_publisher.py__init__zGen.__init__: s, *,," ^%% c v | j 5 | j }| xj dz c_ |cd d d S # 1 swxY w Y d S )N )r r )r values r _nextz Gen._next? s Z MEMMQMM s .22msgc H | j |d<