Skip to content

Commit dcf4dd9

Browse files
committed
add policy templates patch
1 parent 4e68775 commit dcf4dd9

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

infra/Fix-policy-templates.patch

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
diff --git a/components/policy/tools/template_writers/writer_configuration.py b/components/policy/tools/template_writers/writer_configuration.py
2+
index 8cb77158561d3..edd529b4753de 100755
3+
--- a/components/policy/tools/template_writers/writer_configuration.py
4+
+++ b/components/policy/tools/template_writers/writer_configuration.py
5+
@@ -10,9 +10,6 @@ def GetConfigurationForBuild(defines):
6+
7+
Args:
8+
defines: Definitions coming from the build system.
9+
-
10+
- Raises:
11+
- Exception: If 'defines' contains an unknown build-type.
12+
'''
13+
# The prefix of key names in config determines which writer will use their
14+
# corresponding values:
15+
@@ -24,45 +21,7 @@ def GetConfigurationForBuild(defines):
16+
# Google:Cat_Google references the external google.admx file.
17+
# category_path_strings strings in curly braces are looked up from localized
18+
# 'messages' in policy_templates.json.
19+
- if '_chromium' in defines:
20+
- config = {
21+
- 'build': 'chromium',
22+
- 'app_name': 'Chromium',
23+
- 'doc_url': 'https://chromeenterprise.google/policies/',
24+
- 'frame_name': 'Chromium Frame',
25+
- 'os_name': 'ChromiumOS',
26+
- 'webview_name': 'Chromium WebView',
27+
- 'win_config': {
28+
- 'win': {
29+
- 'reg_mandatory_key_name': 'Software\\Policies\\Chromium',
30+
- 'reg_recommended_key_name':
31+
- 'Software\\Policies\\Chromium\\Recommended',
32+
- 'mandatory_category_path': ['chromium'],
33+
- 'recommended_category_path': ['chromium_recommended'],
34+
- 'category_path_strings': {
35+
- 'chromium': 'Chromium',
36+
- 'chromium_recommended': 'Chromium - {doc_recommended}',
37+
- },
38+
- 'namespace': 'Chromium.Policies.Chromium',
39+
- },
40+
- 'chrome_os': {
41+
- 'reg_mandatory_key_name': 'Software\\Policies\\ChromiumOS',
42+
- 'reg_recommended_key_name':
43+
- 'Software\\Policies\\ChromiumOS\\Recommended',
44+
- 'mandatory_category_path': ['chromium_os'],
45+
- 'recommended_category_path': ['chromium_os_recommended'],
46+
- 'category_path_strings': {
47+
- 'chromium_os': 'ChromiumOS',
48+
- 'chromium_os_recommended': 'ChromiumOS - {doc_recommended}',
49+
- },
50+
- 'namespace': 'Chromium.Policies.ChromiumOS'
51+
- },
52+
- },
53+
- 'admx_prefix': 'chromium',
54+
- 'linux_policy_path': '/etc/chromium/policies/',
55+
- 'bundle_id': 'org.chromium',
56+
- }
57+
- elif '_google_chrome' in defines or '_is_chrome_for_testing_branded' in defines:
58+
+ if defines.get('_google_chrome', False) == True or defines.get('_is_chrome_for_testing_branded', False) == True:
59+
linux_policy_path = '/etc/opt/chrome/policies/' if '_google_chrome' in defines else '/etc/opt/chrome_for_testing/policies/'
60+
config = {
61+
'build': 'chrome',
62+
@@ -121,7 +80,43 @@ def GetConfigurationForBuild(defines):
63+
'bundle_id': 'com.google.chrome.ios',
64+
}
65+
else:
66+
- raise Exception('Unknown build')
67+
+ config = {
68+
+ 'build': 'thorium',
69+
+ 'app_name': 'Thorium',
70+
+ 'doc_url': 'https://chromeenterprise.google/policies/',
71+
+ 'frame_name': 'Thorium Frame',
72+
+ 'os_name': 'ThoriumOS',
73+
+ 'webview_name': 'Thorium WebView',
74+
+ 'win_config': {
75+
+ 'win': {
76+
+ 'reg_mandatory_key_name': 'Software\\Policies\\Thorium',
77+
+ 'reg_recommended_key_name':
78+
+ 'Software\\Policies\\Thorium\\Recommended',
79+
+ 'mandatory_category_path': ['chromium'],
80+
+ 'recommended_category_path': ['chromium_recommended'],
81+
+ 'category_path_strings': {
82+
+ 'chromium': 'Thorium',
83+
+ 'chromium_recommended': 'Thorium - {doc_recommended}',
84+
+ },
85+
+ 'namespace': 'Chromium.Policies.Thorium',
86+
+ },
87+
+ 'chrome_os': {
88+
+ 'reg_mandatory_key_name': 'Software\\Policies\\ThoriumOS',
89+
+ 'reg_recommended_key_name':
90+
+ 'Software\\Policies\\ThoriumOS\\Recommended',
91+
+ 'mandatory_category_path': ['chromium_os'],
92+
+ 'recommended_category_path': ['chromium_os_recommended'],
93+
+ 'category_path_strings': {
94+
+ 'chromium_os': 'ThoriumOS',
95+
+ 'chromium_os_recommended': 'ThoriumOS - {doc_recommended}',
96+
+ },
97+
+ 'namespace': 'Chromium.Policies.ThoriumOS'
98+
+ },
99+
+ },
100+
+ 'admx_prefix': 'thorium',
101+
+ 'linux_policy_path': '/etc/thorium/policies/',
102+
+ 'bundle_id': 'org.chromium.Thorium',
103+
+ }
104+
if 'version' in defines:
105+
config['version'] = defines['version']
106+
if 'major_version' in defines:

0 commit comments

Comments
 (0)