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

a�NJ�@s\dZddlmZmZdZGdd�de�ZeZdgZdd�Z	de
krXdd	lZejej
d
�d	S)a(
Authentication via HTML Form

This is a very simple HTML form login screen that asks for the username
and password.  This middleware component requires that an authorization
function taking the name and passsword and that it be placed in your
application stack. This class does not include any session management
code or way to save the user's authorization; however, it is easy enough
to put ``paste.auth.cookie`` in your application stack.

>>> from paste.wsgilib import dump_environ
>>> from paste.httpserver import serve
>>> from paste.auth.cookie import AuthCookieHandler
>>> from paste.auth.form import AuthFormHandler
>>> def authfunc(environ, username, password):
...    return username == password
>>> serve(AuthCookieHandler(
...           AuthFormHandler(dump_environ, authfunc)))
serving on...

�)�
construct_url�parse_formvarsa�<html>
  <head><title>Please Login!</title></head>
  <body>
    <h1>Please Login</h1>
    <form action="%s" method="post">
      <dl>
        <dt>Username:</dt>
        <dd><input type="text" name="username"></dd>
        <dt>Password:</dt>
        <dd><input type="password" name="password"></dd>
      </dl>
      <input type="submit" name="authform" />
      <hr />
    </form>
  </body>
</html>
c@s"eZdZdZddd�Zdd�ZdS)�AuthFormHandlera�
    HTML-based login middleware

    This causes a HTML form to be returned if ``REMOTE_USER`` is
    not found in the ``environ``.  If the form is returned, the
    ``username`` and ``password`` combination are given to a
    user-supplied authentication function, ``authfunc``.  If this
    is successful, then application processing continues.

    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.

        ``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.

        ``template``

            This is an optional (a default is provided) HTML
            fragment that takes exactly one ``%s`` substution
            argument; which *must* be used for the form's ``action``
            to ensure that this middleware component does not alter
            the current path.  The HTML form must use ``POST`` and
            have two input names:  ``username`` and ``password``.

    Since the authentication form is submitted (via ``POST``)
    neither the ``PATH_INFO`` nor the ``QUERY_STRING`` are accessed,
    and hence the current path remains _unaltered_ through the
    entire authentication process. If authentication succeeds, the
    ``REQUEST_METHOD`` is converted from a ``POST`` to a ``GET``,
    so that a redirect is unnecessary (unlike most form auth
    implementations)
    NcCs||_||_|pt|_dS)N)�application�authfunc�TEMPLATE�template)�selfrrr�r
�@/opt/alt/python37/lib/python3.7/site-packages/paste/auth/form.py�__init__[szAuthFormHandler.__init__cCs�|�dd�}|r|�||�Sd|dkr�t|dd�}|�d�}|�d�}|r�|r�|�|||�r�d	|d
<||d<d|d<d|d<d|d
<|d=|�||�S|jt|�}|dddtt|��fg�|gS)NZREMOTE_USER�ZPOSTZREQUEST_METHODF)Zinclude_get_vars�username�passwordZformZ	AUTH_TYPEZGETZCONTENT_LENGTHZCONTENT_TYPEzpaste.parsed_formvarsz200 OK)zContent-Typez	text/htmlzContent-Length)�getrrrrr�str�len)r	�environZstart_responserZformvarsr�contentr
r
r�__call__`s(

zAuthFormHandler.__call__)N)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rr/s*
rcKshddlm}ddl}||�}t||j�s0td��|�d�}|dk	r\||�}t|t�s\td��t|||�S)z�
    Grant access via form authentication

    Config looks like this::

      [filter:grant]
      use = egg:Paste#auth_form
      realm=myrealm
      authfunc=somepackage.somemodule:somefunction
      
    r)�eval_importNz#authfunc must resolve to a functionrz!template must resolve to a string)	Zpaste.util.import_stringr�types�
isinstance�FunctionType�AssertionErrorrrr)ZappZglobal_conf�realmr�kwrrrr
r
r�	make_form|s
r!�__main__N)Zoptionflags)rZ
paste.requestrrr�objectrZ
middleware�__all__r!rZdoctestZtestmod�ELLIPSISr
r
r
r�<module>sI

Youez - 2016 - github.com/yon3zu
LinuXploit