Documentation
¶
Index ¶
- func CheckReleaseSource(source string) error
- func CurrentPlatform() string
- func LooksLikePath(source string) bool
- func ParseSelector(source string) (registry, name string, err error)
- func SignatureRequired(policy *schema.PluginPolicy) bool
- type Cache
- func (c *Cache) CheckPolicy(ctx context.Context, operation string, entry *pluginlock.Entry, ...) error
- func (c *Cache) CorruptReleaseError(cause error, alias string, entry *pluginlock.Entry, platform string, ...) error
- func (c *Cache) Installed(entry *pluginlock.Entry, platform string) (string, error)
- func (c *Cache) ReleaseDirectory(entry *pluginlock.Entry, platform string) (string, error)
- func (c *Cache) Store(ctx context.Context, release *pluginoci.Release, platform string, ...) (string, error)
- type Option
- type RepairContext
- type Request
- type Service
- func (s *Service) Prepare(ctx context.Context, request *Request) (*pluginlock.Entry, error)
- func (s *Service) PrepareBatch(ctx context.Context, requests map[string]*Request) (map[string]pluginlock.Entry, error)
- func (s *Service) VerifyInstalled(ctx context.Context, entry *pluginlock.Entry) (pluginlock.Verification, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckReleaseSource ¶
CheckReleaseSource rejects path-like sources with guidance, before any registry is queried.
func CurrentPlatform ¶
func CurrentPlatform() string
CurrentPlatform selects the running process's platform, never an emulated fallback.
func LooksLikePath ¶
LooksLikePath reports whether a release source is a filesystem path. It never touches the network: a leading dot, slash, tilde or backslash, a Windows drive letter, or an existing directory holding plugin.yaml all mean the user meant a local plugin.
func ParseSelector ¶
ParseSelector splits `<registry>/<package>`. Every segment must be non-empty, so a malformed selector is rejected locally instead of being searched across every configured registry.
func SignatureRequired ¶
func SignatureRequired(policy *schema.PluginPolicy) bool
SignatureRequired treats a publisher allowlist as enforcement even without the boolean flag.
Types ¶
type Cache ¶
type Cache struct{ Directory string }
Cache stores verified release layouts and their materialized native payloads.
func (*Cache) CheckPolicy ¶
func (c *Cache) CheckPolicy(ctx context.Context, operation string, entry *pluginlock.Entry, platform string, descriptors *extension.Registry) error
CheckPolicy reapplies current policy to verified cached bytes, never trusting metadata copied into a lockfile or a prior admission decision.
func (*Cache) CorruptReleaseError ¶
func (c *Cache) CorruptReleaseError(cause error, alias string, entry *pluginlock.Entry, platform string, repair RepairContext) error
CorruptReleaseError names the alias, the cache path, and the exact command that repairs a corrupt cached release. The returned error satisfies ErrPluginCacheCorrupt and keeps every cause (including ErrOCIIntegrity) in its chain.
func (*Cache) Installed ¶
Installed checks locked bytes entirely offline before returning an executable directory.
func (*Cache) ReleaseDirectory ¶
ReleaseDirectory returns the cache directory that holds a locked release for a platform.
func (*Cache) Store ¶
func (c *Cache) Store(ctx context.Context, release *pluginoci.Release, platform string, descriptors *extension.Registry) (string, error)
Store stages the chosen platform, validates extensions, then atomically promotes it. A partial download never replaces a usable installation.
type Option ¶
type Option func(*serviceOptions)
Option configures optional composition services for installation.
func WithRegistryAuthPreparation ¶
func WithRegistryAuthPreparation(prepare registryauth.Preparation) Option
WithRegistryAuthPreparation allows verified local auth plugins to bootstrap registry access.
type RepairContext ¶
type RepairContext int
RepairContext explains why a corrupt cached release is not repaired automatically.
const ( // RepairAvailable means an online, non-frozen install repairs the release. RepairAvailable RepairContext = iota // RepairFrozen means the caller must not mutate the cache or lock. RepairFrozen // RepairOffline means repair needs registry access that policy forbids. RepairOffline // RepairAutomatic means an ordinary command found the corruption and has not repaired it. RepairAutomatic )
type Request ¶
type Request struct {
PinnedDigest string
SelectedVersion string
Source string
Constraint string
Locked *pluginlock.Entry
// Previous informs update feedback without constraining release selection.
Previous *pluginlock.Entry
Layout string
// Alias names the package in repair hints; it defaults to the locked package name.
Alias string
// Frozen forbids changing the cache: a corrupt locked release fails instead of being repaired.
Frozen bool
}
Request selects a release or restores a previously locked one.
type Service ¶
type Service struct {
Verifier signature.Verifier
Config *schema.AtmosConfiguration
Descriptors *extension.Registry
Registry atmosoci.Registry
Cache *Cache
Platform string
}
Service prepares verified installs; configuration transactions are separate.
func NewService ¶
func NewService(config *schema.AtmosConfiguration, descriptors *extension.Registry, options ...Option) (*Service, error)
NewService composes shared registry auth and the existing XDG/keyring services.
func (*Service) Prepare ¶
Prepare resolves immutable metadata and installs bytes without editing a lock or declaration. Callers commit the returned entry only after all packages pass.
func (*Service) PrepareBatch ¶
func (s *Service) PrepareBatch(ctx context.Context, requests map[string]*Request) (map[string]pluginlock.Entry, error)
PrepareBatch prepares packages concurrently using the shared toolchain progress display. It returns entries only after every package has passed verification. Every package is attempted, so one invocation reports all failing packages, in alias order.
func (*Service) VerifyInstalled ¶
func (s *Service) VerifyInstalled(ctx context.Context, entry *pluginlock.Entry) (pluginlock.Verification, error)
VerifyInstalled checks current publisher policy against cryptographic evidence. Lockfile verification labels are informational and can never authorize execution.