We did discuss being able to query by arbitrary headers. Was that local only, or has that conversation ever reached the server?
I also can imagine something specific for this particular case. We might introduce a simple language that would allow, for example, defining that a given repair should only be used if some safe expression matches on the local system. But that sounds like something for later.
first of all because these could be large (tens of MBs) there is some discussion whether they would be served through the general assertion service at all,
there is some querying functionality in the server but is not open in general, is used only internally between services, atm external clients can only get single assertions
given that now repairs can tell whether to retry them or not, the issue of having a repair-id such that older than it repairs are not relevant, don’t need to run is less pressing,
though we still don’t want images at first boot to download all repairs that ever existed (though this also shouldn’t be a problem for a while), so we will need a way to have conservative starting points for this that comes with images (through main snaps (core, gadget…), config or some seed data)
btw, we had at some point the idea to have an expiry on repairs, for fixing stuff we agreed it doesn’t make sense, but for the debugging use case assertions it still might
go through (download+execute+decide what to download next) repairs in a sequence one at a time
or have an immediate flag on repairs that means execute me now before going further downloading from the sequence
we can probably postpone this problem until we understand its nature more, by at least implementing
repair skip-to [–brand=BRAND] ID
repair rewind [–brand=BRAND] ID
(strawman syntax), which might make sense anyway, basically giving ourselves the tools to control how to navigate the sequences from the repairs themselves (if needed)
filter whether it’s applicable or not (recording information and decision if not)
If applicable retrieve and verify the full repair (as application/x.ubuntu.assertion) also over HTTPS
When doing HTTPS use for verifying certificates a time given by the max(sys-time, time-lower-bound) (at least in case we got an error about time validity of the cert (not valid yet)).
Where time-lower-bound is obtained by considering the max of:
image creation time (timestamp of seed.yaml for example)
server reported time of previous successful HTTPS requests
timestamp of valid retrieved repairs
possibly time lower bound as kept by snapd itself
If HTTPS still fails (in case of TLS-related reasons) try again from scratch retrieving the full repair over HTTP.