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

Unified Diff: appengine/config_service/handlers.py

Issue 2962703003: config_service: Add authentication to the UI. (Closed)
Patch Set: Added TODO to handlers.py and confirmed versions in bower.json 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
« no previous file with comments | « appengine/config_service/app.yaml ('k') | appengine/config_service/ui/README.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/config_service/handlers.py
diff --git a/appengine/config_service/handlers.py b/appengine/config_service/handlers.py
index 3a6e135477939404fbabc8a086c5f0171803e6e0..c7dc8c4fb900bb10a38aa43b783c9a1d564e589a 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,19 @@ 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):
+ # TODO(cwpayton): put the client_id in a proto file so that it is
+ # configurable and can be read dynamically by this file.
+ template_values = {
+ 'client_id':
+ '247108661754-svmo17vmk1j5hlt388gb45qblgvg2h98.apps.googleusercontent.com'
+ }
+ 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 +66,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),
]
« no previous file with comments | « appengine/config_service/app.yaml ('k') | appengine/config_service/ui/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698