Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/oauthlib/oauth2/rfc6749/__pycache__/utils.cpython-36.pyc

3

 ��c��@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:djdd�|D��Std|��dS)z5Convert a list of scopes to a space separated string.N� cSsg|]}t|��qS�)�str)�.0�srr�A/tmp/pip-build-_uu8ur7s/oauthlib/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|j�jd�SdS)z5Convert a space separated string to a list of scopes.cSsg|]}t|��qSr)r)rr	rrr
rsz!scope_to_list.<locals>.<listcomp>Nr)rrrr
�strip�split)rrrr
�
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|jdd�\}}n|j|j��}||fS)zuExtract hostname and port from URI.

    Will use default port for HTTP and HTTPS if none is present in the URI.
    �80Z443)�HTTP�HTTPS�:�)rr�get�upper)	rZ
default_portsZsch�netloc�path�parrZfra�portrrr
�
host_from_uri)sr'cCs$t|t�std��t|jd�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)rrrr�encode)�urrr
�escape<s
r,cCs8tjj�|}|j|j|jdddd}t|�S)z9Generate a age parameter for MAC authentication draft 00.�i�
�i@Bi@B)�datetime�now�microseconds�seconds�daysr)Z
issue_time�tdZagerrr
�generate_ageGsr6cCstjjd�rdS|j�jd�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



Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists