reportpdf

package
v1.324.4 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: 27 Imported by: 0

Documentation

Overview

Package reportpdf renders FCAF conformance assessment reports as PDF documents.

Index

Constants

View Source
const (
	// DefaultSuite is the suite of a report that names none.
	DefaultSuite = "wallet_solution/relying_party"
)

Variables

This section is empty.

Functions

func LoadMaterials

func LoadMaterials(suite string, testIDs []string) (
	map[string]dsl.TestDefinition,
	map[string]SourceDetails,
	[]string,
)

LoadMaterials reads the catalog definition and the FCAF source Markdown of each test of a report of the given suite (DefaultSuite when empty).

func PrepareImage

func PrepareImage(data []byte) ([]byte, error)

func ReferenceFilename

func ReferenceFilename(reference string) string

func Render

func Render(ctx context.Context, document Document) ([]byte, error)

func SourceURL

func SourceURL(suite string, sourceTitle string) string

SourceURL links a test on the FCAF test-cases page of its suite (DefaultSuite when empty). The page derives its anchors from the "# " heading of each source Markdown, which does not always match the source file name that Credimi test IDs come from (CredentialStructure007 in WS_RP_DM_CredentialMetadata_CredentialStructure_007.md).

Types

type Category

type Category struct {
	Code   string
	Name   string
	Color  [3]int
	Groups []TestGroup
}

type Document

type Document struct {
	Report        engine.Report
	Metadata      Metadata
	JSONSHA256    string
	Categories    []Category
	Evidence      []EvidenceEntry
	Unassigned    []ImageAsset
	Warnings      []string
	SelectedCount int
}

func BuildDocument

func BuildDocument(input Input) Document

type EvidenceEntry

type EvidenceEntry struct {
	Key        string
	Record     engine.EvidenceRecord
	Referenced bool
}

type ImageAsset

type ImageAsset struct {
	EvidenceKey string
	Filename    string
	Data        []byte
}

func DeduplicateScreenshots

func DeduplicateScreenshots(images []ImageAsset) ([]ImageAsset, int)

DeduplicateScreenshots keeps one screenshot per Maestro command burst (the last, which captures the final state of the step) and every non-burst screenshot unchanged. It returns the kept images and the dropped count.

type Input

type Input struct {
	Report      engine.Report
	RawJSON     []byte
	Metadata    Metadata
	Definitions map[string]dsl.TestDefinition
	Sources     map[string]SourceDetails
	Images      []ImageAsset
	Warnings    []string
}

type Metadata

type Metadata struct {
	PipelineName       string
	PipelineIdentifier string
	OrganizationName   string
	WorkflowID         string
	RunID              string
	GeneratedAt        time.Time
	JSONFilename       string
	Runner             RunnerInfo
}

type RunnerInfo

type RunnerInfo struct {
	Name   string
	Type   string
	Serial string
}

type SourceDetails

type SourceDetails struct {
	Title           string
	Objective       string
	References      string
	Applicability   string
	WalletRelevancy string
	Preconditions   string
	Scenario        string
	ExpectedResults string
}

func ParseSourceMarkdown

func ParseSourceMarkdown(markdown string) SourceDetails

type TestEntry

type TestEntry struct {
	Execution  engine.ExecutedTest
	Definition dsl.TestDefinition
	Source     SourceDetails
	Evidence   []EvidenceEntry
	Images     []ImageAsset
}

type TestGroup

type TestGroup struct {
	Name  string
	Tests []TestEntry
}

Jump to

Keyboard shortcuts

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