This file is indexed.

/usr/lib/python2.7/dist-packages/social/backends/taobao.py is in python-social-auth 1:0.2.21+dfsg-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from social.backends.oauth import BaseOAuth2


class TAOBAOAuth(BaseOAuth2):
    """Taobao OAuth authentication mechanism"""
    name = 'taobao'
    ID_KEY = 'taobao_user_id'
    ACCESS_TOKEN_METHOD = 'POST'
    AUTHORIZATION_URL = 'https://oauth.taobao.com/authorize'
    ACCESS_TOKEN_URL = 'https://oauth.taobao.com/token'

    def user_data(self, access_token, *args, **kwargs):
        """Return user data provided"""
        try:
            return self.get_json('https://eco.taobao.com/router/rest', params={
                'method': 'taobao.user.get',
                'fomate': 'json',
                'v': '2.0',
                'access_token': access_token
            })
        except ValueError:
            return None

    def get_user_details(self, response):
        """Return user details from Taobao account"""
        return {'username': response.get('taobao_user_nick')}