def get_document_namespace(image_obj): '''Given the image object, return a unique SPDX document uri. This is a combination of the tool name and version, the image name and the uuid''' return json_formats.document_namespace.format( version=get_git_rev_or_version()[1], image=image_obj.name, uuid=spdx_common.get_uuid())
def get_document_namespace_snapshot(timestamp): """Get the document namespace for the container image snapshot. We pass the timestamp so we have a common timestamp across the whole document""" return json_formats.document_namespace_snapshot.format( timestamp=timestamp, uuid=spdx_common.get_uuid())