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

Side by Side Diff: base_policy/policy-utils.js

Issue 3541011: entd: Add policy signatures (Closed) Base URL: http://git.chromium.org/git/entd.git
Patch Set: Address review comments Created 10 years, 2 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 | « no previous file | bin/entdwife.sh » ('j') | 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) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS 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 /** 5 /**
6 * Check the validity of the policy extension manifest. 6 * Check the validity of the policy extension manifest.
7 * 7 *
8 * This function is invoked by entd before the policy is loaded in order to 8 * This function is invoked by entd before the policy is loaded in order to
9 * check the validity of the extension manifest. If this function returns 9 * check the validity of the extension manifest. If this function returns
10 * false, entd exits and does not restart until the next user logs in. 10 * false, entd exits and does not restart until the next user logs in.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 } 45 }
46 46
47 if (manifest.permissions) { 47 if (manifest.permissions) {
48 perms = manifest.permissions; 48 perms = manifest.permissions;
49 if (typeof perms == "string") 49 if (typeof perms == "string")
50 perms = [ perms ]; 50 perms = [ perms ];
51 51
52 if (!(perms instanceof Array)) 52 if (!(perms instanceof Array))
53 return fail('Invalid type for permissions: ' + perms); 53 return fail('Invalid type for permissions: ' + perms);
54 54
55 if (perms.length != 1 || perms[0].indexOf("http://127.0.0.1") != 0) 55 if (perms.length != 1 || perms[0].indexOf("http://127.0.0.1/") != 0)
56 return fail('Invalid permissions: ' + perms); 56 return fail('Invalid permissions: ' + perms);
57 } 57 }
58 58
59 return true; 59 return true;
60 } 60 }
61 61
62 entd.http.RESPONSE_OK = 200; 62 entd.http.RESPONSE_OK = 200;
63 63
64 /** 64 /**
65 * Policy constructor. 65 * Policy constructor.
(...skipping 1650 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 return str; 1716 return str;
1717 } 1717 }
1718 1718
1719 /** 1719 /**
1720 * Detect a raw string. 1720 * Detect a raw string.
1721 */ 1721 */
1722 util.isRawString = 1722 util.isRawString =
1723 function isRawString(str) { 1723 function isRawString(str) {
1724 return str instanceof String && str.isRaw_ == true; 1724 return str instanceof String && str.isRaw_ == true;
1725 } 1725 }
OLDNEW
« no previous file with comments | « no previous file | bin/entdwife.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698