-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add metadata container classes for signed metadata #272
Comments
In regards to the implementation of de/serialization from and to different wireline formats, as well as canonicalization, what do others prefer? Implement these as different (1) methods on a generic class or use (2) subclassing? E.g.: (1) I have a slight preference for (1) which is why I implemented it that way in tuf#1112. It seems a bit less engineered and also more explicit in it's usage. (2) OTOH might be more flexible and also feels purer in an OOP-sense. Thoughts? |
I have a slight preference for (2), but only because I think it makes it easier for adopters to implement the wireline format they care about in their own project and plug it in to securesystemslib and therefore tuf/in-toto. I'm imagining an interface, much like the |
We have implemented in TUF all of the classes planned for the metadata complex attribute and roles and I think we can reevaluate When we compare tuf Metadata class and In-toto Metablock we can see that the two classes diverge in multiple ways:
Then, the other option is to compare Signed and Signable. Then we see that those two diverge too:
To conclude: I am not sure it will be easy or even that it makes sense to relocate |
Metablock and Metadata are alternative implementations of the same shared concept (a container with signed data and signatures). Switching in-toto to use |
I agree about the positives, but let's see what the in-toto folks think about this @adityasaky, @SantiagoTorres? |
I suspect in-toto's interest may depend on the progress of ITE-6 and how long they intend to retain support for the pre ITE-6 link format. Would certainly be good to hear from in-toto maintainers. |
If I'm not mistaken, the Metablock / Metadata parts are more ITE-5 than ITE-6. I think I'm in favour of using sslib for that, because any upcoming Python support for signing-spec could also naturally be a part of sslib then. I think the signed / signable formats are very project specific though? So worth keeping them in the respective implementations? |
I think it'd be wortwhile to maybe move this class to sslib... This would in fact reflect the intention of ITE-5, which is to dissociate the signature wrapper from the spec, and allow for implementers to use their own (while at the same time blessing the sslib block as a recommended, default format) |
DSSE is in securesystemslib and might replace traditional Metadata at some point. It's not worth to move the two working Metadata implementations from tuf and in-toto Python implementations to securesystemslib. |
Description of issue or feature request:
Both TUF and in-toto use a class based model for their metadata, with a similar signature wrapper class. The signature container (i.e.
Metadata
) and the base class for thesigned
contents (i.e.Signed
) could be hosted insecuresystemslib
to re-use code and to better draw the line between in-toto/tuf concepts and pure cryptographic signing.Current behavior:
No class-based metadata model.
Expected behavior:
Add class-based metadata model.
NOTE: I strongly suggest to adopt the classes that where recently added to TUF (theupdateframework/python-tuf#1112), which were based on the the ones from in-toto but don't use the 3rd-party
attrs
package and slightly streamline the design (most notably see recursive serialisation functionsfrom_dict
andto_dict
).Caveat:
A
from_dict
factory method on a genericMetadata
class needs to know about the specific contained metadata, i.e. the subclass ofSigned
(e.g.tuf.Targets
,tuf.Snapshot
,in_toto.Link, in_toto.Layout
, etc..), which will not be implemented in securesystemslib.Possible solutions:
signed._type
-to-subclass-of-Signed
mapping on theMetadata
classMetadata
in tuf and in-toto and implement the factory there, e.g.class tuf.Metadata(securesystemslib.Metadata)
The text was updated successfully, but these errors were encountered: