dto

package
v0.4.5-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package dto contains data transfer objects for application layer use cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapabilityDiagnostics

type CapabilityDiagnostics struct {
	// Required capabilities by plugin
	Required map[string]*sdkEntities.GrantSet

	// Granted capabilities by plugin
	Granted map[string]*sdkEntities.GrantSet
}

CapabilityDiagnostics contains capability-related diagnostics.

type CheckOptions

type CheckOptions struct {
	PluginDir            string
	SystemConfigPath     string
	TrustPlugins         bool
	SkipSchemaValidation bool
	WarnUnusedVars       bool // Enable warnings for unused CLI variables (enabled by default when CLI vars are set)
}

CheckOptions contains options for plugin and capability management.

type CheckProfileRequest

type CheckProfileRequest struct {
	CLIVariables  map[string]interface{}
	ProfilePath   string
	Metadata      RequestMetadata
	Options       CheckOptions
	Filters       FilterOptions
	Execution     ExecutionOptions
	RemoteOptions RemoteProfileOptions
}

CheckProfileRequest encapsulates all inputs needed to check a profile.

type CheckProfileResponse

type CheckProfileResponse struct {
	Diagnostics     Diagnostics
	ExecutionResult *execution.ExecutionResult
	Metadata        ResponseMetadata
}

CheckProfileResponse contains the result of checking a profile.

type CollectCapabilitiesRequest

type CollectCapabilitiesRequest struct {
	ProfilePath  string
	PluginDir    string
	TrustPlugins bool
}

CollectCapabilitiesRequest encapsulates inputs for capability collection.

type CollectCapabilitiesResponse

type CollectCapabilitiesResponse struct {
	// Required capabilities by plugin name
	Required map[string]*sdkEntities.GrantSet

	// Granted capabilities by plugin name
	Granted map[string]*sdkEntities.GrantSet
}

CollectCapabilitiesResponse contains the result of capability collection.

type Diagnostics

type Diagnostics struct {
	Capabilities CapabilityDiagnostics
	Warnings     []string
}

Diagnostics contains diagnostic information about execution.

type ExecuteProfileRequest

type ExecuteProfileRequest struct {
	GrantedCapabilities  map[string]*sdkEntities.GrantSet
	ProfilePath          string
	Filters              FilterOptions
	Execution            ExecutionOptions
	SkipSchemaValidation bool
}

ExecuteProfileRequest encapsulates inputs for profile execution.

type ExecuteProfileResponse

type ExecuteProfileResponse struct {
	// ExecutionResult is the domain execution result
	ExecutionResult *execution.ExecutionResult
}

ExecuteProfileResponse contains the result of profile execution.

type ExecutionOptions

type ExecutionOptions struct {
	// Parallel enables parallel execution of controls
	Parallel bool

	// MaxConcurrentControls limits parallel control execution (0 = no limit)
	MaxConcurrentControls int

	// MaxConcurrentObservations limits parallel observation execution (0 = no limit)
	MaxConcurrentObservations int
}

ExecutionOptions controls how the profile is executed.

type FilterOptions

type FilterOptions struct {
	FilterExpression    string
	IncludeTags         []string
	IncludeSeverities   []string
	IncludeControlIDs   []string
	ExcludeTags         []string
	ExcludeControlIDs   []string
	IncludeDependencies bool
}

FilterOptions defines filters for control selection.

type LoadProfileRequest

type LoadProfileRequest struct {
	ProfilePath string
}

LoadProfileRequest encapsulates inputs for loading a profile.

type LoadProfileResponse

type LoadProfileResponse struct {
	// Profile is the loaded and validated profile
	// Note: We don't expose the profile entity directly in DTO,
	// but for now we'll keep it simple. In a strict hexagonal architecture,
	// this would be a separate DTO.
	ProfilePath string
	Success     bool
}

LoadProfileResponse contains the result of loading a profile.

type PlanProfileRequest

type PlanProfileRequest struct {
	ProfilePath string
	Metadata    RequestMetadata
	Filters     FilterOptions
}

PlanProfileRequest encapsulates inputs for planning profile execution. It generates a dry-run execution plan without actually running controls.

type PlanProfileResponse

type PlanProfileResponse struct {
	// Plan is the dry-run execution plan
	Plan *entities.ExecutionPlan

	// Metadata contains response metadata
	Metadata ResponseMetadata
}

PlanProfileResponse contains the execution plan for a profile.

type PluginArtifactDTO

type PluginArtifactDTO struct {
	Plugin *entities.Plugin
	WASM   io.ReadCloser // Plugin binary stream
}

PluginArtifactDTO is a data transfer object for plugin artifacts. Contains I/O dependencies that don't belong in domain entities.

func NewPluginArtifactDTO

func NewPluginArtifactDTO(plugin *entities.Plugin, wasm io.ReadCloser) *PluginArtifactDTO

NewPluginArtifactDTO creates a DTO from domain entity.

func (*PluginArtifactDTO) Close

func (d *PluginArtifactDTO) Close() error

Close closes the WASM reader.

type PluginSpecDTO

type PluginSpecDTO struct {
	Name   string // Plugin name or OCI reference
	Digest string // Expected digest (from lockfile, optional)
}

PluginSpecDTO represents a plugin specification from configuration. Bridges Config context to Plugin Management context.

func (*PluginSpecDTO) ToDigest

func (s *PluginSpecDTO) ToDigest() (values.Digest, error)

ToDigest converts digest string to domain value object.

func (*PluginSpecDTO) ToPluginReference

func (s *PluginSpecDTO) ToPluginReference() (values.PluginReference, error)

ToPluginReference converts DTO to domain value object.

type RemoteProfileOptions

type RemoteProfileOptions struct {
	// Timeout overrides the default fetch timeout.
	Timeout time.Duration

	// Refresh forces a cache bypass and re-fetch.
	Refresh bool

	// AllowPrivateNetwork permits fetching from private IP addresses.
	AllowPrivateNetwork bool

	// Insecure skips TLS certificate validation (not recommended).
	Insecure bool

	// TrustSource bypasses interactive trust prompt for remote profiles.
	TrustSource bool
}

RemoteProfileOptions configures remote profile fetching behavior.

type RequestMetadata

type RequestMetadata struct {
	// RequestID uniquely identifies this request
	RequestID string
}

RequestMetadata contains metadata for request tracking.

type ResponseMetadata

type ResponseMetadata struct {
	ProcessedAt time.Time
	RequestID   string
	Duration    time.Duration
}

ResponseMetadata contains metadata about the response.

type ValidateProfileRequest

type ValidateProfileRequest struct {
	ProfilePath          string
	Metadata             RequestMetadata
	SkipSchemaValidation bool
	SkipExpectValidation bool
}

ValidateProfileRequest encapsulates inputs for validating a profile. It validates structure and syntax without execution.

type ValidateProfileResponse

type ValidateProfileResponse struct {
	ProfileName string
	Version     string
	Metadata    ResponseMetadata
	Errors      []ValidationError
	Warnings    []string
	Stats       ValidationStats
	Valid       bool
}

ValidateProfileResponse contains the result of validating a profile.

type ValidationError

type ValidationError struct {
	Type    string // "structural", "schema", "dependency", "expect"
	Path    string // e.g., "controls[0].observations[1].expect[2]"
	Message string // human-readable error description
}

ValidationError represents a single validation failure.

type ValidationStats

type ValidationStats struct {
	PluginsUsed      []string
	ControlCount     int
	ObservationCount int
	ExpectCount      int
}

ValidationStats provides summary information about the validated profile.

Jump to

Keyboard shortcuts

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