+
    VùCiÎ  ã                   ód   € R t ^ RIt^RIHt ^RIHt ]P                  ! ]4      t ! R R]4      t	R# )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                   ó.   a € ] tR t^t o RtRR ltRtV tR# )Ú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)
Nc                óf  €  V P                  WW44      p T P                  T4       T P	                  T4       TP
                  '       g   RT3# T P                  P                  TP
                  4      '       g   RT3# T P                  P                  TP                  TP                  TP                  TTP
                  R7      '       g   RT3# T P                  P                  TP                  T4      pT'       g   T P                  P                  Tn	        T P                  P                  TP                  TP
                  T4      pT'       g   T P                  P                  Tn        T P                  P!                  TP                  TP
                  YfP"                  TR7      p	T P%                  T4      p
YvP&                  R&   Y†P&                  R&   Y–P&                  R&   Y¦P&                  R&   \)        YxT	T
34      pT'       gn   \*        P-                  R4       \*        P-                  R	T4       \*        P-                  R
T4       \*        P-                  RT	4       \*        P-                  RT
4       Y¶3#   \        P                   d    Ru # i ; i  \        P                   d    RT3u # i ; i)aD  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.
F)Úaccess_token)ÚuriÚrealmsÚclientÚresource_ownerÚrealmÚ	signaturez&[Failure] request verification failed.zValid client: %szValid token: %szValid realm: %szValid signature: %s)FN)Ú_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Úvs   &&&&&&      ÚL/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/endpoints/resource.pyÚ#validate_protected_resource_requestÚ4ResourceEndpoint.validate_protected_resource_request5   s|  € ð	Ø×*Ñ*¨3¸TÓKˆGð	"Ø×*Ñ*¨7Ô3Ø×,Ñ,¨WÔ5ð ×)×)Ð)Ø˜'�>Ð!à×%Ñ%×8Ñ8Ø×*Ñ*÷,ò ,à˜'�>Ð!à×%Ñ%×BÑBØ×"Ñ" G×$5Ñ$5°w·}±}ÀgØ$×7Ñ7ð C÷ 9ò 9ð ˜'�>Ð!ð ×-Ñ-×AÑAØ×Ñ ó)ˆçØ!%×!7Ñ!7×!DÑ!DˆGÔð  $×5Ñ5×KÑKØ×Ñ × :Ñ :¸Gó EÐç#Ø)-×)?Ñ)?×)RÑ)RˆGÔ&ð0 ×,Ñ,×<Ñ<¸W×=OÑ=OØ=D×=WÑ=WÐY`×fqÑfqØDJð =ó Lˆð ×/Ñ/°Ó8ˆð +7×Ñ˜hÑ'Ø2F×ÑÐ.Ñ/Ø)4×Ñ˜gÑ&Ø-<×Ñ˜kÑ*ô �°[Ø ð"ó #ˆçÜ�H‰HÐ=Ô>Ü�H‰HÐ'¨Ô6Ü�H‰HÐ&Ð(<Ô=Ü�H‰HÐ&¨Ô4Ü�H‰HÐ*¨OÔ<ØˆzÐøô{ ×!Ñ!ô 	ØÒð	ûô ×!Ñ!ô 	"Ø˜'�>Ò!ð	"ús"   ‚I7 •"J É7JÊJÊJ0Ê/J0© )ÚGETNNN)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r.   Ú__static_attributes__Ú__classdictcell__)Ú__classdict__s   @r-   r   r      s   ø‡ € ñ ÷Dnò nó    r   )
r6   ÚloggingÚ r   Úbaser   Ú	getLoggerr2   r!   r   r0   r:   r-   Ú<module>r?      s3   ðñó å Ý à×Ò˜Ó!€ôR�|ö Rr:   