![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /lib/python3/dist-packages/oauthlib/oauth1/rfc5849/__pycache__/ |
o ���a5 � @ s` d Z ddlmZ ddlmZmZ dZdd� Zdd� Z d d � Z dd� Zd d� Zdd� Z dd� ZdS )zn oauthlib.utils ~~~~~~~~~~~~~~ This module contains utility methods used by various parts of the OAuth spec. � N)�quote�unquote�>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789c s � 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. c s t | �} � | g|�R i |��S )N)�filter_oauth_params)�params�args�kwargs��target� �?/usr/lib/python3/dist-packages/oauthlib/oauth1/rfc5849/utils.py�wrapper s zfilter_params.<locals>.wrapper)�__doc__)r r r r r � filter_params s r c C s6 dd� }t | t�rtt|t| �� ���S tt|| ��S )zARemoves all non oauth parameters from a dict or a list of params.c S s | d � d�S )Nr �oauth_)� startswith)�kvr r r �<lambda>! s z%filter_oauth_params.<locals>.<lambda>)� isinstance�dict�list�filter�items)r �is_oauthr r r r s r c C s. t | t�stdd�| 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"