Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Resolve bug in validation of a chrome_policy resource with multiple schema_values of differing type - #472

Open
w0de wants to merge 2 commits into
hashicorp:mainfrom
w0de:hashicorp
Open

Resolve bug in validation of a chrome_policy resource with multiple schema_values of differing type#472
w0de wants to merge 2 commits into
hashicorp:mainfrom
w0de:hashicorp

Conversation

@w0de

@w0de w0de commented Nov 16, 2023

Copy link
Copy Markdown

Seeks to resolve #471

changes

Validation of chrome policy schema_values now expects there to always be exactly one proto field for any given schema_value. Previously all values were validated iteratively against all proto fields. This change seems reasonable - I don't believe it breaks an edge case. My test workspace's full policy schema does not have any schemas with conflicting field names.

But I'm unsure why the validation was first written this way. Concerning - Chesteron's fence, etc. (Git blame points to the initial commit only.) It may simply be a mistake which arose from a misunderstanding of (or changes in) schema structure. Or the misunderstanding may turn out to be mine :)!

I've added a relevant test case.

@w0de
w0de requested a review from a team as a code owner November 16, 2023 21:26
@w0de w0de changed the title Resolve bug in validation of a chrome_policy resource with multiple schema_values of differing types bug Resolve bug in validation of a chrome_policy resource with multiple schema_values of differing type Nov 16, 2023
@toddthiel

Copy link
Copy Markdown

Would be good to get eyes on this issue. It's still a problem.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If a policy schema has two or more fields of differing types, googleworkspace_chrome_policy validation may erroneously fail.

2 participants