This file is indexed.

/usr/lib/python2.7/dist-packages/social/apps/cherrypy_app/views.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
27
28
29
import cherrypy

from social.utils import setting_name, module_member
from social.actions import do_auth, do_complete, do_disconnect
from social.apps.cherrypy_app.utils import psa


class CherryPyPSAViews(object):
    @cherrypy.expose
    @psa('/complete/%(backend)s')
    def login(self, backend):
        return do_auth(self.backend)

    @cherrypy.expose
    @psa('/complete/%(backend)s')
    def complete(self, backend, *args, **kwargs):
        login = cherrypy.config.get(setting_name('LOGIN_METHOD'))
        do_login = module_member(login) if login else self.do_login
        user = getattr(cherrypy.request, 'user', None)
        return do_complete(self.backend, do_login, user=user, *args, **kwargs)

    @cherrypy.expose
    @psa()
    def disconnect(self, backend, association_id=None):
        user = getattr(cherrypy.request, 'user', None)
        return do_disconnect(self.backend, user, association_id)

    def do_login(self, backend, user, social_user):
        backend.strategy.session_set('user_id', user.id)