publicaccess

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package publicaccess verifies public registry visibility without consulting local OCI credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicationError

func PublicationError(repository, reference string, cause error) error

PublicationError reports a verification failure without implying the upload was rolled back.

Types

type Client

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

Client verifies metadata and anonymously downloads complete OCI graphs.

func New

func New(options ...Option) *Client

New constructs a verifier with bounded requests and no ambient OCI credentials.

func (*Client) RequirePublic

func (c *Client) RequirePublic(ctx context.Context, repository string) error

RequirePublic checks GHCR package visibility for the standalone metadata check. The owner is derived from the repository; organization packages are supported.

func (*Client) Verify

func (c *Client) Verify(ctx context.Context, repository, reference, expected string) (string, error)

Verify downloads and hashes every manifest, config, and layer using anonymous registry authentication. Expected pins the root digest when nonempty. No platform is selected or omitted.

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPClient is the HTTP boundary for GitHub package metadata.

type Option

type Option func(*Client)

Option configures public verification.

func WithGitHubToken

func WithGitHubToken(token string) Option

WithGitHubToken supplies a token only for the GitHub metadata API.

func WithHTTPClient

func WithHTTPClient(client HTTPClient) Option

WithHTTPClient supplies the metadata API client.

func WithTransport

func WithTransport(value http.RoundTripper) Option

WithTransport supplies anonymous registry transport, including custom trust roots.

Jump to

Keyboard shortcuts

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