403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.120
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3.6/site-packages/oauthlib/oauth1/rfc5849/endpoints/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.6/site-packages/oauthlib/oauth1/rfc5849/endpoints/__pycache__/resource.cpython-36.pyc
3

,�[
�@sRdZddlmZmZddlZddlmZddlmZej	e
�ZGdd	�d	e�ZdS)
z�
oauthlib.oauth1.rfc5849.endpoints.resource
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of the resource protection provider logic of
OAuth 1.0 RFC 5849.
�)�absolute_import�unicode_literalsN�)�errors�)�BaseEndpointc@seZdZdZddd�ZdS)�ResourceEndpointa!An endpoint responsible for protecting resources.

    Typical use is to instantiate with a request validator and invoke the
    ``validate_protected_resource_request`` in a decorator around a view
    function. If the request is valid, invoke and return the response of the
    view. If invalid create and return an error response directly from the
    decorator.

    See :doc:`/oauth1/validator` for details on which validator methods to implement
    for this endpoint.

    An example decorator::

        from functools import wraps
        from your_validator import your_validator
        from oauthlib.oauth1 import ResourceEndpoint
        endpoint = ResourceEndpoint(your_validator)

        def require_oauth(realms=None):
            def decorator(f):
                @wraps(f)
                def wrapper(request, *args, **kwargs):
                    v, r = provider.validate_protected_resource_request(
                            request.url,
                            http_method=request.method,
                            body=request.data,
                            headers=request.headers,
                            realms=realms or [])
                    if v:
                        return f(*args, **kwargs)
                    else:
                        return abort(403)
    �GETNcCs�y|j||||�}Wntjk
r*dSXy|j|�|j|�Wntjk
r^d|fSX|jsnd|fS|jj|j�s�d|fS|jj|j	|j
|j||jd�s�d|fS|jj|j	|�}|s�|jj
|_	|jj|j	|j|�}|�s�|jj|_|jj|j	|j||j|d�}	|j|�}
||jd<||jd<|	|jd<|
|jd<t|||	|
f�}|�s�tjd	�tjd
|�tjd|�tjd|	�tjd
|
�||fS)a�Create a request token response, with a new request token if valid.

        :param uri: The full URI of the token request.
        :param http_method: A valid HTTP verb, i.e. GET, POST, PUT, HEAD, etc.
        :param body: The request body as a string.
        :param headers: The request headers as a dict.
        :param realms: A list of realms the resource is protected under.
                       This will be supplied to the ``validate_realms``
                       method of the request validator.
        :returns: A tuple of 2 elements.
                  1. True if valid, False otherwise.
                  2. An oauthlib.common.Request object.
        FN)Zaccess_token)�uri�realmsZclientZresource_ownerZrealmZ	signaturez&[Failure] request verification failed.zValid client: %szValid token: %szValid realm: %szValid signature: %s)FN)Z_create_requestrZOAuth1ErrorZ_check_transport_securityZ_check_mandatory_parametersZresource_owner_keyZrequest_validatorZcheck_access_tokenZvalidate_timestamp_and_nonceZ
client_keyZ	timestampZnonceZvalidate_client_keyZdummy_clientZvalidate_access_tokenZdummy_access_tokenZvalidate_realmsr
Z_check_signatureZ
validator_log�all�log�info)�selfr
Zhttp_methodZbodyZheadersrZrequestZvalid_clientZvalid_resource_ownerZvalid_realmZvalid_signature�v�r�/usr/lib/python3.6/resource.py�#validate_protected_resource_request7sV


	

	








z4ResourceEndpoint.validate_protected_resource_request)r	NNN)�__name__�
__module__�__qualname__�__doc__rrrrrrs"r)
rZ
__future__rrZlogging�r�baserZ	getLoggerrr
rrrrr�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit