&`jdZddlmZmZddlmZmZddlmZej d dZ dZ d Z d Z dS) z oauthlib.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 )urlparse urlunparse)extract_params urlencode)utilsNcH|pi}g}|D]X\}}tj|}tj|}d||}||Yd|} |rd|z| z} d| z} i} | || | d<| S)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="Example", oauth_consumer_key="0685bd9184jfhq22", oauth_token="ad180jjd733klru7", oauth_signature_method="HMAC-SHA1", oauth_signature="wOJIO9A2W5mFwDgiDvZbTSMK%2FPY%3D", oauth_timestamp="137131200", oauth_nonce="4572616e48616d6d65724c61686176", 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{}="{}"z, z realm="%s", zOAuth %s Authorization)rescapeformatappendjoinupdate) oauth_paramsheadersrealm%authorization_header_parameters_partsoauth_parameter_namevalue escaped_name escaped_valuepartauthorization_header_parametersauthorization_header full_headerss D/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/parameters.pyprepare_headersrs0mG-/)'3 ; ;#e |$899  U++  m<<-44T:::: '+ii-'/'/# L+9E+A+J,K'&(GGL   $8L! c|t|}|||d|S)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 c8|ddS)Nroauth_) startswith)is rz _append_params..isadooh77r)key)listextendsort)rparamsmergeds r_append_paramsr+Xs@&\\F MM,  KK77K888 Mrc"t||S)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+)rbodys rprepare_form_encoded_bodyr.ms , - --rct|\}}}}}}tt|t|pg}t ||||||fS)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 )rrr+rr)rurischnetpathparqueryfras rprepare_request_uri_queryr7ysb'/smm#CdC |^E%:%:%@bAA C CE sCsE37 8 88r)NN)__doc__ urllib.parserroauthlib.commonrrr filter_paramsrr+r.r7rrr>s.-------55555555 BBBBJ* . . . 9 9 9 9 9r