def get_routes(): routes = [ # AppEngine-specific urls: webapp2.Route(r'/_ah/mail/<to:.+>', EmailHandler), webapp2.Route(r'/_ah/warmup', WarmupHandler), ] if not utils.should_disable_ui_routes(): routes.extend([ # Administrative urls. webapp2.Route(r'/restricted/config', RestrictedConfigHandler), webapp2.Route(r'/restricted/purge', RestrictedPurgeHandler), # Mapreduce related urls. webapp2.Route(r'/restricted/launch_mapreduce', RestrictedLaunchMapReduceJob), # User web pages. webapp2.Route(r'/browse', BrowseHandler), webapp2.Route(r'/content', ContentHandler), # TODO(maruel): These really need to be migrated to Cloud Endpoints, gviz # is just too sorry. #webapp2.Route(r'/stats', StatsHandler), #webapp2.Route(r'/isolate/api/v1/stats/days', StatsGvizDaysHandler), #webapp2.Route(r'/isolate/api/v1/stats/hours', StatsGvizHoursHandler), #webapp2.Route(r'/isolate/api/v1/stats/minutes', StatsGvizMinutesHandler), webapp2.Route(r'/', RootHandler), webapp2.Route(r'/newui', UIHandler), ]) routes.extend(handlers_endpoints_v1.get_routes()) return routes
def get_routes(): routes = [ ('/_ah/mail/<to:.+>', EmailHandler), ('/_ah/warmup', WarmupHandler), ] if not utils.should_disable_ui_routes(): routes.extend([ # Frontend pages. They return HTML. # Public pages. ('/<page:(botlist|tasklist|task|bot|)>', UIHandler), # This is for https://aip.dev/122#resource-uris ('/tasks/<task_id:[0-9a-fA-F]+>', TaskHandler), # These were the very old (pre-2016) links, so this redirects # them to the modern url style. ('/user/tasks', TasksHandler), ('/user/task/<task_id:[0-9a-fA-F]+>', TaskHandler), ('/restricted/bots', BotsListHandler), ('/restricted/bot/<bot_id:[^/]+>', BotHandler), # Admin pages. # TODO(maruel): Get rid of them. ('/restricted/config', RestrictedConfigHandler), ]) return [webapp2.Route(*i) for i in routes]
def get_routes(): routes = [ ('/_ah/mail/<to:.+>', EmailHandler), ('/_ah/warmup', WarmupHandler), ] if not utils.should_disable_ui_routes(): routes.extend([ # Frontend pages. They return HTML. # Public pages. ('/<page:(bot|botlist|task|tasklist|)>', UIHandler), # Redirects to Polymer UI ('/user/tasks', TasksHandler), ('/user/task/<task_id:[0-9a-fA-F]+>', TaskHandler), ('/restricted/bots', BotsListHandler), ('/restricted/bot/<bot_id:[^/]+>', BotHandler), # Admin pages. # TODO(maruel): Get rid of them. ('/restricted/config', RestrictedConfigHandler), # Mapreduce related urls. (r'/restricted/launch_mapreduce', RestrictedLaunchMapReduceJob), ]) return [webapp2.Route(*i) for i in routes]
def create_frontend_app(): template.bootstrap({ 'templates': os.path.join(THIS_DIR, 'templates'), }) routes = [] if not utils.should_disable_ui_routes(): routes.extend(get_routes()) return webapp2.WSGIApplication(routes)
def get_ui_routes(): """Returns a list of routes with auth UI handlers.""" routes = [] if not utils.should_disable_ui_routes(): # Routes for registered navbar tabs. for cls in _ui_navbar_tabs: routes.extend(cls.get_webapp2_routes()) # Routes for everything else. routes.extend([ webapp2.Route(r'/auth', MainHandler), webapp2.Route(r'/auth/bootstrap', BootstrapHandler, name='bootstrap'), webapp2.Route(r'/auth/bootstrap/oauth', BootstrapOAuthHandler), webapp2.Route(r'/auth/link', LinkToPrimaryHandler), webapp2.Route(r'/auth/listing', GroupListingHandler), ]) return routes
def get_routes(): routes = [ # AppEngine-specific urls: webapp2.Route(r'/_ah/mail/<to:.+>', EmailHandler), webapp2.Route(r'/_ah/warmup', WarmupHandler), ] if not utils.should_disable_ui_routes(): routes.extend([ # Administrative urls. webapp2.Route(r'/restricted/config', RestrictedConfigHandler), webapp2.Route(r'/restricted/purge', RestrictedPurgeHandler), # User web pages. webapp2.Route(r'/browse', BrowseHandler), webapp2.Route(r'/content', ContentHandler), webapp2.Route(r'/', RootHandler), webapp2.Route(r'/newui', UIHandler), ]) routes.extend(handlers_endpoints_v1.get_routes()) return routes
def get_frontend_routes(): routes = [ # Public API. webapp2.Route('/ereporter2/api/v1/on_error', OnErrorHandler), ] if not utils.should_disable_ui_routes(): routes.extend([ webapp2.Route(r'/restricted/ereporter2/errors', RestrictedEreporter2ErrorsList), webapp2.Route(r'/restricted/ereporter2/errors/<error_id:\d+>', RestrictedEreporter2Error), webapp2.Route(r'/restricted/ereporter2/report', RestrictedEreporter2Report), webapp2.Route( r'/restricted/ereporter2/request/<request_id:[0-9a-fA-F]+>', RestrictedEreporter2Request), webapp2.Route(r'/restricted/ereporter2/silence', RestrictedEreporter2Silence), ]) return routes