Commit 5f1f7971 authored by Brian Malcolm's avatar Brian Malcolm Committed by Commit Bot

Add new PrintersBulkConfiguration policy

This is intended to replace the NativePrintersBulkConfiguration policy.
The old policy will still be used in the absence of the new one for at
least a few releases of Chrome.

BUG=chromium:1113366

Change-Id: If7fb1a53180874a5bd12f081129aed5ffadad443
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340741
Commit-Queue: Brian Malcolm <bmalcolm@chromium.org>
Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797565}
parent 1d6a249c
...@@ -33,7 +33,7 @@ NativePrintersExternalDataHandler::NativePrintersExternalDataHandler( ...@@ -33,7 +33,7 @@ NativePrintersExternalDataHandler::NativePrintersExternalDataHandler(
DeviceLocalAccountPolicyService* policy_service) DeviceLocalAccountPolicyService* policy_service)
: native_printers_observer_(cros_settings, : native_printers_observer_(cros_settings,
policy_service, policy_service,
key::kNativePrintersBulkConfiguration, key::kPrintersBulkConfiguration,
this) { this) {
native_printers_observer_.Init(); native_printers_observer_.Init();
} }
......
...@@ -173,7 +173,7 @@ class EnterprisePrintersProviderImpl : public EnterprisePrintersProvider, ...@@ -173,7 +173,7 @@ class EnterprisePrintersProviderImpl : public EnterprisePrintersProvider,
user_printers_is_complete_ = user_printers_is_complete_ =
user_printers_->IsComplete() && user_printers_->IsComplete() &&
(user_printers_->IsDataPolicySet() || (user_printers_->IsDataPolicySet() ||
!PolicyWithDataIsSet(policy::key::kNativePrintersBulkConfiguration)); !PolicyWithDataIsSet(policy::key::kPrintersBulkConfiguration));
} }
void RecalculateCompleteFlagForDevicePrinters() { void RecalculateCompleteFlagForDevicePrinters() {
......
...@@ -1719,7 +1719,7 @@ std::unique_ptr<ConfigurationPolicyHandlerList> BuildHandlerList( ...@@ -1719,7 +1719,7 @@ std::unique_ptr<ConfigurationPolicyHandlerList> BuildHandlerList(
handlers->AddHandler( handlers->AddHandler(
std::make_unique<ExternalDataPolicyHandler>(key::kWallpaperImage)); std::make_unique<ExternalDataPolicyHandler>(key::kWallpaperImage));
handlers->AddHandler(std::make_unique<ExternalDataPolicyHandler>( handlers->AddHandler(std::make_unique<ExternalDataPolicyHandler>(
key::kNativePrintersBulkConfiguration)); key::kPrintersBulkConfiguration));
handlers->AddHandler( handlers->AddHandler(
std::make_unique<ExternalDataPolicyHandler>(key::kExternalPrintServers)); std::make_unique<ExternalDataPolicyHandler>(key::kExternalPrintServers));
handlers->AddHandler(std::make_unique<ExternalDataPolicyHandler>( handlers->AddHandler(std::make_unique<ExternalDataPolicyHandler>(
......
...@@ -229,6 +229,9 @@ void ProfilePolicyConnector::Init( ...@@ -229,6 +229,9 @@ void ProfilePolicyConnector::Init(
policy::key::kNoteTakingAppsLockScreenAllowlist)); policy::key::kNoteTakingAppsLockScreenAllowlist));
migrators.push_back(std::make_unique<LegacyChromePolicyMigrator>( migrators.push_back(std::make_unique<LegacyChromePolicyMigrator>(
policy::key::kDeviceUserWhitelist, policy::key::kDeviceUserAllowlist)); policy::key::kDeviceUserWhitelist, policy::key::kDeviceUserAllowlist));
migrators.push_back(std::make_unique<LegacyChromePolicyMigrator>(
policy::key::kNativePrintersBulkConfiguration,
policy::key::kPrintersBulkConfiguration));
ConfigurationPolicyProvider* user_policy_delegate_candidate = ConfigurationPolicyProvider* user_policy_delegate_candidate =
configuration_policy_provider ? configuration_policy_provider configuration_policy_provider ? configuration_policy_provider
......
...@@ -619,6 +619,7 @@ ...@@ -619,6 +619,7 @@
}, },
"NativePrintersBulkConfiguration": { "NativePrintersBulkConfiguration": {
"note": "This policy is deprecated, see http://crbug.com/1113366.",
"os": ["chromeos"], "os": ["chromeos"],
"policy_pref_mapping_test": [ "policy_pref_mapping_test": [
{ {
...@@ -632,6 +633,20 @@ ...@@ -632,6 +633,20 @@
] ]
}, },
"PrintersBulkConfiguration": {
"os": ["chromeos"],
"policy_pref_mapping_test": [
{
"policies": {
"PrintersBulkConfiguration": {
"url": "https://example.com/policyfile",
"hash": "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"
}
}
}
]
},
"NativePrintersBulkAccessMode": { "NativePrintersBulkAccessMode": {
"os": ["chromeos"], "os": ["chromeos"],
"policy_pref_mapping_test": [ "policy_pref_mapping_test": [
......
...@@ -1036,6 +1036,7 @@ ...@@ -1036,6 +1036,7 @@
'NativePrintersBulkBlacklist', 'NativePrintersBulkBlacklist',
'NativePrintersBulkWhitelist', 'NativePrintersBulkWhitelist',
'Printers', 'Printers',
'PrintersBulkConfiguration',
'DeviceNativePrinters', 'DeviceNativePrinters',
'DeviceNativePrintersAccessMode', 'DeviceNativePrintersAccessMode',
'DeviceNativePrintersBlacklist', 'DeviceNativePrintersBlacklist',
...@@ -15077,6 +15078,7 @@ ...@@ -15077,6 +15078,7 @@
'dynamic_refresh': True, 'dynamic_refresh': True,
'per_profile': True, 'per_profile': True,
}, },
'deprecated': True,
'example_value': { 'example_value': {
"url": "https://example.com/printerpolicy", "url": "https://example.com/printerpolicy",
"hash": "deadbeefdeadbeefdeadbeefdeadbeefdeafdeadbeefdeadbeef" "hash": "deadbeefdeadbeefdeadbeefdeadbeefdeafdeadbeefdeadbeef"
...@@ -15097,7 +15099,46 @@ ...@@ -15097,7 +15099,46 @@
If you set this policy, users cannot change or override it. If you set this policy, users cannot change or override it.
This policy has no effect on whether users can configure printers on individual devices. It is intended to be supplementary to the configuration of printers by individual users. This policy has no effect on whether users can configure printers on individual devices. It is intended to be supplementary to the configuration of printers by individual users.
''',
This policy is deprecated, please use <ph name="PRINTERS_BULK_CONFIGURATION">PrintersBulkConfiguration</ph> instead.''',
},
{
'name': 'PrintersBulkConfiguration',
'owners': ['file://chromeos/printing/OWNERS'],
'id': 770,
'type': 'external',
'schema': {
'type': 'object',
'properties': {
'url': { 'type': 'string' },
'hash': { 'type': 'string' }
},
},
'supported_on': ['chrome_os:86-'],
'features': {
'dynamic_refresh': True,
'per_profile': True,
},
'example_value': {
"url": "https://example.com/printerpolicy",
"hash": "deadbeefdeadbeefdeadbeefdeadbeefdeafdeadbeefdeadbeef"
},
'max_size': 5242880,
'caption': '''Enterprise printer configuration file''',
'tags': [],
'desc': '''Provides configurations for enterprise printers.
This policy allows you to provide printer configurations to <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> devices. The format is the same as the <ph name="PRINTERS_POLICY_NAME">Printers</ph> dictionary, with an additional required "id" or "guid" field per printer for allowing or blocking.
The size of the file must not exceed 5MB and must be encoded in JSON. It is estimated that a file containing approximately 21,000 printers will encode as a 5MB file. The cryptographic hash is used to verify the integrity of the download.
The file is downloaded and cached. It will be re-downloaded whenever the URL or the hash changes.
If this policy is set, <ph name="PRODUCT_OS_NAME">$2<ex>Google Chrome OS</ex></ph> will download the file for printer configurations and make printers available in accordance with <ph name="PRINTERS_BULK_ACCESS_MODE">PrintersBulkAccessMode</ph>, <ph name="PRINTERS_BULK_ALLOWLIST">PrintersBulkAllowlist</ph>, and <ph name="PRINTERS_BULK_BLOCKLIST">PrintersBulkBlocklist</ph>.
If you set this policy, users cannot change or override it.
This policy has no effect on whether users can configure printers on individual devices. It is intended to be supplementary to the configuration of printers by individual users.''',
}, },
{ {
'name': 'NativePrintersBulkAccessMode', 'name': 'NativePrintersBulkAccessMode',
...@@ -23898,6 +23939,6 @@ The recommended way to configure policy on Windows is via GPO, although provisio ...@@ -23898,6 +23939,6 @@ The recommended way to configure policy on Windows is via GPO, although provisio
], ],
'placeholders': [], 'placeholders': [],
'deleted_policy_ids': [412, 476, 546, 562, 569, 578], 'deleted_policy_ids': [412, 476, 546, 562, 569, 578],
'highest_id_currently_used': 769, 'highest_id_currently_used': 770,
'highest_atomic_group_id_currently_used': 40 'highest_atomic_group_id_currently_used': 40
} }
...@@ -21417,6 +21417,7 @@ Called by update_document_policy_enum.py.--> ...@@ -21417,6 +21417,7 @@ Called by update_document_policy_enum.py.-->
<int value="767" label="InsecurePrivateNetworkRequestsAllowedForUrls"/> <int value="767" label="InsecurePrivateNetworkRequestsAllowedForUrls"/>
<int value="768" label="UserPrintersAllowed"/> <int value="768" label="UserPrintersAllowed"/>
<int value="769" label="Printers"/> <int value="769" label="Printers"/>
<int value="770" label="PrintersBulkConfiguration"/>
</enum> </enum>
<enum name="EnterprisePolicyDeviceIdValidity"> <enum name="EnterprisePolicyDeviceIdValidity">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment