pluginread

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package pluginread serves an organization's published plugins to Packer's remote getter: the anonymous third surface of ADR-0027. The four request shapes are fixed by hashicorp/packer packer/plugin-getter/remote/getter.go (v1.16.1), not chosen here.

Index

Constants

View Source
const Prefix = "/plugins/"

Prefix is the root path the read plane owns.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(repository Repository, logger *slog.Logger) http.Handler

NewHandler serves the read plane. Every path it does not serve answers the same 404 as an unexposed registry, so nothing about the registry's state or contents is disclosed (ADR-0017).

Types

type Repository

type Repository interface {
	ServedPluginVersions(ctx context.Context, organization, name string) ([]string, error)
	ServedPluginFile(ctx context.Context, organization, name, version string, kind store.PluginFileKind, filename string) (store.ServedPluginFile, error)
	OpenPluginObject(ctx context.Context, key string) (io.ReadCloser, error)
	CountPluginDownload(ctx context.Context, tenant store.OrganizationTenant, pluginID uuid.UUID, version, platform string, day time.Time) error
}

Repository is what the read plane reads.

Jump to

Keyboard shortcuts

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