Skip to content

Commit

Permalink
Expose reosurce descriptors from manifests
Browse files Browse the repository at this point in the history
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 <mihaimaruseac@google.com>
  • Loading branch information
mihaimaruseac committed Jul 26, 2024
1 parent 2198c9d commit b4c7c71
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions model_signing/test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b4c7c71

Please sign in to comment.