def handle_request(self, req):
        """Entry point for auth requests (ones that match the self.auth_prefix).
        Should return a WSGI-style callable (such as swob.Response).

        :param req: swob.Request object
        """
        req.start_time = time()
        handler = None
        try:
            version, account, user, _junk = split_path(req.path_info,
                minsegs=0, maxsegs=4, rest_with_last=True)
        except __HOLE__:
            return HTTPNotFound(request=req)
        if version in ('v1', 'v1.0', 'auth'):
            if req.method == 'GET':
                handler = self.handle_get_token
        elif version == 'v2':
            if not self.super_admin_key:
                return HTTPNotFound(request=req)
            req.path_info_pop()
            if req.method == 'GET':
                if not account and not user:
                    handler = self.handle_get_reseller
                elif account:
                    if not user:
                        handler = self.handle_get_account
                    elif account == '.token':
                        req.path_info_pop()
                        handler = self.handle_validate_token
                    else:
                        handler = self.handle_get_user
            elif req.method == 'PUT':
                if not user:
                    handler = self.handle_put_account
                else:
                    handler = self.handle_put_user
            elif req.method == 'DELETE':
                if not user:
                    handler = self.handle_delete_account
                else:
                    handler = self.handle_delete_user
            elif req.method == 'POST':
                if account == '.prep':
                    handler = self.handle_prep
                elif user == '.services':
                    handler = self.handle_set_services
        else:
            handler = self.handle_webadmin
        if not handler:
            req.response = HTTPBadRequest(request=req)
        else:
            req.response = handler(req)
        return req.response
dataset/ETHPy150Open openstack/swauth/swauth/middleware.py/Swauth.handle_request