Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/web/_auth/__pycache__/ |
Upload File : |
o �b�! � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl m Z ddlmZ ddl mZmZ ee�G d d � d ��Zee�G dd� d��Zd S )a� A guard implementation which supports HTTP header-based authentication schemes. If no I{Authorization} header is supplied, an anonymous login will be attempted by using a L{Anonymous} credentials object. If such a header is supplied and does not contain allowed credentials, or if anonymous login is denied, a 401 will be sent in the response along with I{WWW-Authenticate} headers for each of the allowed authentication schemes. � )�implementer)�error)� Anonymous)�Logger)�proxyForInterface)�util)� ErrorPage� IResourcec @ s4 e Zd ZdZdZdd� Zdd� Zdd� Zd d � ZdS )�UnauthorizedResourcez6 Simple IResource to escape Resource dispatch Tc C s || _ d S �N)�_credentialFactories)�self� factories� r �;/usr/lib/python3/dist-packages/twisted/web/_auth/wrapper.py�__init__# s zUnauthorizedResource.__init__c sf dd� � � �fdd�}dd� �|� d� | jD ]}|�|�}|j�d||j|�� q|jd kr1d S dS )z= Send www-authenticate headers to the client c S s t | t�r | �d�S | S )N�ascii)� isinstance�str�encode��sr r r �ensureBytes+ s z0UnauthorizedResource.render.<locals>.ensureBytesc sP g }|� � D ]\}}� |�}� |�}|�|d �|� � qd�| d�|�g�S )N� =� s , )�items�append�join)�scheme� challenge�lst�k�v�r �quoteStringr r �generateWWWAuthenticate. s z<UnauthorizedResource.render.<locals>.generateWWWAuthenticatec S s d| � dd�� dd� d S )N� "� \s \\s \")�replacer r r r r$ 6 s z0UnauthorizedResource.render.<locals>.quoteStringi� s www-authenticates HEAD� s Unauthorized)�setResponseCoder �getChallenge�responseHeaders�addRawHeaderr �method)r �requestr% �factr r r# r �render&