Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group Policy for controlling sources #841

Merged
merged 21 commits into from
Apr 2, 2021

Conversation

florelis
Copy link
Member

@florelis florelis commented Apr 1, 2021

Adding enforcement of Group Policies for additional required sources and allowed sources. This change includes:

  • Reading of source lists from Group Policy. Each source is specified by a JSON with all its details.
  • A new GroupPolicyException type for reporting errors.
  • Enforcement of the policies when adding and removing sources (only allow adding allowed sources and don't allow removing additional required sources).
  • A source export command to produce the JSON strings used in the policies.
  • Unit tests.

Still pending for Group Policies:

  • E2E tests
  • Use final registry key path, value names, and policy names
Microsoft Reviewers: Open in CodeFlow

@florelis florelis requested a review from a team as a code owner April 1, 2021 21:05
const ValueList::ValueRef& ValueList::const_iterator::operator*() const
{
return m_value.value();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that it matters much for the general use case, but I would err toward making the caller keep the value while they wanted it rather than the iterator getting the value while iterating. If I wanted to skip ahead for some reason this way reads every value anyway.

Copy link
Member

@JohnMcPMS JohnMcPMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving with the assumption that changes to resolve the test failures will be minor.

@florelis
Copy link
Member Author

florelis commented Apr 2, 2021

Two tests failed. One was because in one test for failure adding a disabled default source I needed to add the Type in the test to fit the Arg+Type matching (where I only used the Arg before). The other was because I had a test for the Data+Identifier check after adding the source; I removed the test since that check was removed.

@florelis florelis merged commit 741955e into microsoft:master Apr 2, 2021
@florelis florelis deleted the SourcePolicy branch April 2, 2021 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants