You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancementexperimental-clientItems related to the development of a new client (see milestone/8 and theexperimental-client branch)good first issueBite-sized items for first time contributors
What's the intended use case? Would any of the datatypes be more convenient for the caller, that is which datatype would require the least preliminary conversion?
I lean towards making reference_time a datetime object, for consistency with the type of the Metadata expires field. And I'd also make reference_time optional and default to datetime.now().
Fully agreed with both comments. I have a WIP patch that takes a datetime object for reference_time and defaults to datetime.now() when no reference_time is passed.
I believe the motivating use-case is expiration checks in the experimental client, so I'll wait for @sechkova to comment on whether a datetime object is useful.
No strong preferences, the client will use whatever we choose :)
I agree with using datetime objects plus the datetime module seems to be less platform dependent than time (which can be used to return UNIX time).
enhancementexperimental-clientItems related to the development of a new client (see milestone/8 and theexperimental-client branch)good first issueBite-sized items for first time contributors
Activity
sechkova commentedon Mar 12, 2021
tuf.formatsalready provides some convertion functions:https://github.com/theupdateframework/tuf/blob/2c360d0538f73a59854add867234f48a47f7d9a3/tuf/formats.py#L616
https://github.com/theupdateframework/tuf/blob/2c360d0538f73a59854add867234f48a47f7d9a3/tuf/formats.py#L646
joshuagl commentedon Mar 29, 2021
Is a UNIX timestamp the preferred type for
reference_time? Rather than a raw expiration string or a Python datetime object?lukpueh commentedon Mar 29, 2021
What's the intended use case? Would any of the datatypes be more convenient for the caller, that is which datatype would require the least preliminary conversion?
I lean towards making
reference_timea datetime object, for consistency with the type of the Metadataexpiresfield. And I'd also makereference_timeoptional and default todatetime.now().joshuagl commentedon Mar 29, 2021
Fully agreed with both comments. I have a WIP patch that takes a datetime object for
reference_timeand defaults todatetime.now()when noreference_timeis passed.I believe the motivating use-case is expiration checks in the experimental client, so I'll wait for @sechkova to comment on whether a
datetimeobject is useful.sechkova commentedon Mar 29, 2021
No strong preferences, the client will use whatever we choose :)
I agree with using
datetimeobjects plus thedatetimemodule seems to be less platform dependent thantime(which can be used to return UNIX time).Let's make sure we enforce UTC times everywhere.