This repository was archived by the owner on Jun 30, 2025. It is now read-only.
Handle LABEL_REPEATED proto Label in type validation - #336
Open
Yohan460 wants to merge 1 commit into
Open
Conversation
Yohan460
force-pushed
the
chrome_policy_arrays
branch
from
June 29, 2022 22:41
986cb26 to
49ade44
Compare
Author
|
This PR should be ready for review |
SarahFrench
requested review from
SarahFrench
and removed request for
SarahFrench
July 5, 2022 16:30
Author
|
Seems like unit test failure is a CI issue and unrelated to my change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When defining chrome policies and doing the field interpretation the
labelproto field has the option of being returned as aLABEL_REPEATEDwhich requires the value to be an array of the defined type.This PR fixes the validation function upon the
labelbeing thatLABEL_REPEATEDoption as well as adds some more verbose erroring to call out specific values not complying with the spec.An example chrome policy schema with hits this issue is the
chrome.users.UrlBlockingpolicy which has the following definitionAllowing the following resource definitions to work