h dZddlZddlmZddlmZddlmZddlm Z ddl m Z m Z ddl mZmZejeZGd d e ZdS) u  This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program.  If not, see . Copyright © 2019 Cloud Linux Software Inc. This software is also available under ImunifyAV commercial license, see N) defaultdict)Iterable)urljoin)Request)APIAPIError)IAIDTokenErrorIndependentAgentIDAPIc`eZdZeejdZddddddZede de fdZ dS)VulnerabilityAPIz/api/patch/vulnerabilities)cveIdapptypenameseverityidsreturnc"Kt|jj}|s|S tjd{V}n4#t $r'}t d||cYd}~Sd}~wwxYw|jdd |z}t||dd} | |d{V}n4#t$r'}t d||cYd}~Sd}~wwxYw| |d |S) zc Get vulnerabilities details for specific *ids*. More details in DEF-32152 NzACan't get iaid token: %s. Return default vulnerabilities details.z?ids=,zapplication/json)zX-Authz Content-Type)headerszRFailed to get vulnerabilities details: %s. Return default vulnerabilities details.vulnerabilities)r_STUB_VULNERABILITY_INFOcopyr get_tokenr loggererrorURLjoinr async_requestrupdate)clsrinfotokenexcurlrequestresults V/opt/imunify360/venv/lib/python3.11/site-packages/imav/malwarelib/api/vulnerability.py get_detailszVulnerabilityAPI.get_details/sz 37<== K /9;;;;;;;;EE    LL:    KKKKKK  g/ /// $6HII    ,,W55555555FF    LL:    KKKKKK   F,-... s9; A,A'!A,'A,$C C1 C,&C1,C1N) __name__ __module__ __qualname__rr _BASE_URLrr classmethodrdictr*r)r r %sr '#-!= > >C   #H####[###r2r )__doc__logging collectionsrtypingr urllib.parserurllib.requestrdefence360agent.api.serverrrdefence360agent.internals.iaidr r getLoggerr+rr r1r2r)r<s*###### """"""44444444  8 $ $.....s.....r2