chromium/hstspreload

Allow querying for the preload status of a domain, taking into account ancestor domains.

lgarron opened this issue · 3 comments

From chromium/hstspreload.org#52

Strawman: introduce a new status for this (but don't use it in the database).

april commented

This is tricky to do on the HTTP Observatory, because it can sometimes be surprisingly complicated to find the second-level domain of something. In my own code (which has the preload database), I just take the easy route and walk up the chain:

https://github.com/mozilla/http-observatory/blob/master/httpobs/scanner/analyzer/utils.py#L75

To do it in JS, I'd either need to integrate the Public Suffix List (ugh for such a small thing), or make a whole bunch of calls to the hstspreload API, walking up the domain chain.

I will be traveling a bunch, and this is unlikely to be important enough for me to implement until August.

If you want to have a go at this, I would suggest modifying func (idx IndexedEntries) Get(domain string) (Entry, bool) to:

  • return an enum instead of a bool: not found, exact entry found, ancestor entry found
  • for "ancestor entry found", pass back the matching ancestor entry

@ericlaw1979 Can you close this issue?