-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ngclient feature: Add option to only update metadata if needed #2225
Comments
Alternatively if this is acceptable to these users: we could start supporting things like |
from an API perspective this is not an issue. One option is: updater = Updater(...)
try:
# try to load with local metadata only
updater.refresh(local_cache_only=True)
except ExpiredMetadataError:
# load normally then
updater.refresh() the other choice would be # lazy_fetch will fetch data from remote but only if the local metadata is not valid
config = UpdaterConfig(lazy_fetch=True)
updater = Updater(..., config=config) the implementation details of either version are unclear, and there are edge cases (like maybe the top-level metadata is valid but a delegated metadata has expired -- and updating timestamp would have fixed that but we don't find out before we actually try to |
So I've de done two design attempts so far...
Maybe there is still a third one:
|
This is not full thought out but I'm filing so it's not forgotten.
https://docs.google.com/document/d/1QWBvpwYxOy9njAmd8vpizNQpPti9rd5ugVhji0r3T4c
Sigstore client wants to use TUF to download files but wants to avoid the two mandatory requests (root N+1, timestamp) on startup if it's not necessary. This seems to be a totally valid feature request: if this is feasible we could offer that as an option.
The WIP sigstore client checks the timestamp expiry before creating an Updater: if timestamp is not expired, the client then decides update is not needed. There could be some issues with this:
these may be partly theoretical worries but it still feels like a hack...
Maybe it is possible to
?
The text was updated successfully, but these errors were encountered: