Q'(L1dZddlZddlmZddlmZmZddlmZm Z ddl m Z ddl m Z mZddlmZeeefZejeZGd d eZdS) 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)Any) MessageType ServerConfig) MessageSinkexpect)Scope)get_imunify_patch_idget_imunify_patch_purchase_url) HostingPanelceZdZejZejjZ dZ e e j de de fdZdedefdZdS)$EnrichServerConfigWithImunifyPatchIdc KdSN)selfloops R/opt/imunify360/venv/lib/python3.11/site-packages/imav/plugins/imunify_patch_id.py create_sinkz0EnrichServerConfigWithImunifyPatchId.create_sink-s  messagereturncKd|vr |d}n0dtd{VD}fd|Dd{V|d<|S)Nuserscg|]}d|iS)usernamer).0users r zMEnrichServerConfigWithImunifyPatchId.enrich_server_config..7s*'+T"rcJKg|]}|d{VSr)_enrich_user_data)rrrs rrzMEnrichServerConfigWithImunifyPatchId.enrich_server_config..;sJ   37$((.. . . . . . .   r)r get_users)rrrs` renrich_server_configz9EnrichServerConfigWithImunifyPatchId.enrich_server_config0s g  G$EE5A^^5M5M5O5O/O/O/O/O/O/OE    ;@         rrcKd|vrtd||St|dd{V|d<t|dd{V|d<|S)Nrz)User data missing 'username' field: user=imunify_patch_user_idimunify_patch_purchase_url)loggerwarningr r )rrs rr z6EnrichServerConfigWithImunifyPatchId._enrich_user_dataAs T ! ! NNI$II J J JK.B  / / ) ) ) ) ) )  $% 1j1ABB B B B B B B (  rN)__name__ __module__ __qualname__rAV_IM360SCOPErProcessingOrderPRE_PROCESS_MESSAGEPROCESSING_ORDERrrrrr"UserDatar rrrr r )s NE"2F    VK $%%# &% H       rr )__doc__loggingtypingr"defence360agent.contracts.messagesrr!defence360agent.contracts.pluginsrrdefence360agent.utilsrimav.contracts.imunify_patch_idr r +defence360agent.subsys.panels.hosting_panelr dictstrr0 getLoggerr(r&r rrrr<s*HHHHHHHH('''''EDDDDD S>  8 $ $""""";"""""r