Documentation
¶
Overview ¶
Package repoplugin defines the interface for repository layout plugins.
A repo plugin knows how to discover credentials from a particular repository directory layout. Different source repositories organize their credential schemas, metadata, and governance documents in different ways. Plugins abstract over these layout differences, presenting a uniform DiscoveredCredential to the build pipeline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRegistry = NewRegistry()
DefaultRegistry is the global plugin registry.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// RepoDir is the root directory of the cloned or local repository.
RepoDir string
// SubPath is an optional relative path restriction within the repo.
// If set, the plugin should only discover credentials under this path.
SubPath string
// Organization is the resolved organization name for this source.
Organization string
// BaseURL is the registry base URL for generating schema URIs.
BaseURL string
// Options contains source-level key-value options from sources.yaml.
// Plugins parse their own options from this map.
Options map[string]string
// Logger for structured logging.
Logger *slog.Logger
}
Context provides plugins with the information they need for discovery.
type DiscoveredCredential ¶
type DiscoveredCredential struct {
// Org is the organization identifier (used in URLs and grouping).
Org string
// Slug is the credential slug (used in URLs and deterministic IDs).
Slug string
// SchemaMetaSource contains manually-authored governance metadata.
// If nil, the credential will not pass TS11 validation (but may still
// appear on the registry site as a legacy credential).
SchemaMetaSource *schemameta.SchemaMetaSource
// FormatFiles maps TS11 format identifiers to absolute file paths.
// Keys: "dc+sd-jwt", "mso_mdoc", "jwt_vc_json"
FormatFiles map[string]string
// GeneratedVCTM holds synthesized VCTM JSON content when the plugin
// generates it in-memory (e.g., from JSON Schema conversion) rather than
// reading from an existing file.
GeneratedVCTM []byte
// GeneratedMdoc holds synthesized mDOC metadata JSON when generated
// in-memory by the plugin.
GeneratedMdoc []byte
// RulebookPath is the absolute path to the rulebook source (markdown).
// Empty if no rulebook is available.
RulebookPath string
// SourceURL is the repository URL for provenance tracking.
SourceURL string
// SourceRepo is the repository name.
SourceRepo string
}
DiscoveredCredential is the uniform output from any layout plugin. It contains everything the pipeline needs regardless of source structure.
type Plugin ¶
type Plugin interface {
// Name returns the plugin identifier (e.g., "default", "rulebook-catalog").
// This value is used in the "layout" field of sources.yaml entries.
Name() string
// Description returns a human-readable description of the layout this
// plugin handles.
Description() string
// Discover scans the repository directory and returns all credentials
// found according to the plugin's layout conventions.
Discover(ctx Context) ([]DiscoveredCredential, error)
}
Plugin discovers credentials from a repository directory. Each layout type implements this interface.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package defaultlayout implements the repo plugin for the standard SIROS credential repository layout (co-located schema-meta + format files).
|
Package defaultlayout implements the repo plugin for the standard SIROS credential repository layout (co-located schema-meta + format files). |
|
Package rulebookcatalog implements the repo plugin for EUDI-style attestation rulebook catalog repositories (e.g., webuild-attestation-rulebooks-catalog).
|
Package rulebookcatalog implements the repo plugin for EUDI-style attestation rulebook catalog repositories (e.g., webuild-attestation-rulebooks-catalog). |