Documentation
¶
Overview ¶
Package artifact implements the frozen malt.artifact/v0alpha2 compatibility profile published by MALT v0.0.4. New integrations use package protocol's operation-specific resolve and read contracts.
Index ¶
Constants ¶
const Profile = "malt.artifact/v0alpha2"
Profile identifies the frozen artifact contract introduced by MALT v0.0.4. Its operation set is resolve and prove; incompatible extensions require a different serialized profile.
Variables ¶
This section is empty.
Functions ¶
func SchemaNames ¶
func SchemaNames() []string
SchemaNames lists the schemas published by this artifact profile.
func Verify ¶
func Verify(ctx context.Context, req VerifyRequest, verifier malt.ProofVerifier) error
Verify validates the request/artifact envelope and all cryptographic evidence. Resolution is existential: it proves the returned ordered arc chain, not that the execution engine selected a unique or longest chain.
Types ¶
type Artifact ¶
type Artifact struct {
Profile string `json:"profile"`
Operation Operation `json:"operation"`
Root string `json:"root"`
Query Query `json:"query"`
Target string `json:"target"`
RangeSegments []string `json:"range_segments,omitempty"`
ProofList prooflist.ProofList `json:"prooflist"`
}
Artifact binds one request, target, and ProofList under an explicit profile. RangeSegments is populated only for measured-list range proofs.
func NewProveArtifact ¶
func NewProveArtifact(req ProveRequest, result malt.ReadResult) (Artifact, error)
func NewResolveArtifact ¶
type ProveRequest ¶
type ProveRequest struct {
Profile string `json:"profile"`
Root string `json:"root"`
Query Query `json:"query"`
}
ProveRequest asks for one primitive typed map/list proof.
func (ProveRequest) Validate ¶
func (r ProveRequest) Validate() error
type Query ¶
type Query struct {
Kind QueryKind `json:"kind"`
Segments []string `json:"segments,omitempty"`
Index *uint64 `json:"index,omitempty"`
Start *uint64 `json:"start,omitempty"`
End *uint64 `json:"end,omitempty"`
}
Query is the stable artifact projection of a MALT path or primitive typed query. Exactly the fields selected by Kind are meaningful.
func (Query) Equal ¶ added in v0.0.5
Equal reports whether two canonical artifact queries select the same operation input. Callers should validate both queries before relying on the result so irrelevant fields cannot be smuggled through an envelope.
func (Query) MarshalJSON ¶ added in v0.0.5
MarshalJSON emits exactly the fields allowed by the selected query kind. Path queries always carry segments, including the zero-segment identity query required by the published schema.
func (*Query) UnmarshalJSON ¶ added in v0.0.5
UnmarshalJSON enforces the same conditional field set as the published JSON Schema instead of silently ignoring unrelated or unknown query fields.
type ResolveRequest ¶
type ResolveRequest struct {
Profile string `json:"profile"`
Root string `json:"root"`
Segments []string `json:"segments"`
}
ResolveRequest asks an execution engine for one authenticated derivation of a caller-supplied segment path. Candidate selection is not part of the proof contract; the reference engine currently prefers the longest prefix.
func (ResolveRequest) Validate ¶
func (r ResolveRequest) Validate() error
type VerifyRequest ¶
VerifyRequest asks a verifier to validate all artifact bindings and proof evidence without trusting the resolver or gateway that produced it.
func (VerifyRequest) Validate ¶
func (r VerifyRequest) Validate() error