New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 850009 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 2
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

policy: Enforce the 'required' field in policy_templates.json

Project Member Reported by ortuno@chromium.org, Jun 6 2018

Issue description

In policy_templates.json there are some dictionary policies that have a "required" field. Even when specified, this field is not actually enforced i.e. providing a policy that omits the properties specified in 'required' will not trigger any errors.

It would be nice if this field was actually enforced. I'm currently adding a dictionary policy that would benefit from it. As it is today, I will have to write my own ConfigurationPolicyHandler to enforce the dictionary contains the required properties.
 
Owner: ortuno@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 22 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a9cb9fd415b9812d4cf48ad185b56710b088f530

commit a9cb9fd415b9812d4cf48ad185b56710b088f530
Author: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Date: Fri Jun 22 04:01:05 2018

policy: Use raw strings to avoid escaping quotes

Changes strings to use R"(...)" to avoid escaping quotes in schemas.

Bug:  850009 
Change-Id: Icbb0b8640fa9b9abb5373a834b5b3051ce3f5e4e
Reviewed-on: https://chromium-review.googlesource.com/1109313
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569530}
[modify] https://crrev.com/a9cb9fd415b9812d4cf48ad185b56710b088f530/components/policy/core/common/schema_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Jul 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/17c9d423b88c24bfbe7c70da46db813569d6118d

commit 17c9d423b88c24bfbe7c70da46db813569d6118d
Author: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Date: Mon Jul 02 04:03:30 2018

policy: Enforce 'required' field for dictionary policies

Changed generate_policy_source.py to also parse the "required" field
of dictionary policies and also changes schema.cc to check that all
required properties are included in the policy.

Bug:  850009 
Change-Id: I466236a9439383b3e0a330f277eebc50d72305be
Reviewed-on: https://chromium-review.googlesource.com/1090521
Reviewed-by: calamity <calamity@chromium.org>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Giovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571812}
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/json_schema/json_schema_constants.cc
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/json_schema/json_schema_constants.h
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/json_schema/json_schema_validator.cc
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/json_schema/json_schema_validator_unittest.cc
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/policy/core/common/schema.cc
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/policy/core/common/schema.h
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/policy/core/common/schema_internal.h
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/policy/core/common/schema_unittest.cc
[modify] https://crrev.com/17c9d423b88c24bfbe7c70da46db813569d6118d/components/policy/tools/generate_policy_source.py

Status: Fixed (was: Started)

Sign in to add a comment