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

Unified Diff: chrome/browser/policy/test/policy_testserver.py

Issue 12538009: Public Sessions: fetch device robot api token during enterprise enrollment. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: updated tests Created 7 years, 8 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: chrome/browser/policy/test/policy_testserver.py
diff --git a/chrome/browser/policy/test/policy_testserver.py b/chrome/browser/policy/test/policy_testserver.py
index 6c1fbe1a1edfa36e08991b43bf6021e98cbfe444..9eeacb8a66ca06894dc9701755e98f67244b4431 100644
--- a/chrome/browser/policy/test/policy_testserver.py
+++ b/chrome/browser/policy/test/policy_testserver.py
@@ -202,6 +202,8 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return (400, 'Invalid request parameter')
if request_type == 'register':
return self.ProcessRegister(rmsg.register_request)
+ if request_type == 'api_authorization':
+ return self.ProcessApiAuthorization(rmsg.service_api_access_request)
elif request_type == 'unregister':
return self.ProcessUnregister(rmsg.unregister_request)
elif request_type == 'policy' or request_type == 'ping':
@@ -292,6 +294,25 @@ class PolicyRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
return (200, response.SerializeToString())
+ def ProcessApiAuthorization(self, msg):
+ """Handles an API authorization request.
+
+ Args:
+ msg: The DeviceServiceApiAccessRequest message received from the client.
+
+ Returns:
+ A tuple of HTTP status code and response data to send to the client.
+ """
+
+ # Prepare and send the response.
+ response = dm.DeviceManagementResponse()
+ response.service_api_access_response.CopyFrom(
+ dm.DeviceServiceApiAccessResponse())
Mattias Nissler (ping if slow) 2013/04/22 10:59:00 Don't you need to put an access code string here t
David Roche 2013/04/23 01:36:08 Done.
+
+ self.DumpMessage('Response', response)
+
+ return (200, response.SerializeToString())
+
def ProcessUnregister(self, msg):
"""Handles a register request.

Powered by Google App Engine
This is Rietveld 408576698