/opt/cloudlinux/venv/lib/python3.11/site-packages/wmt/common/__pycache__
NameSizeModeActions
config.cpython-311.opt-1.pyc130520644editdlrm
config.cpython-311.pyc130520644editdlrm
const.cpython-311.opt-1.pyc15530644editdlrm
const.cpython-311.pyc15530644editdlrm
exceptions.cpython-311.opt-1.pyc22000644editdlrm
exceptions.cpython-311.pyc22000644editdlrm
notification.cpython-311.opt-1.pyc165560644editdlrm
notification.cpython-311.pyc165560644editdlrm
report.cpython-311.opt-1.pyc105520644editdlrm
report.cpython-311.pyc105520644editdlrm
service.cpython-311.opt-1.pyc11570644editdlrm
service.cpython-311.pyc11570644editdlrm
url_parser.cpython-311.opt-1.pyc28940644editdlrm
url_parser.cpython-311.pyc28940644editdlrm
utils.cpython-311.opt-1.pyc104290644editdlrm
utils.cpython-311.pyc104290644editdlrm
__init__.cpython-311.opt-1.pyc3640644editdlrm
__init__.cpython-311.pyc3640644editdlrm
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/wmt/common/__pycache__/config.cpython-311.pyc (13052B)
§ ó«Sa1¬Éãó—ddlZddlZddlZddlZddlZddlmZmZmZddl m Z ddl m Z ddl mZmZddlmZddlmZeGd„d ¦«¦«Zejd ¦«Zeje¦«Zd Zd ZGd „d¦«ZdS)éN)ÚasdictÚ dataclassÚfield)Ú gethostname)Úget_admin_email)Ú CONFIG_PATHÚPING_CONNECTIONS)ÚWmtConfigException)Ú hostname_onlycó²—eZdZUdZdZeed<dZeed<eZ eed<dZ e ed<d Z eed <e e¬ ¦«Zee ed <d Zeed<dZeed<dZeed<dS)ÚCfgzC Default values, in case config has not been specified yet éÚ ping_intervalé Ú ping_timeoutÚping_connectionsNÚ report_emailéÚ report_top)Údefault_factoryÚ ignore_listTÚsummary_notification_enabledFÚalert_notifications_enabledÚallow_private_targets)Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚintÚ__annotations__rr rrÚstrrrÚlistrrÚboolrr©óú”/builddir/build/BUILDROOT/cl-web-monitoring-tool-3.2.7-1.el9.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/wmt/common/config.pyr r sÀ€€€€€ððð€M�3ÐÐÑØ€L�#ÐÐÑØ,Ð�cÐ,Ð,Ñ,Ø€L�#ÐÐÑØ€J�ÐÐÑØ"˜U°4Ð8Ñ8Ô8€K��c”Ð8Ð8Ñ8Ø)-Ð  $Ð-Ð-Ñ-Ø(-РÐ-Ð-Ñ-Ø"'И4Ð'Ð'Ñ'Ð'Ð'r%r z2\A[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+\Z)rrrr)rrrcóÜ—eZdZd„Zd„Zd„Zdefd„Zed„¦«Z ed„¦«Z de fd „Z ed „¦«Z d „Zed e d e defd„¦«Zed e defd„¦«Zdefd„Zdefd„ZdS)Ú ConfigManagercó4—tj ¦«|_dt ¦«›�|_t ¦«|_| ¦«|_ |  ¦«|_ |  ¦«|_ dS)Nzweb-monitoring-tool@)r Ú__dataclass_fields__ÚkeysÚallowed_paramsrÚ from_emailrÚdefault_report_emailÚ _init_cfgÚcfgÚgenerate_ignored_domainsÚ_ignored_domainsÚ_get_target_emailÚ target_email©Úselfs r&Ú__init__zConfigManager.__init__-s{€Ý!Ô6×;Ò;Ñ=Ô=ˆÔØ@µ±´Ð@Ð@ˆŒÝ$3Ñ$5Ô$5ˆÔ!à—>’>Ñ#Ô#ˆŒð!%× =Ò =Ñ ?Ô ?ˆÔØ ×2Ò2Ñ4Ô4ˆÔÐÐr%có@—|jjr |jjn|jS)a This function checks to see which email address to use for TO: field of smtp. If report_email has been defined by user then report_email will be used. By default (in case not defined by user) default_report_email will be used )r0rr.r5s r&r3zConfigManager._get_target_email8s!€ð )-¬Ô(=Ð\ˆtŒxÔ$Ð$À4ÔC\Ð\r%có*—t|j¦«S©N)rr0r5s r&Úto_dictzConfigManager.to_dict@s€Ý�d”hÑÔÐr%Úreturnc ó—| ¦«st¦«S| ¦«}t¦«}| ¦«D]«\}}||jvr3t  d|›dt|j¦«›�¦«ŒA | ||i¦«n@#t$r3}t  d|›dt›d|›d�¦«Yd}~Œ’d}~wwxYwt|||¦«Œ¬|S)Nzunsupported parameter "z:", please ensure config contains only allowed parameters: zignoring invalid value for "z" in z: z; using default) Ú is_presentr ÚreadÚitemsr,ÚloggerÚwarningr"Ú_validate_valuesr rÚsetattr)r6Údatar0ÚkeyÚvalueÚes r&r/zConfigManager._init_cfgCs:€à�ŠÑ Ô ð Ý‘5”5ˆLà�yŠy‰{Œ{ˆå‰eŒeˆØŸ*š*™,œ,ð %ð %‰JˆC�ؘ$Ô-Ð-Ð-Ý—’ðM¨cðMðMÝ15°dÔ6IÑ1JÔ1JðMðMñôððð Ø×%Ò% s¨E lÑ3Ô3Ð3Ð3øÝ%ð ð ð Ý—’Ði¸cÐiÐiÍ ÐiÐiÐWXÐiÐiÐiÑjÔjÐjØ����øøøøð øøøõ �C˜˜eÑ $Ô $Ð $Ð $àˆ sÂB3Â3 C0Â=)C+Ã+C0cóJ—tj t¦«Sr:)ÚosÚpathÚisfilerr$r%r&r>zConfigManager.is_presentcs€åŒw�~Š~�kÑ*Ô*Ð*r%cóÜ—| ¦«D]Ö\}}|tvr>t|t¦«rt|t¦«rt d|›d�¦«‚ŒL|t vr)t|t¦«st d|›d�¦«‚Œ~|dkrR|dvrŒ‰t|t¦«st d¦«‚t  |¦«st d¦«‚Œ×dS)Nú"z" must be an integerz " must be a boolean (true/false)r)NÚz"report_email" must be a stringz+"report_email" is not a valid email address) r@Ú_NUMERIC_FIELDSÚ isinstancerr#r Ú_BOOLEAN_FIELDSr!Ú _EMAIL_REÚmatch)rErFrGs r&rCzConfigManager._validate_valuesgs€àŸ*š*™,œ,ð \ð \‰JˆC�Ø•oÐ%Ð%Ý! %­Ñ-Ô-ðLµ¸EÅ4Ñ1HÔ1HðLÝ,Ð-J°Ð-JÐ-JÐ-JÑKÔKÐKðLà�Ð'Ð'õ" %­Ñ.Ô.ðXÝ,Ð-V°Ð-VÐ-VÐ-VÑWÔWÐWðXà˜Ò&Ð&ð˜JÐ&Ð&ØÝ! %­Ñ-Ô-ðPÝ,Ð-NÑOÔOÐOÝ —’ uÑ-Ô-ð\Ý,Ð-ZÑ[Ô[Ð[øð% \ð \r%Únew_jsoncó0— tj|¦«}n3#tj$r!}tt |¦«¦«‚d}~wwxYwt | ¦«¦« |j¦«s$tdt|j¦«›�¦«‚|  |¦«i|  ¦«¥|¥}|  d¦«rFt|  d¦«t¦«r|d d¦«|d<tt d¦«5}tj||d¬¦«ddd¦«n #1swxYwYt%di|¤Ž|_|  ¦«S) zÕ Changes configuration of wmt Returns: self.to_dict() Raises: WmtConfigException Example: wmt-api-solo --config-change {'key': 'val'} Nz@some of passed params are unsupported, only allowed parameters: rú,Úwr)Úindentr$)ÚjsonÚloadsÚJSONDecodeErrorr r!Úsetr+Úissubsetr,r"rCr;ÚgetrQÚsplitÚopenrÚdumpr r0)r6rUÚ new_configrHÚconfigÚfs r&ÚmodifyzConfigManager.modify}s¼€ð -Ýœ HÑ-Ô-ˆJˆJøÝÔ#ð -ð -ð -Ý$¥S¨¡V¤VÑ,Ô,Ð ,øøøøð -øøøõ�:—?’?Ñ$Ô$Ñ%Ô%×.Ò.¨tÔ/BÑCÔCð Ý$ØnÕSWÐX\ÔXkÑSlÔSlÐnÐnñôð ð ×Ò˜jÑ)Ô)Ð)à1�D—L’L‘N”NÐ1 jÐ1ˆà �:Š:�mÑ $Ô $ð E­°F·J²J¸}Ñ4MÔ4MÍsÑ)SÔ)Sð EØ$*¨=Ô$9×$?Ò$?ÀÑ$DÔ$DˆF�=Ñ !õ•+˜sÑ #Ô #ð + qÝ ŒI�f˜a¨Ð *Ñ *Ô *Ð *ð +ð +ð +ñ +ô +ð +ð +ð +ð +ð +ð +øøøð +ð +ð +ð +å�=�=˜�=�=ˆŒØ�|Š|‰~Œ~Ðs&‚—A¦AÁAÅE(Å(E,Å/E,cóð— tt¦«5}tj|¦«}ddd¦«n #1swxYwYn3#tj$r!}t t |¦«¦«‚d}~wwxYw|Sr:)rarrZÚloadr\r r!)rerErHs r&r?zConfigManager.read¡s°€ð -Ý•kÑ"Ô"ð $ aÝ”y ‘|”|�ð $ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $øøåÔ#ð -ð -ð -Ý$¥S¨¡V¤VÑ,Ô,Ð ,øøøøð -øøøàˆ s2‚A–7« A·;»A¾;¿AÁA3ÁA.Á.A3có8—| ¦«|_dSr:)r/r0r5s r&ÚreloadzConfigManager.reloadªs€Ø—>’>Ñ#Ô#ˆŒˆˆr%ÚpatternrGcóp—d|vr/| d¦«sd|›�}tj||¦«S||vS)z” Apply one ignore_list pattern to one value. If record contain *" then it will be processed as wildcard. Else as substring Ú*)Ú startswithÚfnmatch)rkrGs r&Ú_pattern_matcheszConfigManager._pattern_matches­sK€ð �'ˆ>ˆ>à×%Ò% cÑ*Ô*ð (Ø'˜g˜-˜-�Ý”? 5¨'Ñ2Ô2Ð 2ؘ%ÐÐr%cóL—t|¦«| ¦«kS)aý True when the pattern carries a hostname and nothing else, i.e. normalising it is a no-op. 'example.com' and '*.example.com' qualify; 'http://*', 'https://example.com/path' and 'example.com:8080' do not. A pattern hostname_only() cannot parse (e.g. the fnmatch character class '*.test[0-9].example.com') normalises to '' and so lands here as "not a hostname", which leaves it on verbatim-only matching -- exactly what it got before CLOS-6983. )r Úlower)rks r&Ú_is_hostname_patternz"ConfigManager._is_hostname_pattern»s€õ˜WÑ%Ô%¨¯ª©¬Ò8Ð8r%cóú—t|¦«}|jD]c}| ||¦«rdS|rF||kr@| |¦«r+| | ¦«|¦«rdSŒddS)aÉ Check if domain is in ignored list. Callers pass two shapes: the scanner passes 'http://host' (get_domains() runs every domain through url_parser.parse()), and report.py passes ScrapeResult.website, the post-redirect URL (scheme + trailing slash + path, sometimes a port). Matching is deliberately tried twice per pattern, and the verbatim attempt comes first. CLPRO-2619 supports ignoring *URLs*, not just domains, so a pattern carrying a scheme, path or port keeps being compared against the value exactly as passed -- reducing the value to a hostname first would break 'http://*', 'https://example.com' against '.../path', and 'https://*.example.com/*'. The second attempt exists for CLOS-6983: fnmatch() is end-anchored, so a hostname-only entry like '*.example.com' never matches the 'https://sub.example.com/' shape report.py passes. Both sides are lowercased there, since hostname_only() lowercases the value and fnmatch() is case-sensitive on POSIX. The second attempt is purely additive -- it cannot stop anything the first already matched. Keep it that way. TF)r r2rprsrr)r6ÚdomainÚhostrks r&Úis_domain_ignoredzConfigManager.is_domain_ignoredÉs˜€õ2˜VÑ$Ô$ˆØÔ,ð ð ˆGØ×$Ò$ W¨fÑ5Ô5ð Ø�t�tàð à˜F’N�NØ×-Ò-¨gÑ6Ô6ð#à×)Ò)¨'¯-ª-©/¬/¸4Ñ@Ô@ð#ð�t�tøØˆur%cój—t¦«}|jjD]}| |¦«Œ|S)z“ Generates ignored domains patterns from self.ignore_list and returns it for using as cache in self.ignored_domains set(). )r]r0rÚadd)r6Úpatternsrks r&r1z&ConfigManager.generate_ignored_domainsïs;€õ ‘5”5ˆØ”xÔ+ð "ð "ˆGØ �LŠL˜Ñ !Ô !Ð !Ð !؈r%N)rrrr7r3r;r r/Ú staticmethodr>rCr!rfr?rjr#rprsrwr]r1r$r%r&r(r(,sy€€€€€ð 5ð 5ð 5ð]ð]ð]ð ð ð ð˜3ððððð@ð+ð+ñ„\ð+ðð\ð\ñ„\ð\ð*"˜sð"ð"ð"ð"ðHððñ„\ðð$ð$ð$ðð   #ð  ¨cð  °dð  ð  ð  ñ„\ð  ðð 9 cð 9¨dð 9ð 9ð 9ñ„\ð 9ð$¨4ð$ð$ð$ð$ðL¨#ððððððr%r()rorZÚloggingrJÚreÚ dataclassesrrrÚsocketrÚclcommon.cpapirÚwmt.common.constrr Úwmt.common.exceptionsr Úwmt.common.url_parserr r ÚcompilerSÚ getLoggerrrArPrRr(r$r%r&úr†sPðØ€€€Ø € € € Ø€€€Ø € € € Ø € € € Ø0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0Ð0ØÐÐÐÐÐà*Ð*Ð*Ð*Ð*Ð*à:Ð:Ð:Ð:Ð:Ð:Ð:Ð:Ø4Ð4Ð4Ð4Ð4Ð4Ø/Ð/Ð/Ð/Ð/Ð/ð ð (ð (ð (ð (ð (ñ (ô (ñ „ð (ð& ˆBŒJÐLÑ MÔ M€ à ˆÔ ˜8Ñ $Ô $€àU€Øj€ðKðKðKðKðKñKôKðKðKðKr%