manifestdefinition

package
v0.0.0-...-a26b6bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2025 License: Apache-2.0, MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actor

type Actor struct {
	// List of references to W3C Verifiable Credentials.
	Credentials []HashedUri `json:"credentials,omitempty" yaml:"credentials,omitempty" mapstructure:"credentials,omitempty"`

	// An identifier for a human actor, used when the "type" is
	// `humanEntry.identified`.
	Identifier *string `json:"identifier,omitempty" yaml:"identifier,omitempty" mapstructure:"identifier,omitempty"`
}

Identifies a person responsible for an action.

type AssertionData

type AssertionData interface{}

type AssertionDefinition

type AssertionDefinition struct {
	// Data corresponds to the JSON schema field "data".
	Data AssertionDefinitionData `json:"data" yaml:"data" mapstructure:"data"`

	// Label corresponds to the JSON schema field "label".
	Label string `json:"label" yaml:"label" mapstructure:"label"`
}

type AssertionDefinitionData

type AssertionDefinitionData interface{}

type AssetType

type AssetType struct {
	// Type corresponds to the JSON schema field "type".
	Type string `json:"type" yaml:"type" mapstructure:"type"`

	// Version corresponds to the JSON schema field "version".
	Version *string `json:"version,omitempty" yaml:"version,omitempty" mapstructure:"version,omitempty"`
}

type ClaimGeneratorInfo

type ClaimGeneratorInfo struct {
	// hashed URI to the icon (either embedded or remote)
	Icon interface{} `json:"icon,omitempty" yaml:"icon,omitempty" mapstructure:"icon,omitempty"`

	// A human readable string naming the claim_generator
	Name string `json:"name" yaml:"name" mapstructure:"name"`

	// A human readable string of the product's version
	Version *string `json:"version,omitempty" yaml:"version,omitempty" mapstructure:"version,omitempty"`

	AdditionalProperties interface{}
}

Description of the claim generator, or the software used in generating the claim.

This structure is also used for actions softwareAgent

type Coordinate

type Coordinate struct {
	// The coordinate along the x-axis.
	X float64 `json:"x" yaml:"x" mapstructure:"x"`

	// The coordinate along the y-axis.
	Y float64 `json:"y" yaml:"y" mapstructure:"y"`
}

An x, y coordinate used for specifying vertices in polygons.

type DataSource

type DataSource struct {
	// A list of [`Actor`]s associated with this source.
	Actors []Actor `json:"actors,omitempty" yaml:"actors,omitempty" mapstructure:"actors,omitempty"`

	// A human-readable string giving details about the source of the assertion data.
	Details *string `json:"details,omitempty" yaml:"details,omitempty" mapstructure:"details,omitempty"`

	// A value from among the enumerated list indicating the source of the assertion.
	Type string `json:"type" yaml:"type" mapstructure:"type"`
}

A description of the source for assertion data

type DateT

type DateT string

type Frame

type Frame struct {
	// The end of the frame inclusive or the end of the asset if not present.
	End *int `json:"end,omitempty" yaml:"end,omitempty" mapstructure:"end,omitempty"`

	// The start of the frame or the end of the asset if not present.
	//
	// The first frame/page starts at 0.
	Start *int `json:"start,omitempty" yaml:"start,omitempty" mapstructure:"start,omitempty"`
}

A frame range representing starting and ending frames or pages.

If both `start` and `end` are missing, the frame will span the entire asset.

type HashedUri

type HashedUri struct {
	// Alg corresponds to the JSON schema field "alg".
	Alg *string `json:"alg,omitempty" yaml:"alg,omitempty" mapstructure:"alg,omitempty"`

	// Hash corresponds to the JSON schema field "hash".
	Hash []int `json:"hash" yaml:"hash" mapstructure:"hash"`

	// Url corresponds to the JSON schema field "url".
	Url string `json:"url" yaml:"url" mapstructure:"url"`
}

Hashed Uri structure as defined by C2PA spec It is annotated to produce the correctly tagged cbor serialization

type Ingredient

type Ingredient struct {
	// The active manifest label (if one exists).
	//
	// If this ingredient has a [`ManifestStore`], this will hold the label of the
	// active [`Manifest`].
	//
	// [`Manifest`]: crate::Manifest [`ManifestStore`]: crate::ManifestStore
	ActiveManifest *string `json:"active_manifest,omitempty" yaml:"active_manifest,omitempty" mapstructure:"active_manifest,omitempty"`

	// A reference to the actual data of the ingredient.
	Data interface{} `json:"data,omitempty" yaml:"data,omitempty" mapstructure:"data,omitempty"`

	// Additional information about the data's type to the ingredient V2 structure.
	DataTypes []AssetType `json:"data_types,omitempty" yaml:"data_types,omitempty" mapstructure:"data_types,omitempty"`

	// Additional description of the ingredient.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// Document ID from `xmpMM:DocumentID` in XMP metadata.
	DocumentId *string `json:"document_id,omitempty" yaml:"document_id,omitempty" mapstructure:"document_id,omitempty"`

	// The format of the source file as a MIME type.
	Format string `json:"format,omitempty" yaml:"format,omitempty" mapstructure:"format,omitempty"`

	// An optional hash of the asset to prevent duplicates.
	Hash *string `json:"hash,omitempty" yaml:"hash,omitempty" mapstructure:"hash,omitempty"`

	// URI to an informational page about the ingredient or its data.
	InformationalURI *string `json:"informational_URI,omitempty" yaml:"informational_URI,omitempty" mapstructure:"informational_URI,omitempty"`

	// Instance ID from `xmpMM:InstanceID` in XMP metadata.
	InstanceId *string `json:"instance_id,omitempty" yaml:"instance_id,omitempty" mapstructure:"instance_id,omitempty"`

	// A [`ManifestStore`] from the source asset extracted as a binary C2PA blob.
	//
	// [`ManifestStore`]: crate::ManifestStore
	ManifestData interface{} `json:"manifest_data,omitempty" yaml:"manifest_data,omitempty" mapstructure:"manifest_data,omitempty"`

	// Any additional [`Metadata`] as defined in the C2PA spec.
	//
	// [`Manifest`]: crate::Manifest
	Metadata interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`

	// URI from `dcterms:provenance` in XMP metadata.
	Provenance *string `json:"provenance,omitempty" yaml:"provenance,omitempty" mapstructure:"provenance,omitempty"`

	// Set to `ParentOf` if this is the parent ingredient.
	//
	// There can only be one parent ingredient in the ingredients.
	Relationship interface{} `json:"relationship,omitempty" yaml:"relationship,omitempty" mapstructure:"relationship,omitempty"`

	// Resources corresponds to the JSON schema field "resources".
	Resources interface{} `json:"resources,omitempty" yaml:"resources,omitempty" mapstructure:"resources,omitempty"`

	// A thumbnail image capturing the visual state at the time of import.
	//
	// A tuple of thumbnail MIME format (i.e. `image/jpeg`) and binary bits of the
	// image.
	Thumbnail interface{} `json:"thumbnail,omitempty" yaml:"thumbnail,omitempty" mapstructure:"thumbnail,omitempty"`

	// A human-readable title, generally source filename.
	Title string `json:"title" yaml:"title" mapstructure:"title"`

	// Validation results.
	ValidationStatus []ValidationStatus `json:"validation_status,omitempty" yaml:"validation_status,omitempty" mapstructure:"validation_status,omitempty"`
}

An `Ingredient` is any external asset that has been used in the creation of an image.

type ManifestDefinitionSchemaJson

type ManifestDefinitionSchemaJson struct {
	// A list of assertions
	Assertions []AssertionDefinition `json:"assertions,omitempty" yaml:"assertions,omitempty" mapstructure:"assertions,omitempty"`

	// Clam Generator Info is always required with at least one entry
	ClaimGeneratorInfo []ClaimGeneratorInfo `json:"claim_generator_info,omitempty" yaml:"claim_generator_info,omitempty" mapstructure:"claim_generator_info,omitempty"`

	// The format of the source file as a MIME type.
	Format string `json:"format,omitempty" yaml:"format,omitempty" mapstructure:"format,omitempty"`

	// A List of ingredients
	Ingredients []Ingredient `json:"ingredients,omitempty" yaml:"ingredients,omitempty" mapstructure:"ingredients,omitempty"`

	// Instance ID from `xmpMM:InstanceID` in XMP metadata.
	InstanceId string `json:"instance_id,omitempty" yaml:"instance_id,omitempty" mapstructure:"instance_id,omitempty"`

	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`

	// Optional manifest metadata
	Metadata []Metadata `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`

	// A list of redactions - URIs to a redacted assertions
	Redactions []string `json:"redactions,omitempty" yaml:"redactions,omitempty" mapstructure:"redactions,omitempty"`

	// Thumbnail corresponds to the JSON schema field "thumbnail".
	Thumbnail interface{} `json:"thumbnail,omitempty" yaml:"thumbnail,omitempty" mapstructure:"thumbnail,omitempty"`

	// A human-readable title, generally source filename.
	Title *string `json:"title,omitempty" yaml:"title,omitempty" mapstructure:"title,omitempty"`

	// Optional prefix added to the generated Manifest Label This is typically
	// Internet domain name for the vendor (i.e. `adobe`)
	Vendor *string `json:"vendor,omitempty" yaml:"vendor,omitempty" mapstructure:"vendor,omitempty"`
}

A Manifest Definition This is used to define a manifest and is used to build a ManifestStore A Manifest is a collection of ingredients and assertions It is used to define a claim that can be signed and embedded into a file

type Metadata

type Metadata struct {
	// DataSource corresponds to the JSON schema field "dataSource".
	DataSource interface{} `json:"dataSource,omitempty" yaml:"dataSource,omitempty" mapstructure:"dataSource,omitempty"`

	// DateTime corresponds to the JSON schema field "dateTime".
	DateTime interface{} `json:"dateTime,omitempty" yaml:"dateTime,omitempty" mapstructure:"dateTime,omitempty"`

	// Reference corresponds to the JSON schema field "reference".
	Reference interface{} `json:"reference,omitempty" yaml:"reference,omitempty" mapstructure:"reference,omitempty"`

	// RegionOfInterest corresponds to the JSON schema field "regionOfInterest".
	RegionOfInterest interface{} `json:"regionOfInterest,omitempty" yaml:"regionOfInterest,omitempty" mapstructure:"regionOfInterest,omitempty"`

	// ReviewRatings corresponds to the JSON schema field "reviewRatings".
	ReviewRatings []ReviewRating `json:"reviewRatings,omitempty" yaml:"reviewRatings,omitempty" mapstructure:"reviewRatings,omitempty"`

	AdditionalProperties interface{}
}

The Metadata structure can be used as part of other assertions or on its own to reference others

type Range

type Range struct {
	// A frame range.
	Frame interface{} `json:"frame,omitempty" yaml:"frame,omitempty" mapstructure:"frame,omitempty"`

	// A spatial range.
	Shape interface{} `json:"shape,omitempty" yaml:"shape,omitempty" mapstructure:"shape,omitempty"`

	// A textual range.
	Text interface{} `json:"text,omitempty" yaml:"text,omitempty" mapstructure:"text,omitempty"`

	// A temporal range.
	Time interface{} `json:"time,omitempty" yaml:"time,omitempty" mapstructure:"time,omitempty"`

	// The type of range of interest.
	Type interface{} `json:"type" yaml:"type" mapstructure:"type"`
}

A spatial, temporal, frame, or textual range describing the region of interest.

type RangeType

type RangeType interface{}

The type of range for the region of interest.

type RegionOfInterest

type RegionOfInterest struct {
	// A free-text string.
	Description *string `json:"description,omitempty" yaml:"description,omitempty" mapstructure:"description,omitempty"`

	// A free-text string representing a machine-readable, unique to this assertion,
	// identifier for the region.
	Identifier *string `json:"identifier,omitempty" yaml:"identifier,omitempty" mapstructure:"identifier,omitempty"`

	// Additional information about the asset.
	Metadata interface{} `json:"metadata,omitempty" yaml:"metadata,omitempty" mapstructure:"metadata,omitempty"`

	// A free-text string representing a human-readable name for the region which
	// might be used in a user interface.
	Name *string `json:"name,omitempty" yaml:"name,omitempty" mapstructure:"name,omitempty"`

	// A range describing the region of interest for the specific asset.
	Region []Range `json:"region" yaml:"region" mapstructure:"region"`

	// A value from our controlled vocabulary or an entity-specific value (e.g.,
	// com.litware.coolArea) that represents the role of a region among other regions.
	Role interface{} `json:"role,omitempty" yaml:"role,omitempty" mapstructure:"role,omitempty"`

	// A value from a controlled vocabulary such as
	// <https://cv.iptc.org/newscodes/imageregiontype/> or an entity-specific value
	// (e.g., com.litware.newType) that represents the type of thing(s) depicted by a
	// region.
	//
	// Note this field serializes/deserializes into the name `type`.
	Type *string `json:"type,omitempty" yaml:"type,omitempty" mapstructure:"type,omitempty"`
}

A region of interest within an asset describing the change.

This struct can be used from [`Action::changes`][crate::assertions::Action::changes] or [`Metadata::region_of_interest`][crate::assertions::Metadata::region_of_interest].

type Relationship

type Relationship string
const RelationshipComponentOf Relationship = "componentOf"
const RelationshipInputTo Relationship = "inputTo"
const RelationshipParentOf Relationship = "parentOf"

type ResourceRef

type ResourceRef struct {
	// The algorithm used to hash the resource (if applicable).
	Alg *string `json:"alg,omitempty" yaml:"alg,omitempty" mapstructure:"alg,omitempty"`

	// More detailed data types as defined in the C2PA spec.
	DataTypes []AssetType `json:"data_types,omitempty" yaml:"data_types,omitempty" mapstructure:"data_types,omitempty"`

	// The mime type of the referenced resource.
	Format string `json:"format" yaml:"format" mapstructure:"format"`

	// The hash of the resource (if applicable).
	Hash *string `json:"hash,omitempty" yaml:"hash,omitempty" mapstructure:"hash,omitempty"`

	// A URI that identifies the resource as referenced from the manifest.
	//
	// This may be a JUMBF URI, a file path, a URL or any other string. Relative JUMBF
	// URIs will be resolved with the manifest label. Relative file paths will be
	// resolved with the base path if provided.
	Identifier string `json:"identifier" yaml:"identifier" mapstructure:"identifier"`
}

A reference to a resource to be used in JSON serialization.

The underlying data can be read as a stream via [`Reader::resource_to_stream`][crate::Reader::resource_to_stream].

type ResourceStore

type ResourceStore struct {
	// Label corresponds to the JSON schema field "label".
	Label *string `json:"label,omitempty" yaml:"label,omitempty" mapstructure:"label,omitempty"`

	// Resources corresponds to the JSON schema field "resources".
	Resources ResourceStoreResources `json:"resources" yaml:"resources" mapstructure:"resources"`
}

Resource store to contain binary objects referenced from JSON serializable structures

type ResourceStoreResources

type ResourceStoreResources map[string][]int

type ReviewRating

type ReviewRating struct {
	// Code corresponds to the JSON schema field "code".
	Code *string `json:"code,omitempty" yaml:"code,omitempty" mapstructure:"code,omitempty"`

	// Explanation corresponds to the JSON schema field "explanation".
	Explanation string `json:"explanation" yaml:"explanation" mapstructure:"explanation"`

	// Value corresponds to the JSON schema field "value".
	Value int `json:"value" yaml:"value" mapstructure:"value"`
}

A rating on an Assertion.

See <https://c2pa.org/specifications/specifications/1.0/specs/C2PA_Specification.html#_claim_review>.

type Role

type Role interface{}

A role describing the region.

type Shape

type Shape struct {
	// The height of a rectnagle.
	//
	// This field can be ignored for circles and polygons.
	Height *float64 `json:"height,omitempty" yaml:"height,omitempty" mapstructure:"height,omitempty"`

	// If the range is inside the shape.
	//
	// The default value is true.
	Inside *bool `json:"inside,omitempty" yaml:"inside,omitempty" mapstructure:"inside,omitempty"`

	// THe origin of the coordinate in the shape.
	Origin interface{} `json:"origin" yaml:"origin" mapstructure:"origin"`

	// The type of shape.
	Type interface{} `json:"type" yaml:"type" mapstructure:"type"`

	// The type of unit for the shape range.
	Unit interface{} `json:"unit" yaml:"unit" mapstructure:"unit"`

	// The vertices of the polygon.
	//
	// This field can be ignored for rectangles and circles.
	Vertices []Coordinate `json:"vertices,omitempty" yaml:"vertices,omitempty" mapstructure:"vertices,omitempty"`

	// The width for rectangles or diameter for circles.
	//
	// This field can be ignored for polygons.
	Width *float64 `json:"width,omitempty" yaml:"width,omitempty" mapstructure:"width,omitempty"`
}

A spatial range representing rectangle, circle, or a polygon.

type ShapeType

type ShapeType interface{}

The type of shape for the range.

type Text

type Text struct {
	// The ranges of text to select.
	Selectors []TextSelectorRange `json:"selectors" yaml:"selectors" mapstructure:"selectors"`
}

A textual range representing multiple (possibly discontinuous) ranges of text.

type TextSelector

type TextSelector struct {
	// The end character offset or the end of the fragment if not present.
	End *int `json:"end,omitempty" yaml:"end,omitempty" mapstructure:"end,omitempty"`

	// Fragment identifier as per RFC3023 (XML) or ISO 32000-2 (PDF), Annex O.
	Fragment string `json:"fragment" yaml:"fragment" mapstructure:"fragment"`

	// The start character offset or the start of the fragment if not present.
	Start *int `json:"start,omitempty" yaml:"start,omitempty" mapstructure:"start,omitempty"`
}

Selects a range of text via a fragment identifier.

This is modeled after the W3C Web Annotation selector model.

type TextSelectorRange

type TextSelectorRange struct {
	// The end of the text range.
	End interface{} `json:"end,omitempty" yaml:"end,omitempty" mapstructure:"end,omitempty"`

	// The start (or entire) text range.
	Selector interface{} `json:"selector" yaml:"selector" mapstructure:"selector"`
}

One or two [`TextSelector`]TextSelector identifiying the range to select.

type Time

type Time struct {
	// The end time or the end of the asset if not present.
	End *string `json:"end,omitempty" yaml:"end,omitempty" mapstructure:"end,omitempty"`

	// The start time or the start of the asset if not present.
	Start *string `json:"start,omitempty" yaml:"start,omitempty" mapstructure:"start,omitempty"`

	// The type of time.
	Type interface{} `json:"type,omitempty" yaml:"type,omitempty" mapstructure:"type,omitempty"`
}

A temporal range representing a starting time to an ending time.

type TimeType

type TimeType interface{}

The type of time.

type UnitType

type UnitType interface{}

The type of unit for the range.

type UriOrResource

type UriOrResource interface{}

type ValidationStatus

type ValidationStatus struct {
	// Code corresponds to the JSON schema field "code".
	Code string `json:"code" yaml:"code" mapstructure:"code"`

	// Explanation corresponds to the JSON schema field "explanation".
	Explanation *string `json:"explanation,omitempty" yaml:"explanation,omitempty" mapstructure:"explanation,omitempty"`

	// Url corresponds to the JSON schema field "url".
	Url *string `json:"url,omitempty" yaml:"url,omitempty" mapstructure:"url,omitempty"`
}

A `ValidationStatus` struct describes the validation status of a specific part of a manifest.

See <https://c2pa.org/specifications/specifications/1.0/specs/C2PA_Specification.html#_existing_manifests>.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL