/usr/lib/python3/dist-packages/social/backends/dribbble.py is in python3-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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | """
Dribbble OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/dribbble.html
http://developer.dribbble.com/v1/oauth/
"""
from social.backends.oauth import BaseOAuth2
class DribbbleOAuth2(BaseOAuth2):
"""Dribbble OAuth authentication backend"""
name = 'dribbble'
AUTHORIZATION_URL = 'https://dribbble.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://dribbble.com/oauth/token'
ACCESS_TOKEN_METHOD = 'POST'
SCOPE_SEPARATOR = ','
EXTRA_DATA = [
('id', 'id'),
('name', 'name'),
('html_url', 'html_url'),
('avatar_url', 'avatar_url'),
('bio', 'bio'),
('location', 'location'),
('links', 'links'),
('buckets_count', 'buckets_count'),
('comments_received_count', 'comments_received_count'),
('followers_count', 'followers_count'),
('followings_count', 'followings_count'),
('likes_count', 'likes_count'),
('likes_received_count', 'likes_received_count'),
('projects_count', 'projects_count'),
('rebounds_received_count', 'rebounds_received_count'),
('shots_count', 'shots_count'),
('teams_count', 'teams_count'),
('pro', 'pro'),
('buckets_url', 'buckets_url'),
('followers_url', 'followers_url'),
('following_url', 'following_url'),
('likes_url', 'shots_url'),
('teams_url', 'teams_url'),
('created_at', 'created_at'),
('updated_at', 'updated_at'),
]
def get_user_details(self, response):
"""Return user details from Dribbble account"""
fullname, first_name, last_name = self.get_user_names(
response.get('name')
)
return {'username': response.get('username'),
'email': response.get('email', ''),
'fullname': fullname,
'first_name': first_name,
'last_name': last_name}
def user_data(self, access_token, *args, **kwargs):
"""Loads user data from service"""
return self.get_json(
'https://api.dribbble.com/v1/user',
headers={
'Authorization': 'Bearer {0}'.format(access_token)
})
|