Documentation
¶
Overview ¶
Package validate checks AI Catalog documents against the specification and detects their conformance level (Minimal, Discoverable, Trusted).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶ added in v0.3.0
type Code string
Code is a stable identifier for a kind of diagnostic. Match on it rather than on the message text.
const ( CodeSpecVersion Code = "spec-version" CodeHostMember Code = "host-member-missing" CodeEntryMember Code = "entry-member-missing" CodeEntryArtifact Code = "entry-artifact-source" CodeEntryDuplicate Code = "entry-duplicate" CodeEntryVersion Code = "entry-version-conflict" CodeIdentifierNotURI Code = "identifier-not-uri" CodeTimestamp Code = "timestamp-invalid" CodePublisherMember Code = "publisher-member-missing" CodeExtensionKey Code = "extension-key-invalid" CodeNestedDepth Code = "nested-depth-exceeded" CodeNestedInvalid Code = "nested-catalog-invalid" CodeDigestInvalid Code = "digest-invalid" CodeSignatureForm Code = "signature-form" CodeSignatureMalformed Code = "signature-malformed" CodeSignatureAlgorithm Code = "signature-algorithm-forbidden" CodeSignatureB64 Code = "signature-b64" CodeSignatureUnlisted Code = "signature-algorithm-unlisted" )
Catalog, host and entry rules.
const ( CodeManifestIdentity Code = "manifest-identity-missing" CodeManifestIdentityURI Code = "manifest-identity-not-uri" CodeManifestEmpty Code = "manifest-not-substantive" CodeManifestSignedMember Code = "manifest-member-missing" CodeManifestExpired Code = "manifest-expired" CodeSubjectMember Code = "subject-member-missing" CodeSubjectMismatch Code = "subject-mismatch" CodeTrustSchemaMember Code = "trust-schema-member-missing" CodeAttestationMember Code = "attestation-member-missing" CodeProvenanceMember Code = "provenance-member-missing" )
Trust manifest rules.
const ( CodeProfileIdentifier Code = "profile-identifier" CodeProfileIdentity Code = "profile-identity" CodeProfileType Code = "profile-identity-type" CodeProfileAlgorithm Code = "profile-algorithm" CodeProfileKeyID Code = "profile-key-id" CodeProfileHeader Code = "profile-header-member" )
did:web Publisher Profile rules. They are warnings that keep the catalog from Trusted.
type ConformanceLevel ¶
type ConformanceLevel int
ConformanceLevel is the AI Catalog conformance level a document satisfies.
const ( // Minimal is a document with errors, or without a host. Minimal ConformanceLevel = iota // Discoverable is a valid document with a host. Discoverable // Trusted is a Discoverable document in which every root entry trust // manifest is signed, bound to its entry, unexpired and conforms to the // did:web Publisher Profile. Signatures are not verified. Trusted )
func (ConformanceLevel) String ¶
func (l ConformanceLevel) String() string
String returns the lowercase name of the conformance level.
type Diagnostic ¶
Diagnostic is a single validation error or warning.
type Option ¶ added in v0.3.0
type Option func(*config)
Option customizes Validate.
func WithClock ¶ added in v0.3.0
WithClock sets the clock used to decide whether a trust manifest has expired.
func WithMaxNestingDepth ¶ added in v0.3.0
WithMaxNestingDepth sets how deeply catalogs may nest. The default is 4.
type Result ¶
type Result struct {
// IsValid reports whether the document has no validation errors.
IsValid bool
// ConformanceLevel is the highest level the document satisfies.
ConformanceLevel ConformanceLevel
// Errors are conformance-breaking problems.
Errors []Diagnostic
// Warnings are advisory problems, including did:web profile violations.
Warnings []Diagnostic
}
Result is the outcome of validating an AI Catalog document.