diff options
author | lukasza <lukasza@chromium.org> | 2015-03-03 10:36:28 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-03 18:38:00 +0000 |
commit | 0d40d8ac2eb00482d8bb24924322f75b980525f1 (patch) | |
tree | de2403d43da6dfa75c1d6ec8e1071dbc14cd746c /remoting/remoting_test.gypi | |
parent | 3a2bce8a5ebccb99596ac4f3c05b86912b96469c (diff) | |
download | chromium_src-0d40d8ac2eb00482d8bb24924322f75b980525f1.zip chromium_src-0d40d8ac2eb00482d8bb24924322f75b980525f1.tar.gz chromium_src-0d40d8ac2eb00482d8bb24924322f75b980525f1.tar.bz2 |
Malformed 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
Review URL: https://codereview.chromium.org/966433002
Cr-Commit-Position: refs/heads/master@{#318910}
Diffstat (limited to 'remoting/remoting_test.gypi')
-rw-r--r-- | remoting/remoting_test.gypi | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/remoting/remoting_test.gypi b/remoting/remoting_test.gypi index 2c34855..89336060 100644 --- a/remoting/remoting_test.gypi +++ b/remoting/remoting_test.gypi @@ -187,6 +187,7 @@ 'host/setup/oauth_helper_unittest.cc', 'host/setup/pin_validator_unittest.cc', 'host/shaped_desktop_capturer_unittest.cc', + 'host/third_party_auth_config_unittest.cc', 'host/token_validator_factory_impl_unittest.cc', 'host/video_frame_pump_unittest.cc', 'host/video_frame_recorder_unittest.cc', @@ -214,8 +215,8 @@ 'protocol/monitored_video_stub_unittest.cc', 'protocol/mouse_input_filter_unittest.cc', 'protocol/negotiating_authenticator_unittest.cc', - 'protocol/network_settings_unittest.cc', 'protocol/pairing_registry_unittest.cc', + 'protocol/port_range_unittest.cc', 'protocol/ppapi_module_stub.cc', 'protocol/ssl_hmac_channel_authenticator_unittest.cc', 'protocol/third_party_authenticator_unittest.cc', |