-
Notifications
You must be signed in to change notification settings - Fork 276
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
metadata api: Signed.expires string representation should not contain microseconds #1678
Comments
yeah this is definitely not ideal. I suppose there are two options:
In both cases we could also:
these steps would make it easier for Metadata to not be in a state where it doesn't quite match the form it gets serialized into... |
Good point! I guess, I'm fine either way. Losing (negligible) precision during serialisation doesn't seem like a big deal, and I don't think there is a realistic use case where this leads to unexpected behaviour. But yes, erroring seems safer. Regardless, I'm all for providing the convenience setter you propose. OTOH, I'm a little bit reserved about changing the signature of init, i.e. s/expires/expires_in/, because I think the |
Can I take this please? |
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
This change removes microseconds from expiry in order to fit TUF specification Fixes theupdateframework#1678 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
Description of issue or feature request:
In
signed._common_fields_to_dict
we convert the value of the datetime object inSigned.expires
to a date-time string.From the TUF spec:
If the original datetime object contained microseconds, the date-time string representation of
Signed.expires
will too.Reproducer:
Current output:
Expected behavior:
Proposed fix 1:
Proposed fix 2:
The text was updated successfully, but these errors were encountered: