HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/oauthlib/oauth1/rfc5849/__pycache__/utils.cpython-36.opt-1.pyc
3

,�[�
�@s�dZddlmZmZddlmZmZmZmZyddl	Z	Wne
k
rVddljZ	YnXdZ
dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�ZdS)zn
oauthlib.utils
~~~~~~~~~~~~~~

This module contains utility methods used by various parts of the OAuth
spec.
�)�absolute_import�unicode_literals)�
bytes_type�quote�unicode_type�unquoteNZ>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��/usr/lib/python3.6/utils.py�wrapperszfilter_params.<locals>.wrapper)�__doc__)rrr
)rr�
filter_paramssrcCs:dd�}t|t�r(tt|t|j����Stt||��SdS)zARemoves all non oauth parameters from a dict or a list of params.cSs|djd�S)NrZoauth_)�
startswith)Zkvr
r
r�<lambda>(sz%filter_oauth_params.<locals>.<lambda>N)�
isinstance�dict�list�filter�items)r	Zis_oauthr
r
rr&s
rcCs.t|t�s"tdd|t|�f��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 %s.�~)Zsafe)rr�
ValueError�typer)�ur
r
r�escape/s
rcCst|t�std��t|�S)Nz%Only unicode objects are unescapable.)rrrr)rr
r
r�unescape?s
rcCs
tj|�S)z1A unicode-safe version of urllib2.parse_keqv_list)�urllib2�parse_keqv_list)�lr
r
rr Esr cCs
tj|�S)z1A unicode-safe version of urllib2.parse_http_list)r�parse_http_list)rr
r
rr"Ksr"cCsldj�}|dt|��j�j|�r`t|t|�d��}ytt|�j��Sttfk
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_headerQsr&)rZ
__future__rrZoauthlib.commonrrrrr�ImportErrorZurllib.requestZrequestZUNICODE_ASCII_CHARACTER_SETrrrrr r"r&r
r
r
r�<module>s