From b4c7c71685a1fcd2139afa36363e9fe908f72b78 Mon Sep 17 00:00:00 2001 From: Mihai Maruseac Date: Wed, 24 Jul 2024 13:00:41 -0700 Subject: [PATCH] Expose reosurce descriptors from manifests We aim this to be similar to in-toto's `ResourceDescriptor`. To support cases where in-toto cannot be directly used, we make this a dataclass that can be mapped to in-toto when needed, and used as its own otherwise. Not all fields from in-toto are specified at this moment. All fields here must be present, unlike in-toto, where all are optional. See https://github.com/in-toto/attestation/blob/main/spec/v1/resource_descriptor.md for the in-toto specification. This is the first separable PR for the signing support (see full draft on #253) Signed-off-by: Mihai Maruseac --- model_signing/test_support.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/model_signing/test_support.py b/model_signing/test_support.py index d41e98b5..c7ad7b1e 100644 --- a/model_signing/test_support.py +++ b/model_signing/test_support.py @@ -43,6 +43,16 @@ ] +# All directory models to use in testing, where only non empty directory models +# are supported. See also `all_test_models` comments. +all_non_empty_directory_test_models = [ + "sample_model_folder", + "deep_model_folder", + "model_folder_with_empty_file", + "symlink_model_folder", +] + + def get_first_directory(path: pathlib.Path) -> pathlib.Path: """Returns the first directory that is a children of path.