| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
looks good, but I am not an expert in what you are doing so maybe we could get another pair of eyes
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
em::PolicyData policy_data;Does it matter if there are residual fields in `policy_data` from the for loop after we exit? I see that we overwrite the policy type and value after the loop, just checking that the other fields aren't important.
std::string username = GetUsername(client_info);
std::string domain = gaia::ExtractDomainName(gaia::SanitizeEmail(username));Nit: let's move these down to where they're used, i.e. above `auto* fetch_response = response->add_responses();`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Does it matter if there are residual fields in `policy_data` from the for loop after we exit? I see that we overwrite the policy type and value after the loop, just checking that the other fields aren't important.
Not really--or at least, I haven't noticed any problems in Chrome and tests still pass.
Keep in mind we don't ship this code to users, so it's not the _end_ of the world if it breaks some weird edge case not covered by tests
std::string username = GetUsername(client_info);
std::string domain = gaia::ExtractDomainName(gaia::SanitizeEmail(username));Nit: let's move these down to where they're used, i.e. above `auto* fetch_response = response->add_responses();`
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
11 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: components/policy/test_support/request_handler_for_policy.cc
Insertions: 2, Deletions: 2.
@@ -442,8 +442,6 @@
// Wrap the uber-proto with PolicyData and add it to the response.
policy_data.set_policy_type(fetch_request.policy_type());
policy_data.set_policy_value(result.SerializeAsString());
- std::string username = GetUsername(client_info);
- std::string domain = gaia::ExtractDomainName(gaia::SanitizeEmail(username));
if (fetch_request.has_settings_entity_id()) {
policy_data.set_settings_entity_id(
fetch_request.extension_ids_and_version(0).extension_id());
@@ -451,6 +449,8 @@
policy_data.clear_settings_entity_id();
}
+ std::string username = GetUsername(client_info);
+ std::string domain = gaia::ExtractDomainName(gaia::SanitizeEmail(username));
auto* fetch_response = response->add_responses();
fetch_response->set_policy_type(fetch_request.policy_type());
return SerializeAndSignPolicyData(policy_data, fetch_request, domain,
```
fake_dmserver: sign extension-install policy response
The policy payload isn't passing all the Validator checks, so
make sure the response:
- Includes the username
- Only has settings_entity_id if it's already in the request
- Is properly signed
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |