def _cacheAuthUser(fun):
    def inner(returnToken=False, *args, **kwargs):
        if not returnToken and hasattr(cherrypy.request, 'girderUser'):
            return cherrypy.request.girderUser

        user = fun(returnToken, *args, **kwargs)
        if isinstance(user, tuple):
            setattr(cherrypy.request, 'girderUser', user[0])
        else:
            setattr(cherrypy.request, 'girderUser', user)

        return user
    return inner
Validates that the hosting type represents a valid hosting service.
dataset/ETHPy150Open girder/girder/girder/api/rest.py/_cacheAuthUser--crossover with--dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/scmtools/forms.py/RepositoryForm.clean_hosting_type