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

Side by Side Diff: appengine/isolate/ui/res/imp/index/isolate-index-demo.html

Issue 2991303002: Add in OAuth authentication to Isolate Polymer UI (Closed)
Patch Set: Fix GET request for server_details Created 3 years, 4 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 unified diff | Download patch
OLDNEW
1 <!-- 1 <!--
2 # Copyright 2017 The LUCI Authors. All rights reserved. 2 # Copyright 2017 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed by the Apache v2.0 license that can be 3 # Use of this source code is governed by the Apache v2.0 license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 --> 5 -->
6 <!DOCTYPE html> 6 <!DOCTYPE html>
7 <html> 7 <html>
8 <head> 8 <head>
9 <title>Isolate index Demo</title> 9 <title>Isolate index Demo</title>
10 <meta charset="utf-8"> 10 <meta charset="utf-8">
11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 11 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
12 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial- scale=1, user-scalable=yes"> 12 <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial- scale=1, user-scalable=yes">
13 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri pt> 13 <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></scri pt>
14 <script src="../../../node_modules/skia-common-js/common.js"></script> 14 <script src="../../../node_modules/skia-common-js/common.js"></script>
15 15
16 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script> 16 <script src="../../../node_modules/sinon/pkg/sinon-1.17.5.js"></script>
17 17
18 18
19 <script type="text/javascript" charset="utf-8"> 19 <script type="text/javascript" charset="utf-8">
20 sinon.format = function(object) {return JSON.stringify(object);} 20 sinon.format = function(object) {return JSON.stringify(object);}
21 sinon.log = function(message) {console.log(message);}; 21 sinon.log = function(message) {console.log(message);};
22 var server = sinon.fakeServer.create(); 22 var server = sinon.fakeServer.create();
23 server.autoRespondAfter = 1200; 23 server.autoRespondAfter = 1200;
24 server.autoRespond = true; 24 server.autoRespond = true;
25 25
26 var details = {
27 server_version: "1234-deadbeef",
28 bot_version: "abcdoeraymeyouandme",
29 };
30
31 var respond = function(request){
32 if (!request.requestHeaders.authorization) {
33 sinon.log("You must be logged in (check your Oauth?)");
34 request.respond(403, {}, "You must be logged in (check your Oauth?)");
35 return;
36 }
37 sinon.log("User authenticated :) "+ request.requestHeaders.authorization);
38 request.respond(200, {"Content-Type":"application/json"}, JSON.stringify(d etails));
39 }
40
41 server.respondWith("GET", /^\/_ah\/api\/isolateservice\/v1\/server_details/ , respond);
42
26 43
27 </script> 44 </script>
28 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> 45 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html">
29 <link rel="import" href="isolate-index.html"> 46 <link rel="import" href="isolate-index.html">
30 </head> 47 </head>
31 <body> 48 <body>
32 49
33 <isolate-index 50 <isolate-index
34 client_id="540429983429-ftq2fch22a9puv03lj7sffhvh0e9962r.apps.googleuserconten t.com"> 51 client_id="540429983429-ftq2fch22a9puv03lj7sffhvh0e9962r.apps.googleuserconten t.com">
35 </isolate-index> 52 </isolate-index>
36 53
37 </body> 54 </body>
38 </html> 55 </html>
OLDNEW
« no previous file with comments | « appengine/isolate/ui/res/imp/index/isolate-index.html ('k') | appengine/isolate/ui/res/imp/shared » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698