plugin

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SignatureModeStrict only allows plugins with valid signatures
	SignatureModeStrict = "strict"
	// SignatureModePermissive validates signatures but allows unsigned plugins with warning
	SignatureModePermissive = "permissive"
	// SignatureModeDisabled disables signature verification
	SignatureModeDisabled = "disabled"
)

Variables

This section is empty.

Functions

func ResolvePlatform

func ResolvePlatform() string

ResolvePlatform returns the current platform string (os/arch)

func SignPlugin

func SignPlugin(binaryPath, privateKeyPath string) error

SignPlugin signs a plugin binary with a private key This is a helper function for plugin developers

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor handles plugin execution

func NewExecutor

func NewExecutor(manager *Manager, cfg *types.Config) *Executor

NewExecutor creates a new plugin executor

func (*Executor) ExecutePlugin

func (e *Executor) ExecutePlugin(pluginName, operation string, args []string) (int, error)

ExecutePlugin executes a plugin with the given arguments

func (*Executor) SetTimeout

func (e *Executor) SetTimeout(timeout time.Duration)

SetTimeout sets the execution timeout

type Installer

type Installer struct {
	// contains filtered or unexported fields
}

Installer manages plugin installation from OCI registries

func NewInstaller

func NewInstaller(pluginDir, registryURL string, client *registry.Client) *Installer

NewInstaller creates a new plugin installer

func (*Installer) GetAvailableVersions

func (i *Installer) GetAvailableVersions(ctx context.Context, name string) ([]string, error)

GetAvailableVersions lists available versions for a plugin in the registry

func (*Installer) InstallPlugin

func (i *Installer) InstallPlugin(ctx context.Context, name, version string) error

InstallPlugin downloads and installs a plugin from the registry

func (*Installer) RemovePlugin

func (i *Installer) RemovePlugin(ctx context.Context, name string) error

RemovePlugin removes a plugin from the plugin directory

func (*Installer) SetSignatureVerifier

func (i *Installer) SetSignatureVerifier(verifier *SignatureVerifier)

SetSignatureVerifier sets the signature verifier for the installer

func (*Installer) UpdatePlugin

func (i *Installer) UpdatePlugin(ctx context.Context, name string) error

UpdatePlugin updates a plugin to the latest version

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager handles plugin discovery and management

func NewManager

func NewManager(pluginDir string) *Manager

NewManager creates a new plugin manager

func (*Manager) DiscoverPlugins

func (m *Manager) DiscoverPlugins() error

DiscoverPlugins scans the plugin directory for installed plugins

func (*Manager) GetPlugin

func (m *Manager) GetPlugin(name string) (*types.PluginInfo, error)

GetPlugin returns information about a specific plugin

func (*Manager) InvalidateCache

func (m *Manager) InvalidateCache()

InvalidateCache forces a rescan on next operation

func (*Manager) ListPlugins

func (m *Manager) ListPlugins() ([]*types.PluginInfo, error)

ListPlugins returns all discovered plugins

func (*Manager) SetPluginDir

func (m *Manager) SetPluginDir(dir string)

SetPluginDir updates the plugin directory

func (*Manager) SetSignatureVerifier

func (m *Manager) SetSignatureVerifier(verifier *SignatureVerifier)

SetSignatureVerifier sets the signature verifier for the manager

func (*Manager) ValidatePlugin

func (m *Manager) ValidatePlugin(name string) error

ValidatePlugin checks if a plugin is valid and executable

type SignatureVerifier

type SignatureVerifier struct {
	// contains filtered or unexported fields
}

SignatureVerifier handles digital signature verification for plugins

func NewSignatureVerifier

func NewSignatureVerifier(config *types.SignatureConfig, logger hclog.Logger) (*SignatureVerifier, error)

NewSignatureVerifier creates a new signature verifier

func (*SignatureVerifier) VerifyPlugin

func (v *SignatureVerifier) VerifyPlugin(binaryPath string) error

VerifyPlugin verifies the digital signature of a plugin binary

Jump to

Keyboard shortcuts

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