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
If we enable securesystemslib type checks (which we can't really yet do because secure-systems-lab/securesystemslib#944), it shows two issues in python-tuf:
tuf/api/serialization/json.py:101: error: Item "None" of "str | None" has no attribute "encode" [union-attr]
This looks trivial to fix: encode_canonical() can return None but only if it's given the output_function argument. We can just do assert canonical_str is not None to silence this
tuf/api/dsse.py:84: error: Incompatible return value type (got "Envelope", expected "SimpleEnvelope[Root]") [return-value]
tuf/api/dsse.py:84: error: Incompatible return value type (got "Envelope", expected "SimpleEnvelope[Timestamp]") [return-value]
tuf/api/dsse.py:84: error: Incompatible return value type (got "Envelope", expected "SimpleEnvelope[Snapshot]") [return-value]
tuf/api/dsse.py:84: error: Incompatible return value type (got "Envelope", expected "SimpleEnvelope[Targets]") [return-value]
not entirely sure how to fix this one: maybe just typing.cast() call?
The text was updated successfully, but these errors were encountered:
I think SimpleEnvelope should not even have the contained type (like Root in SimpleEnvelope[Root]): SimpleEnvelope does not really know what it contains, unlike Metadata.
That said, maybe the fix here is still just a cast
If we enable securesystemslib type checks (which we can't really yet do because secure-systems-lab/securesystemslib#944), it shows two issues in python-tuf:
This looks trivial to fix:
encode_canonical()
can return None but only if it's given the output_function argument. We can just doassert canonical_str is not None
to silence thisnot entirely sure how to fix this one: maybe just
typing.cast()
call?The text was updated successfully, but these errors were encountered: