Skip to content

Implement Mandatory Created and Opened Actions #586

@gpeacock

Description

@gpeacock

Ensure that we only create created or opened manifests.

With v2 claims, every manifest must either be a created manifest with a known digitalSourceType or a opened manifest with a valid parent ingredient. The API should prevent you from creating a manifest that is not one of these. It should be an error.

My proposal is that users can still manually create a manifest with the right components if they really know what they are doing. But, when signing, if we don't recognize a valid created manifest we will attempt to use the source asset as the parent and create the associated parent ingredient and opened assertion. The default generated ingredient and assertion will have limited information, but enough to be valid. If a user desires to add more information, they must either add the parent themselves or I may provide some default action fields (another topic).

We will always assume an opened manifest unless the user has provided us with acknown digitalSourceType. Rather than force them to predefine the created action correctly, we could allow a new creation_type field in the manifest defintion. If specified, it would need to have one of a specific enumerated set of values. A similar option would be to have a new builder constructor such as Builder::created(SourceType)

If an opened manifest needs to supply a different parent than the source image, they will need to set the parent ingredient before signing. This is often the case when an image has been modified so we need to capture original image as the parent and the source image will be the modified one. I may provide a Builder constructor for this case as well:
Builder::opened(source, format)

I'm not sure, with all the new changes, if we still need to provide a manifest definition when creating a builder. Many of the fields in the definition can now be provided in the setting - such as the claim-generator-info. If the builder allows for add_assertion and add_ingredient, there isn't much else to set. I've been toying around with a add_action method that would simplify a lot of the work with actions. Of course something like c2patool would still need a way to pass a full manifest.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions