azurecontainerregistry

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 45 Imported by: ? modules, 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.

README

Azure Container Registry

Parity grade: B · SDK azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry@v1.2.0 · last audited 2026-10-22 (364908f83)

Coverage

Metric Value
PARITY entries audited 24 (24 ok)
Feature families 5 (5 ok)
Known gaps 3
Deferred items 0
Resource leaks partial
Known gaps
  • Connected registries, agent pools and ACR Tasks (tasks, runs, taskRuns, scheduleRun, task run logs) are not modelled: the ARM routes belong in services/azurearm/rp_acr_routes.go:45 (containerRegistryRoutes), an existing file this pass could not edit, and a task build step needs an image build API that pkgs/container does not have (PullImage at pkgs/container/container.go:196 is the only image call).
  • Quarantine, content trust (Notary) and soft delete policies are stored and have no data-plane effect: quarantine has no Learn page (container-registry-quarantine answered 404 when checked) and its data-plane API is not documented, so quarantineState stays Passed and the webhook quarantine action never fires; content trust needs a Notary signing service that no emulated service provides (signed stays false); soft delete needs the data-plane list-deleted and restore paths, which Learn container-registry-soft-delete-policy names only as az acr commands (az acr manifest list-deleted, restore) without their REST paths. Revoking the registry identity's Key Vault permission is not modelled (Key Vault permission evaluation is out of scope).
  • Each registry's embedded distribution library leaves one go-events broadcaster goroutine running until process exit: distribution v3.1.2 registry/handlers/app.go:526 builds events.NewBroadcaster into the unexported app.events field and App.Shutdown (app.go:461) never closes it.

More

Documentation

Overview

Package azurecontainerregistry emulates the Azure Container Registry data plane: a Docker Registry v2 API per registry, the OAuth2 refresh and access token endpoints az acr login uses, admin-user Basic authentication and the /acr/v1 repository, tag and manifest metadata API. Registries are created through the ARM Microsoft.ContainerRegistry provider, which shares their credentials. See PARITY.md.

Index

Constants

View Source
const DefaultPort = 10011

DefaultPort is the registry data plane's TCP port.

View Source
const NullUsername = "00000000-0000-0000-0000-000000000000"

NullUsername is the username registry clients send with a refresh token as the password.

Variables

View Source
var (
	ErrRegistryNotFound = errors.New("azurecontainerregistry: registry not found")
	ErrInvalidName      = errors.New("azurecontainerregistry: invalid registry name")
	ErrAdminDisabled    = errors.New("azurecontainerregistry: admin user is not enabled")
	ErrInvalidCred      = errors.New("azurecontainerregistry: credential name must be password or password2")
	ErrWebhookNotFound  = errors.New("azurecontainerregistry: webhook not found")
	ErrNilAppContext    = errors.New("azurecontainerregistry: nil app context")
	ErrNotFound         = errors.New("azurecontainerregistry: not found")
	ErrDenied           = errors.New("azurecontainerregistry: operation is disabled by the resource's attributes")
	ErrTLSKeyMissing    = errors.New("azurecontainerregistry: --azure-acr-tls-cert set without --azure-acr-tls-key")
	ErrTLSCertMissing   = errors.New("azurecontainerregistry: --azure-acr-tls-key set without --azure-acr-tls-cert")
)

Backend errors.

View Source
var (
	ErrScopeMapNotFound  = errors.New("azurecontainerregistry: scope map not found")
	ErrScopeMapReadOnly  = errors.New("azurecontainerregistry: system scope maps cannot be changed")
	ErrScopeMapInUse     = errors.New("azurecontainerregistry: scope map is used by a token")
	ErrInvalidScopeMap   = errors.New("azurecontainerregistry: invalid scope map action")
	ErrTokenNotFound     = errors.New("azurecontainerregistry: token not found")
	ErrInvalidTokenName  = errors.New("azurecontainerregistry: invalid token password name")
	ErrInvalidTokenState = errors.New("azurecontainerregistry: token status must be enabled or disabled")
)

Scope map and token errors.

View Source
var (
	ErrImportSourceNotFound = errors.New("azurecontainerregistry: import source image not found")
	ErrImportTagExists      = errors.New("azurecontainerregistry: import target tag already exists")
	ErrImportRemoteDisabled = errors.New("azurecontainerregistry: importing from external registries is disabled")
	ErrImportAuth           = errors.New("azurecontainerregistry: the source registry refused authentication")
	ErrImportExportOff      = errors.New("azurecontainerregistry: the source registry has its export policy disabled")
	ErrImportInvalid        = errors.New("azurecontainerregistry: invalid import request")
	ErrImportUpstream       = errors.New("azurecontainerregistry: the source registry returned an error")
)

Import errors.

View Source
var ErrCacheRuleNotFound = errors.New("azurecontainerregistry: cache rule not found")

ErrCacheRuleNotFound is returned for an unknown cache rule.

View Source
var ErrInvalidNetworkRule = errors.New("azurecontainerregistry: IP rule must be an IPv4 address or CIDR range")

ErrInvalidNetworkRule is returned for an IP rule that is not an IPv4 address or CIDR range.

View Source
var ErrKeyUnavailable = errors.New("azurecontainerregistry: the customer-managed key is not usable")

ErrKeyUnavailable is returned when a customer-managed encryption key cannot be used.

Functions

func SelfSignedConfig

func SelfSignedConfig() (*tls.Config, error)

SelfSignedConfig returns a TLS config with a generated certificate, for callers that want HTTPS in tests.

Types

type AttrPatch

type AttrPatch struct {
	Delete *bool
	Write  *bool
	Read   *bool
	List   *bool
}

AttrPatch carries the attributes a PATCH sets; nil leaves one unchanged.

type CacheCredentials

type CacheCredentials struct {
	LoginServer    string `json:"loginServer"`
	UsernameSecret string `json:"usernameSecret"`
	PasswordSecret string `json:"passwordSecret"`
}

CacheCredentials locates the upstream login in Key Vault secrets.

type CacheRule

type CacheRule struct {
	CreatedAt   time.Time         `json:"createdAt"`
	Credentials *CacheCredentials `json:"credentials,omitempty"`
	Name        string            `json:"name"`
	Source      string            `json:"source"`
	Target      string            `json:"target"`
}

CacheRule pulls Source (host/path, optionally ending in /*) into Target on first pull.

type ConfigProvider

type ConfigProvider interface {
	GetAzureACRSettings() Settings
}

ConfigProvider extracts the Container Registry settings from the AppContext config.

type Credentials

type Credentials struct {
	Username  string
	Password1 string
	Password2 string
}

Credentials are a registry's admin-user credentials.

type DataDirConfig

type DataDirConfig interface {
	GetRegistryDataDir() string
}

DataDirConfig locates the directory registry blobs are kept in; empty keeps them in memory.

type EventContent

type EventContent struct {
	Target    *EventTarget  `json:"target,omitempty"`
	Request   *EventRequest `json:"request,omitempty"`
	ID        string        `json:"id"`
	Timestamp string        `json:"timestamp"`
	Action    string        `json:"action"`
}

EventContent is the JSON body posted to a webhook's service URI.

type EventRequest

type EventRequest struct {
	ID        string `json:"id"`
	Host      string `json:"host"`
	Method    string `json:"method"`
	Useragent string `json:"useragent"`
}

EventRequest is the registry request that caused an event.

type EventRequestMessage

type EventRequestMessage struct {
	Headers    map[string]string `json:"headers"`
	Content    EventContent      `json:"content"`
	Method     string            `json:"method"`
	RequestURI string            `json:"requestUri"`
	Version    string            `json:"version"`
}

EventRequestMessage is the HTTP request delivered to the service URI.

type EventResponseMessage

type EventResponseMessage struct {
	Headers      map[string]string `json:"headers"`
	Content      string            `json:"content"`
	ReasonPhrase string            `json:"reasonPhrase"`
	StatusCode   string            `json:"statusCode,omitempty"`
	Version      string            `json:"version"`
}

EventResponseMessage is the service URI's HTTP response.

type EventTarget

type EventTarget struct {
	MediaType  string `json:"mediaType,omitempty"`
	Digest     string `json:"digest,omitempty"`
	Repository string `json:"repository,omitempty"`
	Tag        string `json:"tag,omitempty"`
	Size       int64  `json:"size,omitempty"`
	Length     int64  `json:"length,omitempty"`
}

EventTarget is the artifact an event is about.

type Forgotten

type Forgotten struct {
	Digests []string
	Tags    []string
}

Forgotten lists what ForgetRepository removed.

type Handler

type Handler struct {
	// ValidateToken checks a Microsoft Entra access token offered to /oauth2/exchange; nil accepts any non-empty
	// token.
	ValidateToken func(token, tenant string) error
	Backend       *InMemoryBackend

	Settings Settings
	Port     int
	// contains filtered or unexported fields
}

Handler owns the registry listener.

func NewHandler

func NewHandler(backend *InMemoryBackend, settings Settings) *Handler

NewHandler returns a Handler over backend.

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(*echo.Context) string

ExtractOperation implements service.Service.

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(*echo.Context) string

ExtractResource implements service.Service.

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

GetSupportedOperations implements service.Service.

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

Handler returns a 404 handler; the real API is on the dedicated port.

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

MatchPriority implements service.Registerable.

func (*Handler) Name

func (h *Handler) Name() string

Name implements service.Service.

func (*Handler) Reset

func (h *Handler) Reset()

Reset implements service.Resettable.

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

RouteMatcher never matches: the registry listens on its own port.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes a request to the registry, token or metadata API.

func (*Handler) Shutdown

func (h *Handler) Shutdown(ctx context.Context)

Shutdown implements service.Shutdowner.

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

func (*Handler) StartWorker

func (h *Handler) StartWorker(ctx context.Context) error

StartWorker binds the listener synchronously so a port conflict is returned to the caller.

type ImportRequest

type ImportRequest struct {
	Source          ImportSource
	TargetTags      []string
	UntaggedTargets []string
	Force           bool
}

ImportRequest is an importImage call.

type ImportSource

type ImportSource struct {
	Registry    string
	RegistryURI string
	Image       string
	Username    string
	Password    string
}

ImportSource is where importImage reads from: an emulated registry by name, or a registry URI.

type InMemoryBackend

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

InMemoryBackend holds every registry's control-plane state under one lock; blobs and manifests live in per-registry ociregistry handlers.

func NewInMemoryBackend

func NewInMemoryBackend() *InMemoryBackend

NewInMemoryBackend creates an empty backend that keeps blobs in memory.

func (*InMemoryBackend) AccessTokenScopes

func (b *InMemoryBackend) AccessTokenScopes(tok, reg string) ([]string, bool)

AccessTokenScopes returns the scopes recorded in an access token of reg, as repository:name:actions strings.

func (*InMemoryBackend) Allowed

func (b *InMemoryBackend) Allowed(reg, repo, ref, op string) bool

Allowed reports whether op (read, write or delete) may touch repo:ref.

func (*InMemoryBackend) CheckKey

func (b *InMemoryBackend) CheckKey(keyIdentifier string) error

CheckKey runs the key checker; without one every key is accepted.

func (*InMemoryBackend) Close

func (b *InMemoryBackend) Close()

Close stops webhook deliveries and releases every registry's storage handler without deleting stored images.

func (*InMemoryBackend) CredentialHealth

func (b *InMemoryBackend) CredentialHealth(usernameURI, passwordURI string) (bool, string, string)

CredentialHealth reports whether both secret identifiers resolve; code and message describe the first failure.

func (*InMemoryBackend) Credentials

func (b *InMemoryBackend) Credentials(name string) (Credentials, error)

Credentials returns the admin credentials; the admin user must be enabled.

func (*InMemoryBackend) DeleteCacheRule

func (b *InMemoryBackend) DeleteCacheRule(reg, name string) error

DeleteCacheRule removes a cache rule; pulled images stay.

func (*InMemoryBackend) DeleteRegistry

func (b *InMemoryBackend) DeleteRegistry(name string) error

DeleteRegistry removes the registry with its repositories, blobs and manifests.

func (*InMemoryBackend) DeleteScopeMap

func (b *InMemoryBackend) DeleteScopeMap(reg, name string) error

DeleteScopeMap removes a user scope map that no token uses.

func (*InMemoryBackend) DeleteTag

func (b *InMemoryBackend) DeleteTag(ctx context.Context, reg, repo, tag string) error

DeleteTag removes one tag, honouring the repository and tag delete attributes; the manifest is kept when other references remain.

func (*InMemoryBackend) DeleteToken

func (b *InMemoryBackend) DeleteToken(reg, name string) error

DeleteToken removes a token and its passwords.

func (*InMemoryBackend) DeleteWebhook

func (b *InMemoryBackend) DeleteWebhook(reg, name string) error

DeleteWebhook removes the webhook with its events; a missing one is not an error.

func (*InMemoryBackend) DescribeManifest

func (b *InMemoryBackend) DescribeManifest(ctx context.Context, reg, repo, ref string) (ManifestDetail, error)

DescribeManifest reads the manifest at repo:ref (a tag or digest) and summarises it.

func (*InMemoryBackend) FireManifest

func (b *InMemoryBackend) FireManifest(reg string, c ManifestChange)

FireManifest delivers the change to every enabled webhook of reg whose actions and scope match.

func (*InMemoryBackend) ForgetRepository

func (b *InMemoryBackend) ForgetRepository(reg, repo string) (Forgotten, bool)

ForgetRepository drops a repository's metadata and returns the digests and tags it held.

func (*InMemoryBackend) GenerateTokenPassword

func (b *InMemoryBackend) GenerateTokenPassword(reg, token, which string, expiry *time.Time) (TokenPassword, error)

GenerateTokenPassword replaces password1 or password2 of a token and returns the new value, which is never shown again.

func (*InMemoryBackend) HasWebhooks

func (b *InMemoryBackend) HasWebhooks(reg string) bool

HasWebhooks reports whether reg has any webhook.

func (*InMemoryBackend) ImportImage

func (b *InMemoryBackend) ImportImage(ctx context.Context, reg string, req ImportRequest) error

ImportImage copies an image from the source into the registry, as POST importImage does.

func (*InMemoryBackend) IssueAccessToken

func (b *InMemoryBackend) IssueAccessToken(reg, audience string, scopes []string) (string, error)

IssueAccessToken mints a registry access token for the requested scopes.

func (*InMemoryBackend) IssueRefreshToken

func (b *InMemoryBackend) IssueRefreshToken(reg, audience string) (string, error)

IssueRefreshToken mints the refresh token az acr login exchanges an Entra ID token for.

func (*InMemoryBackend) Manifests

func (b *InMemoryBackend) Manifests(reg, repo string) ([]ManifestView, bool)

Manifests lists a repository's manifests in lexical digest order.

func (*InMemoryBackend) Names

func (b *InMemoryBackend) Names() []string

Names lists registry names, in lookup order of the single-registry fallback.

func (*InMemoryBackend) PatchManifest

func (b *InMemoryBackend) PatchManifest(reg, repo, digest string, p AttrPatch) error

PatchManifest updates a manifest's attributes.

func (*InMemoryBackend) PatchRepository

func (b *InMemoryBackend) PatchRepository(reg, repo string, p AttrPatch) error

PatchRepository updates a repository's attributes.

func (*InMemoryBackend) PatchTag

func (b *InMemoryBackend) PatchTag(reg, repo, tag string, p AttrPatch) error

PatchTag updates a tag's attributes.

func (*InMemoryBackend) PingWebhook

func (b *InMemoryBackend) PingWebhook(reg, name string) (string, error)

PingWebhook delivers a ping event to the webhook and returns the event id.

func (*InMemoryBackend) PutRegistry

func (b *InMemoryBackend) PutRegistry(name string, adminEnabled bool) (RegistryInfo, error)

PutRegistry creates the registry or updates its admin-user flag.

func (*InMemoryBackend) RecordManifestDelete

func (b *InMemoryBackend) RecordManifestDelete(reg, repo, ref string)

RecordManifestDelete forgets a deleted manifest with its tags, or just the tag when ref is one. A manifest the deleted tag leaves untagged is scheduled for deletion when the retention policy is enabled. The caller holds the delete gate.

func (*InMemoryBackend) RecordManifestPut

func (b *InMemoryBackend) RecordManifestPut(reg, repo, ref, digest string)

RecordManifestPut notes a stored manifest, and the tag when ref is one. A manifest left without tags is scheduled for deletion when the registry's retention policy is enabled.

func (*InMemoryBackend) RegenerateCredential

func (b *InMemoryBackend) RegenerateCredential(name, which string) (Credentials, error)

RegenerateCredential replaces the "password" or "password2" credential and returns both.

func (*InMemoryBackend) Registry

func (b *InMemoryBackend) Registry(name string) (RegistryInfo, bool)

Registry returns the registry named name.

func (*InMemoryBackend) Repositories

func (b *InMemoryBackend) Repositories(reg string) []RepoView

Repositories lists the repositories holding at least one manifest, in lexical order.

func (*InMemoryBackend) Repository

func (b *InMemoryBackend) Repository(reg, repo string) (RepoView, bool)

Repository returns one repository's entry.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset removes every registry and its stored images.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads a snapshot, replacing every registry.

func (*InMemoryBackend) ScopeMaps

func (b *InMemoryBackend) ScopeMaps(reg string) ([]ScopeMap, error)

ScopeMaps lists the system and user scope maps of a registry, sorted by name.

func (*InMemoryBackend) SetAnonymousPull

func (b *InMemoryBackend) SetAnonymousPull(name string, enabled bool) error

SetAnonymousPull allows or refuses unauthenticated GET and HEAD of repository content.

func (*InMemoryBackend) SetCacheRule

func (b *InMemoryBackend) SetCacheRule(reg string, rule CacheRule) error

SetCacheRule creates or replaces a cache rule.

func (*InMemoryBackend) SetClock

func (b *InMemoryBackend) SetClock(now func() time.Time)

SetClock replaces the clock that dates ledger entries, retention deadlines and token expiry.

func (*InMemoryBackend) SetContext

func (b *InMemoryBackend) SetContext(ctx context.Context)

SetContext bounds the lifetime of the registries the backend builds.

func (*InMemoryBackend) SetDataDir

func (b *InMemoryBackend) SetDataDir(dir string)

SetDataDir keeps registry blobs under dir (one subdirectory per registry); empty keeps them in memory.

func (*InMemoryBackend) SetEncryptionKey

func (b *InMemoryBackend) SetEncryptionKey(name, keyIdentifier string) error

SetEncryptionKey records the registry's customer-managed key; empty clears it.

func (*InMemoryBackend) SetExportAllowed

func (b *InMemoryBackend) SetExportAllowed(name string, allowed bool) error

SetExportAllowed permits or refuses importing images out of the registry; Learn data-loss-prevention.

func (*InMemoryBackend) SetKeyChecker

func (b *InMemoryBackend) SetKeyChecker(c KeyChecker)

SetKeyChecker lets registries with a customer-managed key follow the state of that key.

func (*InMemoryBackend) SetNetworkRules

func (b *InMemoryBackend) SetNetworkRules(name string, n NetworkRules) error

SetNetworkRules replaces the registry's firewall.

func (*InMemoryBackend) SetRemoteImports

func (b *InMemoryBackend) SetRemoteImports(on bool)

SetRemoteImports allows importImage to read from registries outside this process.

func (*InMemoryBackend) SetRetentionSource

func (b *InMemoryBackend) SetRetentionSource(s RetentionSource)

SetRetentionSource lets registries delete untagged manifests after their retention period.

func (*InMemoryBackend) SetScopeMap

func (b *InMemoryBackend) SetScopeMap(reg, name, description string, actions []string) (ScopeMap, error)

SetScopeMap creates or replaces a user scope map; system scope maps cannot be changed.

func (*InMemoryBackend) SetSecretResolver

func (b *InMemoryBackend) SetSecretResolver(r SecretResolver)

SetSecretResolver lets cache rules read upstream credentials from Key Vault.

func (*InMemoryBackend) SetToken

func (b *InMemoryBackend) SetToken(reg, name, scopeMap string, enabled bool) error

SetToken creates a token or updates its scope map and status; passwords are kept.

func (*InMemoryBackend) SetWebhook

func (b *InMemoryBackend) SetWebhook(reg string, w Webhook) error

SetWebhook creates or replaces the webhook, keeping the events it already recorded.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises registries, credentials and image metadata. Blobs and manifests are not part of it: they live under the data directory when one is configured.

func (*InMemoryBackend) SweepRetention

func (b *InMemoryBackend) SweepRetention(ctx context.Context, reg string)

SweepRetention deletes the untagged manifests of reg whose retention period has elapsed on the backend clock. Only Docker manifests and manifest lists are deleted, and never a manifest an index references.

func (*InMemoryBackend) Tags

func (b *InMemoryBackend) Tags(reg, repo string) ([]TagView, bool)

Tags lists a repository's tags in lexical order.

func (*InMemoryBackend) TokenPasswords

func (b *InMemoryBackend) TokenPasswords(reg, token string) ([]TokenPassword, error)

TokenPasswords lists the generated passwords of a token without their values.

func (*InMemoryBackend) Tokens

func (b *InMemoryBackend) Tokens(reg string) ([]TokenView, error)

Tokens lists a registry's tokens, sorted by name.

func (*InMemoryBackend) UsedBytes

func (b *InMemoryBackend) UsedBytes(name string) (int64, error)

UsedBytes returns the bytes of blobs and manifests the registry stores; blobs are content-addressed, so a layer shared by several images counts once.

func (*InMemoryBackend) VerifyAccess

func (b *InMemoryBackend) VerifyAccess(tok, reg string) bool

VerifyAccess reports whether tok is an unexpired access token of reg.

func (*InMemoryBackend) VerifyAdmin

func (b *InMemoryBackend) VerifyAdmin(reg, user, password string) bool

VerifyAdmin reports whether user and password are the registry's enabled admin credentials.

func (*InMemoryBackend) VerifyRefresh

func (b *InMemoryBackend) VerifyRefresh(tok, reg string) bool

VerifyRefresh reports whether tok is an unexpired refresh token of reg.

func (*InMemoryBackend) VerifyToken

func (b *InMemoryBackend) VerifyToken(reg, user, password string) bool

VerifyToken reports whether user and password are an enabled token's unexpired credentials.

func (*InMemoryBackend) WebhookEvents

func (b *InMemoryBackend) WebhookEvents(reg, name string) ([]WebhookEvent, error)

WebhookEvents returns the webhook's recorded deliveries, oldest first.

type KeyChecker

type KeyChecker func(keyIdentifier string) error

KeyChecker reports whether the Key Vault key at keyIdentifier exists, is enabled and is an RSA key.

type ManifestChange

type ManifestChange struct {
	Req        RequestInfo
	Repository string
	Tag        string
	Digest     string
	MediaType  string
	ConfigType string
	Size       int64
	Delete     bool
}

ManifestChange is a manifest push or delete the registry observed.

type ManifestDetail

type ManifestDetail struct {
	Digest       string
	MediaType    string
	Architecture string
	OS           string
	Children     int
	Size         int64
	Index        bool
}

ManifestDetail summarises one stored manifest for inspection.

type ManifestView

type ManifestView struct {
	Created time.Time
	Updated time.Time
	Digest  string
	Tags    []string
	Attrs   attrs
}

ManifestView is a manifest's listing entry.

type NetworkRules

type NetworkRules struct {
	Allow          []string `json:"allow,omitempty"`
	PublicDisabled bool     `json:"publicDisabled,omitempty"`
	DefaultDeny    bool     `json:"defaultDeny,omitempty"`
}

NetworkRules is the public-endpoint firewall of a registry. Disabled public access overrides every IP rule (Learn: container-registry-access-selected-networks).

type Provider

type Provider struct{}

Provider implements service.Provider for Azure Container Registry.

func (*Provider) Init

Init builds the backend and handler; the port is bound by Handler.StartWorker.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the service provider name.

type RegistryInfo

type RegistryInfo struct {
	CreatedAt    time.Time
	Name         string
	AdminEnabled bool
}

RegistryInfo is the control-plane view of a registry.

type RepoView

type RepoView struct {
	Created       time.Time
	Updated       time.Time
	Name          string
	Attrs         attrs
	ManifestCount int
	TagCount      int
}

RepoView is a repository's listing entry.

type RequestInfo

type RequestInfo struct {
	ID        string
	Host      string
	Method    string
	Useragent string
}

RequestInfo describes the registry request behind a manifest event.

type RetentionSource

type RetentionSource func(registry string) (days int, enabled bool)

RetentionSource reports whether the untagged-manifest retention policy of a registry is enabled and its period in days.

type ScopeMap

type ScopeMap struct {
	CreatedAt   time.Time `json:"createdAt"`
	Name        string    `json:"name"`
	Description string    `json:"description,omitempty"`
	Actions     []string  `json:"actions"`
	System      bool      `json:"system,omitempty"`
}

ScopeMap is a named set of repository permissions applied to tokens.

type SecretResolver

type SecretResolver func(uri string) (string, error)

SecretResolver reads the value a Key Vault secret identifier URI points at.

type Settings

type Settings struct {
	TLSCertFile string `` //nolint:lll // config struct tags are intentionally verbose
	/* 236-byte string literal not displayed */
	TLSKeyFile string `` //nolint:lll // config struct tags are intentionally verbose
	/* 131-byte string literal not displayed */
	Port int `` //nolint:lll // config struct tags are intentionally verbose
	/* 267-byte string literal not displayed */
	RemoteImports bool `` //nolint:lll // config struct tags are intentionally verbose
	/* 267-byte string literal not displayed */
}

Settings is the Kong-embedded configuration of the Azure Container Registry emulator.

func DefaultSettings

func DefaultSettings() Settings

DefaultSettings returns the settings used when no ConfigProvider exists.

type TagView

type TagView struct {
	Created time.Time
	Updated time.Time
	Name    string
	Digest  string
	Attrs   attrs
}

TagView is a tag's listing entry.

type Token

type Token struct {
	CreatedAt time.Time      `json:"createdAt"`
	ScopeMap  string         `json:"scopeMap"`
	Name      string         `json:"name"`
	Passwords []*TokenSecret `json:"passwords,omitempty"`
	Disabled  bool           `json:"disabled,omitempty"`
}

Token authenticates with a generated password and is limited by its scope map.

type TokenPassword

type TokenPassword struct {
	Created time.Time
	Expiry  *time.Time
	Name    string
	Value   string
}

TokenPassword describes a token password; Value is set only when it has just been generated.

type TokenSecret

type TokenSecret struct {
	Created time.Time  `json:"created"`
	Expiry  *time.Time `json:"expiry,omitempty"`
	Digest  string     `json:"digest"`
}

TokenSecret is one of a token's two passwords; only a digest is kept.

type TokenView

type TokenView struct {
	CreatedAt time.Time
	Name      string
	ScopeMap  string
	Passwords []TokenPassword
	Enabled   bool
}

TokenView is a token with the metadata of its passwords.

type Webhook

type Webhook struct {
	Headers    map[string]string `json:"headers,omitempty"`
	Name       string            `json:"name"`
	ServiceURI string            `json:"serviceUri"`
	Scope      string            `json:"scope,omitempty"`
	Status     string            `json:"status"`
	Actions    []string          `json:"actions"`
}

Webhook is a registry webhook fired on image and chart pushes and deletes.

type WebhookEvent

type WebhookEvent struct {
	EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"`
	ID                   string                `json:"id"`
	EventRequestMessage  EventRequestMessage   `json:"eventRequestMessage"`
}

WebhookEvent is one recorded delivery attempt.

Jump to

Keyboard shortcuts

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