microsoft / c2pa-extension-validator

Browser extension to validate C2PA digital assets
MIT License
6 stars 2 forks source link

Refresh trustlists on a regular basis #48

Closed christianpaquin closed 1 month ago

christianpaquin commented 1 month ago

Adds an alarm to periodically check if the imported trustlists need refreshing. Every 24h (will be configurable at some point), the extension now downloads each TL, check the last_updated timestamp, and if more recent, replaces the one in the trust store.

To test:

  1. change the periodInMinutes value in background.ts from 1440 to 1 to speed up auto-refresh, and build the extension in debug mode
  2. download the IPTC trust list, remove the CBC cert, change the last_modified date to an earlier date, and import it in the extension.
  3. open the origin test page; the CBC "eclipse" picture should be unknown.
  4. wait 1 minute
  5. see the download console log in the background script. The IPTC TL should be updated to its current version.
  6. check in the CBC picture is now trusted.