CrunchyBagel / TracePrivately

A privacy-focused app using Apple's soon-to-be-released contact tracing framework.
MIT License
350 stars 27 forks source link

Abstracting KeyServer calls into adapters #60

Closed HendX closed 4 years ago

HendX commented 4 years ago

@dstotijn This PR adds support for your server type. I'm still working on a few other changes so I haven't merged it back into head yet, but you can use it in TracePrivately by specifying an Adapter value of ct_diag_server in the the KeyServer.plist (there's a sample in KeyServerCtDiagServer.plist).

I think I have the endianness code correct. The relevant file is TracePrivately/Classes/KeyServer/KeyServerCtDiagServerAdapter.swift.

HendX commented 4 years ago

@tatey I'd be interested to get your feedback on this PR - I've added two new (optional) response keys to infected.

  1. min_retry_date - this is a recommendation to the iOS app of when to next try to retrieve keys. Effective for managing server load / rate limiting

  2. list_type - this indicates if the returned list is the entire list or not. This in effect allows cache invalidation in the iOS app. If the value is FULL the client deletes all their existing keys and replaces with these.

I think you can safely ignore implementing these if you don't wish to, and it shouldn't change any functionality.