status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
726 stars 246 forks source link

Add link preview "trusted domains" feature #4132

Open igor-sirotin opened 1 year ago

igor-sirotin commented 1 year ago

Problem

There's UI requirement to have "trust this domain" popup: https://github.com/status-im/status-desktop/issues/12388 This domains list should be implemented in status-go, stored in the database and also synced over different installations.

Implementation

To support this, we need these new endpoints in status-go:

The data should be stored in a separate TrustedDomains table with a single domain column. I'm not yet sure what's the best way to implement syncing here. If we should sync the whole table, or row-by-row. Maybe we also need a clock for syncing.

jrainville commented 6 months ago

It might be good to have a function to getAllTrusted domains too. In Desktop, it's probably worth to cache those and not have to get it from status-go each time.

Though it could be added later. We just need to make sure that if we use IsTrustedDomain, we need to call it async.