DescriptionMalformed PortRange or ThirdPartyAuthConfig should trigger OnPolicyError.
Before this change a malformed value of RemoteAccessHostUdpPortRange policy
(i.e. "123456-blah") was ignored and a default value was used. Similarily for
the 3 third-party-auth-config policies (RemoteAccessHostTokenUrl,
...TokenValidationUrl and ...TokenValidationCertificateIssuer) we were falling
back to a secure default, but not reporting a policy error. After this change
such malformed values will trigger an OnPolicyError callback.
Notes:
- Guaranteeing that PolicyWatcher always returns valid policy values, removes
the need for a "rejecting" Me2MeHostAuthenticatorFactory.
- Moving PortRange and ThirdPartyAuthConfig to separate compilation units
helps readability elsewhere + encourages better unit tests coverage.
- Initially I tried to wrap all policies in a new ChromotingPolicies class,
but eventually went back to prevalidating and passing base::DictionaryValue.
- Arguments for using ChromotingPolicies:
- Helps avoid overtesting in policy_watcher_unittests.cc (i.e. helps focus
the tests on a single policy value).
- Arguments for using base::DictionaryValue:
- Minimizes changes.
- Keeps things simple (as opposed to having to introduce a custom
equivalent of optional<T> [nothing similar present in Chromium AFAICT]).
- Neutral:
- Strong-typing of ChromotingPolicies didn't help readability as much as I
expected and hoped for.
BUG=427513
TEST=remoting_unittests
Committed: https://crrev.com/0d40d8ac2eb00482d8bb24924322f75b980525f1
Cr-Commit-Position: refs/heads/master@{#318910}
Patch Set 1 : #
Total comments: 22
Patch Set 2 : Addressed code review feedback from Sergey. #
Total comments: 16
Patch Set 3 : Addressed code review feedback from Renato. #Patch Set 4 : Fixing a Windows-specific, pre-processor-related build break. #Messages
Total messages: 26 (14 generated)
|