Documentation
¶
Overview ¶
Package ports defines interfaces for infrastructure dependencies. CapabilityInfo contains metadata about a capability request. This is placed in ports to avoid circular imports between services and ports.
Package ports defines interfaces for infrastructure dependencies. These are the "ports" in hexagonal architecture - abstractions that the application layer depends on but doesn't implement.
Index ¶
- type CapabilityAnalyzer
- type CapabilityCollector
- type CapabilityGatekeeperPort
- type CapabilityGranter
- type CapabilityInfo
- type Closer
- type EngineFactory
- type ExecutionEngine
- type OutputFormatter
- type OutputWriter
- type Plugin
- type PluginDirectoryResolver
- type PluginInfo
- type PluginRuntime
- type PluginRuntimeFactory
- type ProfileLoader
- type ProfileValidator
- type SystemConfigProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapabilityAnalyzer ¶
type CapabilityAnalyzer interface {
ExtractCapabilities(profile entities.ProfileReader) map[string][]capabilities.Capability
}
CapabilityAnalyzer extracts specific capability requirements from profiles. This allows the orchestrator to be tested with mock analyzers.
type CapabilityCollector ¶
type CapabilityCollector interface {
CollectRequiredCapabilities(ctx context.Context, profile entities.ProfileReader, runtime PluginRuntime, pluginDir string) (map[string][]capabilities.Capability, error)
}
CapabilityCollector collects required capabilities from plugins.
type CapabilityGatekeeperPort ¶
type CapabilityGatekeeperPort interface {
GrantCapabilities(
required capabilities.Grant,
capabilityInfo map[string]CapabilityInfo,
trustAll bool,
) (capabilities.Grant, error)
}
CapabilityGatekeeperPort grants capabilities based on security policy. Named with "Port" suffix to avoid collision with the concrete CapabilityGatekeeper type.
type CapabilityGranter ¶
type CapabilityGranter interface {
GrantCapabilities(ctx context.Context, required map[string][]capabilities.Capability, trustAll bool) (map[string][]capabilities.Capability, error)
}
CapabilityGranter grants capabilities (interactively or automatically).
type CapabilityInfo ¶
type CapabilityInfo struct {
Capability capabilities.Capability
IsProfileBased bool // True if extracted from profile config
PluginName string // Which plugin requested this
IsBroad bool // True if pattern is overly permissive
ProfileSpecific *capabilities.Capability // Profile-specific alternative if available
}
CapabilityInfo contains metadata about a capability request.
type EngineFactory ¶
type EngineFactory interface {
CreateEngine(ctx context.Context, profile entities.ProfileReader, grantedCaps map[string][]capabilities.Capability, pluginDir string, filters dto.FilterOptions, execution dto.ExecutionOptions, skipSchemaValidation bool) (ExecutionEngine, error)
}
EngineFactory creates execution engines with capabilities.
type ExecutionEngine ¶
type ExecutionEngine interface {
Execute(ctx context.Context, profile entities.ProfileReader) (*execution.ExecutionResult, error)
Close(ctx context.Context) error
}
ExecutionEngine executes profiles and returns results.
type OutputFormatter ¶
type OutputFormatter interface {
Format(result *execution.ExecutionResult) error
}
OutputFormatter formats execution results.
type OutputWriter ¶
OutputWriter writes formatted output to destination.
type Plugin ¶
type Plugin interface {
// Describe returns plugin metadata including declared capabilities.
Describe(ctx context.Context) (*PluginInfo, error)
}
Plugin represents a loaded WASM plugin that can be inspected and executed. This interface abstracts the concrete wasm.Plugin implementation.
type PluginDirectoryResolver ¶
PluginDirectoryResolver resolves the plugin directory path.
type PluginInfo ¶
type PluginInfo struct {
Name string
Version string
Description string
Capabilities []capabilities.Capability
}
PluginInfo contains metadata about a plugin. This is the application-layer representation of plugin metadata.
type PluginRuntime ¶
type PluginRuntime interface {
// LoadPlugin compiles and caches a plugin from WASM bytes.
LoadPlugin(ctx context.Context, name string, wasmBytes []byte) (Plugin, error)
// Close releases runtime resources.
Close(ctx context.Context) error
}
PluginRuntime abstracts the WASM runtime for plugin loading and management. This interface allows the application layer to work with plugins without depending on concrete infrastructure types like wasm.Runtime.
type PluginRuntimeFactory ¶
type PluginRuntimeFactory interface {
// NewRuntime creates a new plugin runtime for capability collection.
NewRuntime(ctx context.Context) (PluginRuntime, error)
// NewRuntimeWithCapabilities creates a runtime with granted capabilities.
NewRuntimeWithCapabilities(
ctx context.Context,
caps map[string][]capabilities.Capability,
memoryLimitMB int,
) (PluginRuntime, error)
}
PluginRuntimeFactory creates runtime instances. This allows the application layer to create runtimes without importing infrastructure.
type ProfileLoader ¶
ProfileLoader loads profiles from storage.