Display schema validation errors for device policies |
|||||||
Issue descriptionIn device_policy_decoder_chromeos.cc: - Make sure all JSON policies go through DecodeJsonStringAndDropUnknownBySchema E.g. DeviceWallpaperImage is not right now. - Pipe error from schema validation through to chrome://policy page Could be as simple as policies->SetError(error)? - NativeDevicePrinters doesn't check whether JSON actually parsed!
,
Jun 26 2018
,
Aug 1
,
Aug 1
,
Aug 23
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/eccc469815f1c55d5d2acd556beaafbbffe1161d commit eccc469815f1c55d5d2acd556beaafbbffe1161d Author: Alexander Hendrich <hendrich@chromium.org> Date: Thu Aug 23 11:40:47 2018 Display schema validation errors This CL makes sure all JSON device policies use DecodeJsonStringAndDropUnknownBySchema to decode the proto and adhere to the associated schema. Unknown properties are dropped. If the json string can't be decoded or does not comply with the associated schema in policy_templates.json, the policy value will be set to the original json string. This way, the faulty value can still be seen in chrome://policy along with any errors/warnings. Bug: 855054 Change-Id: I73a2bc7cc88a293b06339482437f88ac48932b83 Reviewed-on: https://chromium-review.googlesource.com/1163507 Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org> Reviewed-by: Lutz Justen <ljusten@chromium.org> Commit-Queue: Alexander Hendrich <hendrich@chromium.org> Cr-Commit-Position: refs/heads/master@{#585451} [modify] https://crrev.com/eccc469815f1c55d5d2acd556beaafbbffe1161d/chrome/browser/chromeos/BUILD.gn [modify] https://crrev.com/eccc469815f1c55d5d2acd556beaafbbffe1161d/chrome/browser/chromeos/policy/device_policy_decoder_chromeos.cc [modify] https://crrev.com/eccc469815f1c55d5d2acd556beaafbbffe1161d/chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h [add] https://crrev.com/eccc469815f1c55d5d2acd556beaafbbffe1161d/chrome/browser/chromeos/policy/device_policy_decoder_chromeos_unittest.cc [modify] https://crrev.com/eccc469815f1c55d5d2acd556beaafbbffe1161d/chrome/browser/chromeos/settings/device_settings_provider.cc [modify] https://crrev.com/eccc469815f1c55d5d2acd556beaafbbffe1161d/chrome/browser/chromeos/settings/device_settings_provider_unittest.cc
,
Aug 24
,
Sep 4
Hi.. Could you please provide steps if this needs manual verification. Thanks.!
,
Sep 6
Hi Alexander, Could you please confirm that the correct error messages are displaying in chrome://policy (see attached screenshot) for NativePrinters policy: Key "items[0]": Error while parsing JSON value: Line: 1, column: 1, Unexpected token. Key "items[1]": Error while parsing JSON value: Line: 1, column: 1, Unexpected token. Chrome OS: 11021.5.0 Chrome: 70.0.3538.7 Device: Robo360
,
Sep 7
yes this is correct. Thanks for testing!
,
Sep 7
Marked as "Verified", thanks! |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by ljusten@chromium.org
, Jun 21 2018