Skip to content

Simplify the mapping of group policies to preferences #48187

@bsclifton

Description

@bsclifton

Test plan

See the support doc and the Chromium doc for more info on enabling policies.

Testing BraveP3AEnabled and BraveStatsPingEnabled

Configure a MITM proxy for these tests.

Disable the BraveP3AEnabled policy (set to 0), keep the BraveStatsPingEnabled policy unset and start the browser. Wait a few minutes. Ensure a request was sent to usage-ping.bsg.brave.com but NOT collector.bsg.brave.com and star-randsrv.bsg.brave.com. Ensure that the Allow privacy-preserving product analytics (P3A) setting is hidden in the settings UI (brave://settings/privacy), but also ensure that the Automatically send daily usage ping to Brave setting is shown.

Test the opposite configuration (BraveP3AEnabled policy unset, BraveStatsPingEnabled disabled (set to 0)). If desired, test other policy combinations.

Testing BraveWebDiscoveryEnabled

Configure a MITM proxy for these tests.

Unset the policy (BraveWebDiscoveryEnabled), start the browser with a fresh profile, enable Web Discovery. Make some Google queries, visit some web pages, wait five minutes. Ensure a request was sent to collector.wdp.brave.com or patterns.wdp.brave.com.

Disable the BraveWebDiscoveryEnabled policy (set to 0). Start the browser with the same profile. Make some Google queries, visit some web pages, wait five minutes. Ensure a request was NOT sent to the hosts above. Ensure that the Web Discovery Project setting is not shown in the settings UI (brave://settings/search).

Test again with the BraveWebDiscoveryNative feature enabled and a fresh profile.

Description

We have Brave-specific group policies which folks can set. A full list can be seen at https://support.brave.app/hc/en-us/articles/360039248271-Group-Policy

Some of these end up having two preferences.

Policies

Some notes

  • Changes for the mapping happen in //brave/browser/policy/brave_simple_policy_map.h
  • When deprecating the older DisabledByPolicy preference, we should be be careful because there are places UI is being hidden. We need to put a comparable check to hide that part of the UI when the preference is managed.
  • There are also automated tests that will need updating.
  • Changing some of these means inverting the value. We'll want to update the policy to be ___Enabled and then update our support page.

Important steps

Besides the changes above, we'll need to do these following steps

  • Update the support page with the new values
  • Uplift fixes to 1.82.x. That is where the existing group policies are currently.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions