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 : |
B a�N� � @ s@ d Z G dd� 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 @ sB e Zd ZdZdd� Zdd� Zdd� Zdd � Zddd �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 c C s || _ || _i | _g | _d S )N)�application�default�binding� predicate)�selfr � r �A/opt/alt/python37/lib/python3.7/site-packages/paste/auth/multi.py�__init__1 s zMultiHandler.__init__c O s || j f|�|�| j|<