o
    @Bi                     @   s\   d dl mZ zd dlmZ W n ey   d dlmZ Y nw dZdd Zdd Zdd	 Z	d
S )    )absolute_import)sleep)r   peer2strtransport_channel_idc                 C   sF   |dvrt d|| d}|du rdS t|dr!|jddS dS )aq  
    Application-layer user authentication protocols are vulnerable to generic
    credential forwarding attacks, where an authentication credential sent by
    a client C to a server M may then be used by M to impersonate C at another
    server S. To prevent such credential forwarding attacks, modern authentication
    protocols rely on channel bindings. For example, WAMP-cryptosign can use
    the tls-unique channel identifier provided by the TLS layer to strongly bind
    authentication credentials to the underlying channel, so that a credential
    received on one TLS channel cannot be forwarded on another.

    )
tls-uniquezinvalid channel ID type {}
ssl_objectNget_channel_bindingr   )cb_type)	Exceptionformatget_extra_infohasattrr   )	transport	is_serverchannel_id_typessl_obj r   U/var/www/html/Trade-python/venv/lib/python3.10/site-packages/autobahn/asyncio/util.pyr   +   s   

r   c                 C   sR   t | trt| dkrdnd}d| d | d |S t | tr$d| S d| S )	N         ztcp{2}:{0}:{1}r      zunix:{0}z?:{0})
isinstancetuplelenr   str)peerip_verr   r   r   r   C   s   



r   c                     s8   ddl m  g d} ttdd t fdd| } | S )Nr   
serializer)CBORSerializerMsgPackSerializerUBJSONSerializerJsonSerializerc                 S   s   | S Nr   )xr   r   r   <lambda>Q   s    z!get_serializers.<locals>.<lambda>c                    s   t  | r
t | S d S r$   )r   getattr)sr   r   r   r&   Q   s    )autobahn.wampr   listfiltermap)serializersr   r   r   get_serializersM   s   r.   N)

__future__r   asyncior   ImportErrortrollius__allr   r   r.   r   r   r   r   <module>   s   
