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

Side by Side Diff: net/tools/testserver/device_management.py

Issue 12082102: Add DeviceRegisterRequest.BROWSER and use it for chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review feedback. Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/policy/user_cloud_policy_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """A bare-bones test server for testing cloud policy support. 5 """A bare-bones test server for testing cloud policy support.
6 6
7 This implements a simple cloud policy test server that can be used to test 7 This implements a simple cloud policy test server that can be used to test
8 chrome's device management service client. The policy information is read from 8 chrome's device management service client. The policy information is read from
9 the file named device_management in the server's data directory. It contains 9 the file named device_management in the server's data directory. It contains
10 enforced and recommended policies for the device and user scope, and a list 10 enforced and recommended policies for the device and user scope, and a list
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 device_id: The device identifier provided by the client. 623 device_id: The device identifier provided by the client.
624 624
625 Returns: 625 Returns:
626 The newly generated device token for the device. 626 The newly generated device token for the device.
627 """ 627 """
628 dmtoken_chars = [] 628 dmtoken_chars = []
629 while len(dmtoken_chars) < 32: 629 while len(dmtoken_chars) < 32:
630 dmtoken_chars.append(random.choice('0123456789abcdef')) 630 dmtoken_chars.append(random.choice('0123456789abcdef'))
631 dmtoken = ''.join(dmtoken_chars) 631 dmtoken = ''.join(dmtoken_chars)
632 allowed_policy_types = { 632 allowed_policy_types = {
633 dm.DeviceRegisterRequest.USER: ['google/chromeos/user', 633 dm.DeviceRegisterRequest.BROWSER: ['google/chrome/user'],
634 'google/chrome/user'], 634 dm.DeviceRegisterRequest.USER: ['google/chromeos/user'],
635 dm.DeviceRegisterRequest.DEVICE: [ 635 dm.DeviceRegisterRequest.DEVICE: [
636 'google/chromeos/device', 636 'google/chromeos/device',
637 'google/chromeos/publicaccount' 637 'google/chromeos/publicaccount'
638 ], 638 ],
639 dm.DeviceRegisterRequest.TT: ['google/chromeos/user', 639 dm.DeviceRegisterRequest.TT: ['google/chromeos/user',
640 'google/chrome/user'], 640 'google/chrome/user'],
641 } 641 }
642 if machine_id in KIOSK_MACHINE_IDS: 642 if machine_id in KIOSK_MACHINE_IDS:
643 enrollment_mode = dm.DeviceRegisterResponse.RETAIL 643 enrollment_mode = dm.DeviceRegisterResponse.RETAIL
644 else: 644 else:
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 return self._registered_tokens.get(dmtoken, None) 676 return self._registered_tokens.get(dmtoken, None)
677 677
678 def UnregisterDevice(self, dmtoken): 678 def UnregisterDevice(self, dmtoken):
679 """Unregisters a device identified by the given DM token. 679 """Unregisters a device identified by the given DM token.
680 680
681 Args: 681 Args:
682 dmtoken: The device management token provided by the client. 682 dmtoken: The device management token provided by the client.
683 """ 683 """
684 if dmtoken in self._registered_tokens.keys(): 684 if dmtoken in self._registered_tokens.keys():
685 del self._registered_tokens[dmtoken] 685 del self._registered_tokens[dmtoken]
OLDNEW
« no previous file with comments | « chrome/browser/policy/user_cloud_policy_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698