divviup / janus

Experimental implementation of the Distributed Aggregation Protocol (DAP) specification.
Mozilla Public License 2.0
51 stars 14 forks source link

`janus_client`: Cache HPKE configs based on `cache-control` header #3159

Open tgeoghegan opened 1 month ago

tgeoghegan commented 1 month ago

Unless configs are provided to the builder, janus_client will fetch leader and helper HPKE configurations during construction and use them indefinitely, ignoring whatever cache-control HTTP header the aggregator may have provided. This is fine, since janus_client is generally used ephemerally and so whatever keys it sees will almost certainly remain valid for the lifetime in memory of the structure. But it'd be nice if we supported caching keys and automatically refetching them when they expire.

This is only particularly useful if keys are being stored somewhere besides memory, so we would want to introduce some kind of storage/cache abstraction for janus_client to use.

tgeoghegan commented 1 month ago

If we do this for DAP HPKE configs, we should also do it for OHTTP keys.