config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComplyPackConfig

type ComplyPackConfig struct {
	ID          string       `yaml:"id"`
	EvaluatorID string       `yaml:"evaluator-id"`
	Version     string       `yaml:"version"`
	Gemara      GemaraConfig `yaml:"gemara"`
	Schemas     []SchemaRef  `yaml:"schemas"`
	Policies    *DirConfig   `yaml:"policies,omitempty"`
	Tests       *DirConfig   `yaml:"tests,omitempty"`
	Fixtures    *DirConfig   `yaml:"fixtures,omitempty"`
	Output      *DirConfig   `yaml:"output,omitempty"`
}

ComplyPackConfig represents the structure of complypack.yaml. Aligned with CEP-0001 and complypack-pipeline specification.

func LoadConfig

func LoadConfig(path string) (*ComplyPackConfig, error)

LoadConfig reads and parses a complypack.yaml file.

func (*ComplyPackConfig) Validate

func (c *ComplyPackConfig) Validate() error

Validate checks that required fields are present.

func (*ComplyPackConfig) ValidateForMCP

func (c *ComplyPackConfig) ValidateForMCP() error

ValidateForMCP checks fields required for MCP server operation. Unlike Validate(), this does not require fields only needed for pack/scan (id, evaluator-id, version) since the MCP server can be configured entirely via CLI flags.

func (*ComplyPackConfig) ValidateForPack

func (c *ComplyPackConfig) ValidateForPack() error

ValidateForPack checks fields required for pack operation.

type DirConfig

type DirConfig struct {
	Dir     string   `yaml:"dir"`
	Helpers []string `yaml:"helpers,omitempty"`
}

DirConfig represents a directory configuration.

type GemaraConfig

type GemaraConfig struct {
	Sources []GemaraSourceEntry
}

GemaraConfig represents Gemara catalog source configuration. Supports both legacy single-source format and multi-source format:

# Legacy (still supported):
gemara:
  source: catalogs/controls.yaml

# Multi-source:
gemara:
  sources:
    - source: catalogs/controls.yaml
    - source: ghcr.io/org/guidance:v1
      plain-http: true

func (*GemaraConfig) UnmarshalYAML

func (g *GemaraConfig) UnmarshalYAML(value *yaml.Node) error

type GemaraSourceEntry

type GemaraSourceEntry struct {
	Source    string `yaml:"source"`
	PlainHTTP bool   `yaml:"plain-http,omitempty"`
}

GemaraSourceEntry represents a single Gemara artifact source.

type SchemaRef

type SchemaRef struct {
	// Platform identifies the target platform (e.g., "kubernetes-deployment", "ci-github-actions")
	Platform string `yaml:"platform"`

	// Source is a URI specifying where to load the schema from.
	// Supported schemes:
	//   - cue://module.path          -> CUE registry module
	//   - https://example.com/s.json -> HTTP(S) download
	//   - file://./path/to/file      -> Local file
	// If empty, falls back to index defaults.
	Source string `yaml:"source,omitempty"`

	// Path is deprecated - use Source with file:// scheme instead.
	// Kept for backward compatibility.
	Path string `yaml:"path,omitempty"`
}

SchemaRef represents a platform schema with its source and platform identifier.

Jump to

Keyboard shortcuts

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