Mntor 5363 - #6818
Conversation
| PwnCount: breach.PwnCount, | ||
| AddedDate: breach.AddedDate, | ||
| DataClasses: breach.DataClasses, | ||
| // The panel hides these, the credential manager may not. |
There was a problem hiding this comment.
this is where I'm adding the new property to the remote settings
| breach.Domain !== "" && | ||
| breach.DataClasses.includes("Passwords") && | ||
| (breach.DataClasses.includes(HibpLabelByDataType.Passwords) || | ||
| breach.DataClasses.includes(HibpLabelByDataType.Email)) && |
There was a problem hiding this comment.
this is where we widen what we send to remote settings to include email data
There was a problem hiding this comment.
question: What will happen if an older FF client receives data w/ this data class? Presumably just ignores the email ones? Or do older clients consume the OpenAPI spec?
There was a problem hiding this comment.
@joeherm Older Firefox password-manager clients will ignore email-only records.
You can see it here: https://searchfox.org/firefox-main/source/browser/components/aboutlogins/LoginBreaches.sys.mjs
_breachInvolvedPasswords(breach) {
return (
breach.hasOwnProperty("DataClasses") &&
breach.DataClasses.includes("Passwords")
);
}
Extra fields like IsSensitive are ignored. DataClasses is already an unconstrained string array in the collection schema, so "Email addresses" is a new value, not a new shape.
bc57f1e to
1087f24
Compare
joeherm
left a comment
There was a problem hiding this comment.
Code change LGTM- but left a question about the impact on older FF clients.
| breach.Domain !== "" && | ||
| breach.DataClasses.includes("Passwords") && | ||
| (breach.DataClasses.includes(HibpLabelByDataType.Passwords) || | ||
| breach.DataClasses.includes(HibpLabelByDataType.Email)) && |
There was a problem hiding this comment.
question: What will happen if an older FF client receives data w/ this data class? Presumably just ignores the email ones? Or do older clients consume the OpenAPI spec?
4426a56 to
138b06e
Compare
HIBP spells data classes differently to us, and the difference is not mechanical: pins is PINs, ip-addresses is IP addresses, and General is ours alone. Nothing in the codebase recorded that, and I found it confusing. I was concerned that the next person needing it would write the naive transform and be silently wrong for two of thirteen. The Omit makes a missing or misspelled key a compile error. Also documents what distinguishes the three data type lookups, which sit next to each other and are VERY easy to confuse.
The type said keyof HibpBreachDataTypes, which is the keys of our own lookup, but HIBP sends its own Title Case labels. What originally tripped me up is t only ever compiled because "Passwords" is both a key and a real label, and that was the only value any code compared against. `string`` is used , and not something narrower because 163 distinct labels appear across real breaches and we name only 12 of them. So a narrower type would reject valid data. The narrow type already exists a layer down on `HibpLikeDbBreach`, once formatDataClass has converted at ingestion. Both fields now carry a comment, since they share a name and differ only in vocabulary. Which would have originally helped me.
fxmonitor-breaches is how Firefox learns a site was breached, and it held password breaches only, so an email-only breach was invisible and the privacy panel could never render it. IsSensitive ships in the same change because the cron only POSTs records it has not seen and never updates them, so a record that lands without the flag never gets it. Sensitive breaches stay in the collection on purpose: as the panel must hide them, while the credential manager may not.
138b06e to
7cad22c
Compare
References:
Jira: MNTOR-5363
Description
We are going to be iterating on our openapi.yml contract, which is defined between the frontend and the backend for a breach integration. To achieve that with a thin and simple API, we'll be relying Remote Setting data that is already being pushed. That dataset requires two new pieces of infromation:
IsSensitiveis a property straight from HIBP. The privacy panel must not surface a sensitive breach, and today no field tells it which ones those are. We flag rather than filter at the sync, because the credential manager is allowed to show them.This PR modifies the periodic cron that pushes this data to include this.
How to test
Checklist (Definition of Done)
BreachDataTypes,ResolutionRelevantBreachDataTypesandHibpLabelByDataType, which sit together and were easy to confuse.Follow Up Action
I believe we'll need another team to modify the Remote Settings schema and display fields, to declare
IsSensitiveas a property. I believe this can be done after this PR is merged, and likely by possibly Daniel's team?