New issue
Advanced search Search tips

Issue 856903 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Closed: Aug 27
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Bug



Sign in to add a comment

policy: Check that properties in 'required' are in the 'properties' object.

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

Issue description

There are two places where we need to check this:

1. //components/policy/tools/generate_policy_source.py when generating the c++ structs from policy_template.json
2. //components/json_schema/json_schema_validator.cc when validating a schema
 

Comment 1 by pmarko@chromium.org, Jun 27 2018

Does this require triage or is it clear that this will be done / who will do it?

Also, is there value in checking this in 2. if 1. is always run at compile time anyway?
Labels: Enterprise-Triaged
Owner: ljusten@chromium.org
Status: Assigned (was: Untriaged)
I'll take it.
Owner: hendrich@chromium.org
Project Member

Comment 4 by bugdroid1@chromium.org, Aug 13

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

commit 7aaf9dbf524c43452769ffe58f2a436de1741946
Author: Alexander Hendrich <hendrich@chromium.org>
Date: Mon Aug 13 09:03:00 2018

Check that properties in 'required' are in the 'properties' object.

Verifiy that all 'required' properties in a policy schema are actually
existing in 'properties' as well.

Bug:  856903 
Test: components_unittests --gtest_filter=JSONSchemaValidator.*
Change-Id: Ie8c3ff8ac82bcb3c436cfb580721070050b66b22
Reviewed-on: https://chromium-review.googlesource.com/1165361
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Commit-Queue: Alexander Hendrich <hendrich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582533}
[modify] https://crrev.com/7aaf9dbf524c43452769ffe58f2a436de1741946/components/json_schema/json_schema_validator.cc
[modify] https://crrev.com/7aaf9dbf524c43452769ffe58f2a436de1741946/components/json_schema/json_schema_validator_unittest.cc
[modify] https://crrev.com/7aaf9dbf524c43452769ffe58f2a436de1741946/components/policy/tools/generate_policy_source.py

Project Member

Comment 5 by bugdroid1@chromium.org, Aug 22

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

commit bf75bad5d18f8190981830d28e8eec257d300e43
Author: Alexander Hendrich <hendrich@chromium.org>
Date: Wed Aug 22 14:02:20 2018

Add python schema validator

This CL adds a python schema validator that can validate JSON schemas.
The schema validator is used in a presubmit to validate all the schemas
in policy_templates.json. The schema validator itself supports the
minimal set of features needed for our current policies.

Bug:  873641 ,  856903 ,  856901 
Change-Id: Ie577e825807e4438eca6921722b88af7c8d1781c
Reviewed-on: https://chromium-review.googlesource.com/1172433
Commit-Queue: Alexander Hendrich <hendrich@chromium.org>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585003}
[add] https://crrev.com/bf75bad5d18f8190981830d28e8eec257d300e43/components/policy/tools/schema_validator.py
[modify] https://crrev.com/bf75bad5d18f8190981830d28e8eec257d300e43/components/policy/tools/syntax_check_policy_template_json.py

Status: Fixed (was: Assigned)
Please provide steps if this requires manual verification. Thanks.! 
Status: Assigned (was: Fixed)
Labels: Needs-Feedback
hendrich@ Could you please help us with repro steps to verify the fix on #70.0.3534.0
Labels: -Needs-Feedback
Status: Verified (was: Assigned)
Sorry, this doesn't need manual verfication as it is a presubmit check only. 

Sign in to add a comment