evidence

package
v1.324.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(root any, path string, decoder string) (any, error)

Types

type Bundle

type Bundle struct {
	RawRequestObject            map[string]any `json:"raw_request_object,omitempty"`
	DecodedRequestObject        map[string]any `json:"decoded_request_object,omitempty"`
	RawPresentationResponse     map[string]any `json:"raw_presentation_response,omitempty"`
	DecodedPresentationResponse map[string]any `json:"decoded_presentation_response,omitempty"`
	VPToken                     any            `json:"vp_token,omitempty"`
	PresentationSubmission      map[string]any `json:"presentation_submission,omitempty"`
	DecodedSDJWT                map[string]any `json:"decoded_sdjwt,omitempty"`
	MDoc                        map[string]any `json:"mdoc,omitempty"`
	IssuerMetadata              map[string]any `json:"issuer_metadata,omitempty"`
	VerifierMetadata            map[string]any `json:"verifier_metadata,omitempty"`
	AuthorizationServerMetadata map[string]any `json:"authorization_server_metadata,omitempty"`
	JWKS                        map[string]any `json:"jwks,omitempty"`
	Certificates                map[string]any `json:"certificates,omitempty"`
	Runner                      map[string]any `json:"runner,omitempty"`
	Artifacts                   map[string]any `json:"artifacts,omitempty"`
	PipelineOutputs             map[string]any `json:"pipeline_outputs,omitempty"`
	Runtime                     map[string]any `json:"runtime,omitempty"`
	Extra                       map[string]any `json:"extra,omitempty"`
}

type DecoderCache

type DecoderCache struct {
	// contains filtered or unexported fields
}

func NewDecoderCache

func NewDecoderCache(capacity int) *DecoderCache

func (*DecoderCache) Extract

func (c *DecoderCache) Extract(root any, path string, decoder string) (any, error)

type LookupResult

type LookupResult struct {
	Path  string `json:"path"`
	Found bool   `json:"found"`
	Value any    `json:"value,omitempty"`
	Type  string `json:"type,omitempty"`
}

func Lookup

func Lookup(bundle Bundle, path string) LookupResult

type MDocCBORValue

type MDocCBORValue struct {
	Value            any                      `json:"value"`
	MajorType        uint8                    `json:"major_type"`
	ContentMajorType uint8                    `json:"content_major_type"`
	Tag              *uint64                  `json:"tag,omitempty"`
	Raw              []byte                   `json:"raw"`
	Members          map[string]MDocCBORValue `json:"members,omitempty"`
}

MDocCBORValue is a decoded CBOR value that keeps its wire shape: the major type, an optional tag, and, for text-keyed maps, the same information for every member. Status assertions are about the encoding, not only the value.

func (*MDocCBORValue) Member

func (v *MDocCBORValue) Member(path ...string) (*MDocCBORValue, bool)

Member resolves a path of text map keys, so a validator can address `status_list` and `idx` without re-implementing CBOR traversal.

type MDocDocument

type MDocDocument struct {
	DocType         string                            `json:"doc_type"`
	DigestAlgorithm string                            `json:"digest_algorithm,omitempty"`
	MSOStatus       *MDocCBORValue                    `json:"mso_status,omitempty"`
	Namespaces      map[string]map[string]MDocElement `json:"namespaces"`
	Errors          map[string]map[string]int64       `json:"errors,omitempty"`
}

type MDocElement

type MDocElement struct {
	Identifier       string  `json:"identifier"`
	Value            any     `json:"value"`
	MajorType        uint8   `json:"major_type"`
	ContentMajorType uint8   `json:"content_major_type"`
	Tag              *uint64 `json:"tag,omitempty"`
	Raw              []byte  `json:"raw"`
}

type MDocPresentation

type MDocPresentation struct {
	Raw              []byte                            `json:"raw"`
	Documents        []MDocDocument                    `json:"documents"`
	DocumentErrors   []map[string]int64                `json:"document_errors,omitempty"`
	Status           uint64                            `json:"status"`
	DecodedTopLevel  map[string]any                    `json:"decoded_top_level,omitempty"`
	SelectedDocument int                               `json:"selected_document"`
	Namespaces       map[string]map[string]MDocElement `json:"namespaces,omitempty"`
}

func ParseMDocPresentation

func ParseMDocPresentation(encoded any) (*MDocPresentation, error)

func ParseMDocVPTokenJSON

func ParseMDocVPTokenJSON(raw string) (*MDocPresentation, error)

func (*MDocPresentation) Document

func (p *MDocPresentation) Document(docType string) (*MDocDocument, bool)

func (*MDocPresentation) Element

func (p *MDocPresentation) Element(namespace string, identifier string) (MDocElement, bool)

func (*MDocPresentation) SecurityObjectStatus

func (p *MDocPresentation) SecurityObjectStatus() (*MDocCBORValue, bool)

SecurityObjectStatus returns the selected document's Mobile Security Object `status` value, which carries the issuer's revocation information.

type PipelineExecutionResult

type PipelineExecutionResult struct {
	Output        any                   `json:"output,omitempty"`
	WorkflowID    string                `json:"workflowId,omitempty"`
	WorkflowRunID string                `json:"workflowRunId,omitempty"`
	StepFailures  []PipelineStepFailure `json:"stepFailures,omitempty"`
}

func DecodePipelineExecutionResult

func DecodePipelineExecutionResult(raw any) (PipelineExecutionResult, error)

func (PipelineExecutionResult) LegacyMap

func (r PipelineExecutionResult) LegacyMap() map[string]any

type PipelineStepFailure

type PipelineStepFailure struct {
	StepID  string `json:"step_id"`
	Code    string `json:"code,omitempty"`
	Summary string `json:"summary,omitempty"`
	Message string `json:"message,omitempty"`
}

func DecodePipelineStepFailures

func DecodePipelineStepFailures(raw any) ([]PipelineStepFailure, error)

type SDJWTPresentation

type SDJWTPresentation struct {
	Raw              string         `json:"raw,omitempty"`
	SDJWT            string         `json:"sd_jwt,omitempty"`
	KeyBindingJWT    string         `json:"key_binding_jwt,omitempty"`
	Claims           map[string]any `json:"claims"`
	ProtectedHeaders map[string]any `json:"protected_headers"`
	IssuerPayload    map[string]any `json:"issuer_payload"`
	KeyBinding       map[string]any `json:"key_binding,omitempty"`
	DisclosureCount  int            `json:"disclosure_count"`
}

func ParseSDJWTPresentation

func ParseSDJWTPresentation(token string) (*SDJWTPresentation, error)

func ParseSDJWTVPTokenJSON

func ParseSDJWTVPTokenJSON(raw string) (*SDJWTPresentation, error)

func ParseSDJWTVPTokenPresentationsJSON

func ParseSDJWTVPTokenPresentationsJSON(raw string) ([]*SDJWTPresentation, error)

func (*SDJWTPresentation) Claim

func (p *SDJWTPresentation) Claim(name string) (any, bool)

Jump to

Keyboard shortcuts

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