HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib/python3.10/site-packages/kombu/utils/__pycache__/url.cpython-310.pyc
o

'we��@s�dZddlmZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
zddlZdZWney9d	ZYnwd
dlmZeedd
�Zee�ZGdd�de�Zdd�Zdd�ZeZ		ddd�Zddd�Zddd�Zdd�ZdS)zURL Utilities.�)�annotations)�Mapping)�partial)�
NamedTuple)�	parse_qsl�quote�unquote�urlparseNTF�)�
get_logger�)�safec@sJeZdZUdZded<ded<ded<ded<ded<ded	<d
ed<dS)
�urlpartsz*Named tuple representing parts of the URL.�str�scheme�hostname�int�port�username�password�pathr�queryN)�__name__�
__module__�__qualname__�__doc__�__annotations__�rr�H/home/arjun/projects/env/lib/python3.10/site-packages/kombu/utils/url.pyrs
rc
	Cs�t|�\}}}}}}}|rEdd�|��D�}|D],}	|	dkr1t||	�||	<||	dur1t�d�d|vr9i|d<||	|d|	<||	=qtd||||||d�|��S)	z%Parse URL into mapping of components.cSsg|]	}|�d�r|�qS)�ssl_)�
startswith)�.0�keyrrr�
<listcomp>(szparse_url.<locals>.<listcomp>�
ssl_cert_reqsNz%Defaulting to insecure SSL behaviour.�ssl)�	transportrr�useridr�virtual_hostr)�
_parse_url�keys�parse_ssl_cert_reqs�logger�warning�dict)
�urlr�hostr�userrrrr*r"rrr�	parse_url#s$
��r2c
Cs�t|�j}|t|�dd�}td|�}|jpd}|r(|ddkr(|dd�n|}t|t|jp1d�p4d|jt|jp;d�p>dt|j	pCd�pFdt|pJd�pMdt
t|j���S)z5Parse URL into :class:`urlparts` tuple of components.�Nzhttp://rr�/�)
r	r�lenrrrrrrrr.rr)r/r�
schemeless�partsrrrr�url_to_parts:s

 �r9�**c	
Cs�|�d�g}	|s
|r2|r|	�t|��|r-|r$|	�|rd|gndg�n	|	�dt|�g�|	�d�|	�|r:t|�nd�|rF|	�d|g�|	�d|g�d�dd�|	D��S)z"Generate URL from component parts.�://�:�@rr4css�|]	}|rt|�VqdS)N)r)r!�partrrr�	<genexpr>cs�zas_url.<locals>.<genexpr>)�append�	safequote�extend�join)
rr0rr1rrr�sanitize�maskr8rrr�as_urlQs
rFcCstt|�d|d��S)z)Return copy of URL with password removed.T)rDrE)rFr)�r/rErrr�sanitize_urlfsrHcCs t|t�rd|vrt||�S|S)z-Sanitize url, or do nothing if url undefined.r;)�
isinstancerrHrGrrr�maybe_sanitize_urlls
rJcCs.trtjtjtjtjtjtjd�}||SdS)zMGiven the query parameter for ssl_cert_reqs, return the SSL constant or None.)�
CERT_REQUIRED�
CERT_OPTIONAL�	CERT_NONE�required�optional�noneN)�
ssl_availabler%rKrLrM)�query_value�query_value_to_constantrrrr+ts�r+)NNNNNNFr:)r:)r�
__future__r�collections.abcr�	functoolsr�typingr�urllib.parserrrr	r%rQ�ImportError�logrrArr,rr2r9r)rFrHrJr+rrrr�<module>s2�
�