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/oauth2/rfc6749/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


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

O��g��@sldZddlZddlZddlmZmZddlmZdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�ZdS)zp
oauthlib.utils
~~~~~~~~~~~~~~

This module contains utility methods used by various parts of the OAuth 2 spec.
�N)�quote�urlparse)�	urldecodecCsJt|t�s|dkr|St|tttf�r:d�dd�|D��Std|��dS)z5Convert a list of scopes to a space separated string.N� cSsg|]}t|��qS���str��.0�srr�J/opt/cppython/lib/python3.8/site-packages/oauthlib/oauth2/rfc6749/utils.py�
<listcomp>sz!list_to_scope.<locals>.<listcomp>z8Invalid scope (%s), must be string, tuple, set, or list.)�
isinstancer�set�tuple�list�join�
ValueError��scoperrr�
list_to_scopes
rcCs<t|tttf�rdd�|D�S|dkr*dS|���d�SdS)z5Convert a space separated string to a list of scopes.cSsg|]}t|��qSrrr	rrrr
sz!scope_to_list.<locals>.<listcomp>Nr)rrrr�strip�splitrrrr�
scope_to_lists
rcCs.ttt|�j��}d|kr*t|d�|d<|S)Nr)�dictrr�queryr)�uri�paramsrrr�params_from_uri"src	CsNddd�}t|�\}}}}}}d|kr8|�dd�\}}n|�|���}||fS)zuExtract hostname and port from URI.

    Will use default port for HTTP and HTTPS if none is present in the URI.
    �80�443)�HTTPZHTTPS�:�)rr�get�upper)	rZ
default_portsZsch�netloc�pathZparrZfra�portrrr�
host_from_uri)s�r)cCs$t|t�std��t|�d�dd�S)ztEscape a string in an OAuth-compatible fashion.

    TODO: verify whether this can in fact be used for OAuth 2

    z#Only unicode objects are escapable.zutf-8�~)�safe)rrrr�encode)�urrr�escape<s
r.cCs8tj��|}|j|j|jdddd}t|�S)z9Generate a age parameter for MAC authentication draft 00.�ii@B)�datetime�now�microseconds�seconds�daysr)Z
issue_time�tdZagerrr�generate_ageGs��r6cCstj�d�rdS|���d�S)zCheck if the uri is over ssl.ZOAUTHLIB_INSECURE_TRANSPORTTzhttps://)�os�environr$�lower�
startswith)rrrr�is_secure_transportOsr;)�__doc__r0r7�urllib.parserrZoauthlib.commonrrrrr)r.r6r;rrrr�<module>s



F1le Man4ger