-
Notifications
You must be signed in to change notification settings - Fork 277
Metadata API: rethink the expiry related API #1727
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
Comments
Some additional detail here
|
#1712 is about handling microseconds with a |
(Edited to change example to a property instead of a method) One possibility:
# set expiry to seven days from now
signed.expiry = utcnow() + relativedelta(day=7) I think I'm fine with this. |
3 tasks
Done as per #1712.
Agreed!
I think that's fair. |
I have a PR in the queue. Will publish tomorrow. |
lukpueh
added a commit
to lukpueh/tuf
that referenced
this issue
Dec 21, 2021
TODO: - Update tests - Make property docs render on RTD? Signed-off-by: Lukas Puehringer <[email protected]>
lukpueh
added a commit
to lukpueh/tuf
that referenced
this issue
Dec 22, 2021
Remove `bump_expiration()` method, which is unlikely to be used as is, i.e. bump to "current expiration date plus delta". A more realistic use case is to bump to "now plus delta" (see theupdateframework#1727 for details). Moreover, bump_expiration can either way easily be replaced by a one-liner expression using the 'datetime' module. A corresponding code snippet is added to the `expires` property's docstring. Note: `expires` became a property with a millisec-removing setter (for spec conformance) in theupdateframework#1712, which further reduces the need for a convenience bump_expiration method. This patch also removes a related unit test and updates another one. Signed-off-by: Lukas Puehringer <[email protected]>
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of issue or feature request:
In a recent discussion (see discussion in #1722) we reevaluated the need for
Singed.bump_expiry()
as instead of using the API:one can just do:
As a side benefit this will allow the user to use
dateutil.relativedelta
which is not supported bySinged.bump_expiry
as of #1726.The text was updated successfully, but these errors were encountered: