| OLD | NEW |
| 1 # Copyright 2012 The LUCI Authors. All rights reserved. | 1 # Copyright 2012 The LUCI Authors. All rights reserved. |
| 2 # Use of this source code is governed under the Apache License, Version 2.0 | 2 # Use of this source code is governed under the Apache License, Version 2.0 |
| 3 # that can be found in the LICENSE file. | 3 # that can be found in the LICENSE file. |
| 4 | 4 |
| 5 """This module defines Isolate Server frontend url handlers.""" | 5 """This module defines Isolate Server frontend url handlers.""" |
| 6 | 6 |
| 7 import collections | 7 import collections |
| 8 import datetime | 8 import datetime |
| 9 import json | 9 import json |
| 10 import logging | 10 import logging |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 | 387 |
| 388 | 388 |
| 389 class UIHandler(auth.AuthenticatingHandler): | 389 class UIHandler(auth.AuthenticatingHandler): |
| 390 """Serves the landing page for the new UI of the requested page. | 390 """Serves the landing page for the new UI of the requested page. |
| 391 | 391 |
| 392 This landing page is stamped with the OAuth 2.0 client id from the | 392 This landing page is stamped with the OAuth 2.0 client id from the |
| 393 configuration. | 393 configuration. |
| 394 """ | 394 """ |
| 395 @auth.public | 395 @auth.public |
| 396 def get(self): | 396 def get(self): |
| 397 params = {} | 397 params = { |
| 398 'client_id': config.settings().ui_client_id, |
| 399 } |
| 398 # Can cache for 1 week, because the only thing that would change in this | 400 # Can cache for 1 week, because the only thing that would change in this |
| 399 # template is the oauth client id, which changes very infrequently. | 401 # template is the oauth client id, which changes very infrequently. |
| 400 self.response.cache_control.no_cache = None | 402 self.response.cache_control.no_cache = None |
| 401 self.response.cache_control.public = True | 403 self.response.cache_control.public = True |
| 402 self.response.cache_control.max_age = 604800 | 404 self.response.cache_control.max_age = 604800 |
| 403 try: | 405 try: |
| 404 self.response.write(template.render( | 406 self.response.write(template.render( |
| 405 'isolate/public_isolate_index.html', params)) | 407 'isolate/public_isolate_index.html', params)) |
| 406 except template.TemplateNotFound: | 408 except template.TemplateNotFound: |
| 407 self.abort(404, 'Page not found.') | 409 self.abort(404, 'Page not found.') |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 def create_application(debug): | 457 def create_application(debug): |
| 456 """Creates the url router. | 458 """Creates the url router. |
| 457 | 459 |
| 458 The basic layouts is as follow: | 460 The basic layouts is as follow: |
| 459 - /restricted/.* requires being an instance administrator. | 461 - /restricted/.* requires being an instance administrator. |
| 460 - /stats/.* has statistics. | 462 - /stats/.* has statistics. |
| 461 """ | 463 """ |
| 462 acl.bootstrap() | 464 acl.bootstrap() |
| 463 template.bootstrap() | 465 template.bootstrap() |
| 464 return webapp2.WSGIApplication(get_routes(), debug=debug) | 466 return webapp2.WSGIApplication(get_routes(), debug=debug) |
| OLD | NEW |