
    k7i                     T    S r SSKJr  SSKJr  SSKJr  SSKJr  SS jrS	 rS
 r	S r
g)zauthlib.spec.rfc5849.parameters.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec.

.. _`section 3.5`: https://tools.ietf.org/html/rfc5849#section-3.5
    )extract_params)
url_encode)urlparse   )escapeNc                    U=(       d    0 nSR                  U  VVs/ s H7  u  p4UR                  S5      (       d  M  [        U5       S[        U5       S3PM9     snn5      nU(       a	  SU S3U-   nSU 3US'   U$ s  snnf )	a  **Prepare the Authorization header.**
Per `section 3.5.1`_ of the spec.

Protocol parameters can be transmitted using the HTTP "Authorization"
header field as defined by `RFC2617`_ with the auth-scheme name set to
"OAuth" (case insensitive).

For example::

    Authorization: OAuth realm="Photos",
        oauth_consumer_key="dpf43f3p2l4k3l03",
        oauth_signature_method="HMAC-SHA1",
        oauth_timestamp="137131200",
        oauth_nonce="wIjqoS",
        oauth_callback="http%3A%2F%2Fprinter.example.com%2Fready",
        oauth_signature="74KNZJeDHnMBp0EMJ9ZHt%2FXKycU%3D",
        oauth_version="1.0"

.. _`section 3.5.1`: https://tools.ietf.org/html/rfc5849#section-3.5.1
.. _`RFC2617`: https://tools.ietf.org/html/rfc2617
z, oauth_z=""zrealm="z", zOAuth Authorization)join
startswithr   )oauth_paramsheadersrealmkvheader_parameterss         [/home/james-whalen/.local/lib/python3.13/site-packages/authlib/oauth1/rfc5849/parameters.pyprepare_headersr      s    , mG 		 %	
$||H% )vaykF1I;a($	
 %eWC03DD "((9':;GON#	
s
   A<
A<
c                 ^    [        U5      nUR                  U 5        UR                  S S9  U$ )a*  Append OAuth params to an existing set of parameters.

Both params and oauth_params is must be lists of 2-tuples.

Per `section 3.5.2`_ and `3.5.3`_ of the spec.

.. _`section 3.5.2`: https://tools.ietf.org/html/rfc5849#section-3.5.2
.. _`3.5.3`: https://tools.ietf.org/html/rfc5849#section-3.5.3

c                 *    U S   R                  S5      $ )Nr   r	   )r   )is    r   <lambda> _append_params.<locals>.<lambda>O   s    adooh7    )key)listextendsort)r   paramsmergeds      r   _append_paramsr"   >   s/     &\F
MM,
 KK7K8Mr   c                 *    [        [        X5      5      $ )zPrepare the Form-Encoded Body.

Per `section 3.5.2`_ of the spec.

.. _`section 3.5.2`: https://tools.ietf.org/html/rfc5849#section-3.5.2

)r   r"   )r   bodys     r   prepare_form_encoded_bodyr%   S   s     n\899r   c                     [         R                   " U5      u  p#pEpg[        [        U [        U5      =(       d    / 5      5      n[         R                  " X#XEXg45      $ )zPrepare the Request URI Query.

Per `section 3.5.3`_ of the spec.

.. _`section 3.5.3`: https://tools.ietf.org/html/rfc5849#section-3.5.3

)r   r   r"   r   
urlunparse)r   urischnetpathparqueryfras           r   prepare_request_uri_queryr/   _   sN     '/&7&7&<#Cd~lN54I4ORPQE$U@AAr   )NN)__doc__authlib.common.urlsr   r   r   utilr   r   r"   r%   r/    r   r   <module>r4      s.    / * ( +\*	:Br   