Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: appengine/config_service/handlers.py

Issue 2962703003: config_service: Add authentication to the UI. (Closed)
Patch Set: Moved client_id so that it is served by the back end via templating instead of hard coded into the … Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/config_service/handlers.py
diff --git a/appengine/config_service/handlers.py b/appengine/config_service/handlers.py
index 3a6e135477939404fbabc8a086c5f0171803e6e0..7cc6d7048c085715acfea3cbab7d999aa1f67e26 100644
--- a/appengine/config_service/handlers.py
+++ b/appengine/config_service/handlers.py
@@ -8,10 +8,12 @@ import webapp2
from components import decorators
from components.config.proto import service_config_pb2
+from google.appengine.ext.webapp import template
import common
import gitiles_import
import notifications
+import os
import storage
@@ -28,6 +30,17 @@ class MainPageHandler(webapp2.RequestHandler):
def get(self):
self.redirect('_ah/api/explorer')
+class UIHandler(webapp2.RequestHandler):
+ """ Serves the UI with the proper client ID. """
+
+ def get(self):
+ template_values = {
+ 'client_id':
+ '247108661754-svmo17vmk1j5hlt388gb45qblgvg2h98.apps.googleusercontent.com'
Sergey Berezin 2017/06/29 23:52:53 nit: let's add a TODO to make this configurable.
cwpayton 2017/06/30 00:12:48 Done.
+ }
+ path = os.path.join(os.path.dirname(__file__), 'ui/static/index.html')
+ self.response.out.write(template.render(path, template_values))
+
class SchemasHandler(webapp2.RequestHandler):
"""Redirects to a known schema definition."""
@@ -51,6 +64,7 @@ class SchemasHandler(webapp2.RequestHandler):
def get_frontend_routes(): # pragma: no cover
return [
webapp2.Route(r'/', MainPageHandler),
+ webapp2.Route(r'/newui', UIHandler),
webapp2.Route(r'/schemas/<name:.+>', SchemasHandler),
webapp2.Route(r'/_ah/bounce', notifications.BounceHandler),
]

Powered by Google App Engine
This is Rietveld 408576698