관리-도구
편집 파일: __init__.cpython-311.pyc
� IMg�� � �T � d Z ddlZddlZddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZddlZddlZddlZddlmZmZ ddlmZmZmZ ddlmZmZ ddlmZ ddl m!Z! ddl"m#Z# dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z- dd l.m/Z/ ddl0m1Z1 ddl2m3Z3 dd l4m5Z5m6Z6m7Z7 ddl8m9Z9m:Z: ddl;m<Z< ddl=m>Z> e#e?� � Z@dZAdZBdZC ejD d� � ZEdZFdZGdZHdZI e jJ ZKe-eLeMeNeOde'eLe%f e)e% f ZP G d� deQ� � ZR G d� deQ� � ZSd� ZTde jU d eMd!e&fd"�ZVd!ePfd#�ZW e6eSeTeH�$� � d%eLd!ePfd&�� � ZXi d'�d%eLd(eNfd)�ZY e6eSeTeH�$� � d%eLd*eNd(eNd!eOfd+�� � ZZed,d-�d%eLd(eNfd.�� � Z[d/e&fd0�Z\ e6eSeTeH�$� � d,dd1�d%eLd2e jU d3eMd!eLfd4�� � Z] ed5d%d6g� � Z^d7e%d!e+e^ fd8�Z_d9� Z`eEfd:ejD d;ejD d!dfd<�Za G d=� d>� � ZbdDd?�Zcebjd Zeebjf Zf dEdAe*eL d!dfdB�ZgdC� ZhdS )FaP Utilities for managing local file storage synchronised with a remote server. Files are divided into types: signatures, modsecurity bundles, ip white lists, etc. Each type is represented by an Index instance. Index has a local subdirectory and a description that contains its files' metadata used to decide if the update is necessary. � N)�defaultdict� namedtuple)� ExitStack�suppress�contextmanager)� formatdate�parsedate_to_datetime)�GzipFile)�chain)� getLogger) �Any�BinaryIO�Dict�Iterable�List�Optional�Set�Tuple�Union)�urlparse)�config)� LicenseCLN)� file_hash�retry_on�run_with_umask)� rate_limit�HOUR)� to_thread� )�default_hook�eula�sigszrealtime-av-confz/var/imunify360/filesz$https://files.imunify360.com/static/i � � g�������?c � � e Zd ZdZdS )�IntegrityErrorzERaised when on disk content does not match hashes in description.jsonN��__name__� __module__�__qualname__�__doc__� � �S/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/files/__init__.pyr% r% R s � � � � � �O�O�O�Or, r% c � � e Zd ZdZdS )�UpdateErrora Raised on other errors during files update. Possible reasons are: * server returns non 200 status; * hash mismatched between downloaded content and description.json; * urllib errors; * JSON decoding errors; * errors while writing to disk. Nr&