Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/__pycache__/utils.cpython-38.pyc
U

O��g5
�@s`dZddlmZddlmZmZdZdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�ZdS)zn
oauthlib.utils
~~~~~~~~~~~~~~

This module contains utility methods used by various parts of the OAuth
spec.
�N)�quote�unquoteZ>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789cs�fdd�}�j|_|S)z�Decorator which filters params to remove non-oauth_* parameters

    Assumes the decorated method takes a params dict or list of tuples as its
    first argument.
    cst|�}�|f|�|�S)N)�filter_oauth_params)�params�args�kwargs��target��J/opt/cppython/lib/python3.8/site-packages/oauthlib/oauth1/rfc5849/utils.py�wrapperszfilter_params.<locals>.wrapper)�__doc__)r	rr
rr�
filter_paramssrcCs:dd�}t|t�r(tt|t|�����Stt||��SdS)zARemoves all non oauth parameters from a dict or a list of params.cSs|d�d�S)NrZoauth_)�
startswith)�kvr
r
r�<lambda>!�z%filter_oauth_params.<locals>.<lambda>N)�
isinstance�dict�list�filter�items)rZis_oauthr
r
rrs
rcCs.t|t�s"tdd�|t|����t|dd�S)z�Escape a unicode string in an OAuth-compatible fashion.

    Per `section 3.6`_ of the spec.

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

    z$Only unicode objects are escapable. zGot {!r} of type {}.�~)�safe)r�str�
ValueError�format�typer��ur
r
r�escape(s

�r cCst|t�std��t|�S)Nz%Only unicode objects are unescapable.)rrrrrr
r
r�unescape8s
r!cCs
t�|�S)z1A unicode-safe version of urllib2.parse_keqv_list)�urllib2�parse_keqv_list)�lr
r
rr#>sr#cCs
t�|�S)z1A unicode-safe version of urllib2.parse_http_list)r"�parse_http_listrr
r
rr%Dsr%c	Csnd��}|dt|�����|�rbt|t|�d��}ztt|����WSttfk
r`YnXtd��dS)z;Parse an OAuth authorization header into a list of 2-tupleszOAuth NzMalformed authorization header)	�lower�lenrr%rr#r�
IndexErrorr)Zauthorization_headerZauth_schemerr
r
r�parse_authorization_headerJsr))r
�urllib.request�requestr"Zoauthlib.commonrrZUNICODE_ASCII_CHARACTER_SETrrr r!r#r%r)r
r
r
r�<module>s	

F1le Man4ger