registry

package
v27.3.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const AuthHeader = "X-Registry-Auth"

AuthHeader is the name of the header used to send encoded registry authorization credentials for registry operations (push/pull).

Variables

This section is empty.

Functions

func EncodeAuthConfig

func EncodeAuthConfig(authConfig AuthConfig) (string, error)

EncodeAuthConfig serializes the auth configuration as a base64url encoded (RFC4648, section 5) JSON string for sending through the X-Registry-Auth header.

Types

type AuthConfig

type AuthConfig struct {
	Username string `json:"username,omitempty"`
	Password string `json:"password,omitempty"`
	Auth     string `json:"auth,omitempty"`

	// Email is an optional value associated with the username.
	// This field is deprecated and will be removed in a later
	// version of docker.
	Email string `json:"email,omitempty"`

	ServerAddress string `json:"serveraddress,omitempty"`

	// IdentityToken is used to authenticate the user and get
	// an access token for the registry.
	IdentityToken string `json:"identitytoken,omitempty"`

	// RegistryToken is a bearer token to be sent to a registry
	RegistryToken string `json:"registrytoken,omitempty"`
}

AuthConfig contains authorization information for connecting to a Registry.

func DecodeAuthConfig

func DecodeAuthConfig(authEncoded string) (*AuthConfig, error)

DecodeAuthConfig decodes base64url encoded (RFC4648, section 5) JSON authentication information as sent through the X-Registry-Auth header.

This function always returns an AuthConfig, even if an error occurs. It is up to the caller to decide if authentication is required, and if the error can be ignored.

func DecodeAuthConfigBody

func DecodeAuthConfigBody(rdr io.ReadCloser) (*AuthConfig, error)

DecodeAuthConfigBody decodes authentication information as sent as JSON in the body of a request. This function is to provide backward compatibility with old clients and API versions. Current clients and API versions expect authentication to be provided through the X-Registry-Auth header.

Like DecodeAuthConfig, this function always returns an AuthConfig, even if an error occurs. It is up to the caller to decide if authentication is required, and if the error can be ignored.

type AuthenticateOKBody

type AuthenticateOKBody struct {

	// An opaque token used to authenticate a user after a successful login
	// Required: true
	IdentityToken string `json:"IdentityToken"`

	// The status of the authentication
	// Required: true
	Status string `json:"Status"`
}

AuthenticateOKBody authenticate o k body swagger:model AuthenticateOKBody

type DistributionInspect

type DistributionInspect struct {
	// Descriptor contains information about the manifest, including
	// the content addressable digest
	Descriptor ocispec.Descriptor
	// Platforms contains the list of platforms supported by the image,
	// obtained by parsing the manifest
	Platforms []ocispec.Platform
}

DistributionInspect describes the result obtained from contacting the registry to retrieve image metadata

type IndexInfo

type IndexInfo struct {
	// Name is the name of the registry, such as "docker.io"
	Name string
	// Mirrors is a list of mirrors, expressed as URIs
	Mirrors []string
	// Secure is set to false if the registry is part of the list of
	// insecure registries. Insecure registries accept HTTP and/or accept
	// HTTPS with certificates from unknown CAs.
	Secure bool
	// Official indicates whether this is an official registry
	Official bool
}

IndexInfo contains information about a registry

RepositoryInfo Examples:

{
  "Index" : {
    "Name" : "docker.io",
    "Mirrors" : ["https://registry-2.docker.io/v1/", "https://registry-3.docker.io/v1/"],
    "Secure" : true,
    "Official" : true,
  },
  "RemoteName" : "library/debian",
  "LocalName" : "debian",
  "CanonicalName" : "docker.io/debian"
  "Official" : true,
}

{
  "Index" : {
    "Name" : "127.0.0.1:5000",
    "Mirrors" : [],
    "Secure" : false,
    "Official" : false,
  },
  "RemoteName" : "user/repo",
  "LocalName" : "127.0.0.1:5000/user/repo",
  "CanonicalName" : "127.0.0.1:5000/user/repo",
  "Official" : false,
}

type NetIPNet

type NetIPNet net.IPNet

NetIPNet is the net.IPNet type, which can be marshalled and unmarshalled to JSON

func (*NetIPNet) MarshalJSON

func (ipnet *NetIPNet) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of the IPNet

func (*NetIPNet) String

func (ipnet *NetIPNet) String() string

String returns the CIDR notation of ipnet

func (*NetIPNet) UnmarshalJSON

func (ipnet *NetIPNet) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON sets the IPNet from a byte array of JSON

type SearchOptions

type SearchOptions struct {
	RegistryAuth string

	// PrivilegeFunc is a [types.RequestPrivilegeFunc] the client can
	// supply to retry operations after getting an authorization error.
	//
	// It must return the registry authentication header value in base64
	// format, or an error if the privilege request fails.
	PrivilegeFunc func(context.Context) (string, error)
	Filters       filters.Args
	Limit         int
}

SearchOptions holds parameters to search images with.

type SearchResult

type SearchResult struct {
	// StarCount indicates the number of stars this repository has
	StarCount int `json:"star_count"`
	// IsOfficial is true if the result is from an official repository.
	IsOfficial bool `json:"is_official"`
	// Name is the name of the repository
	Name string `json:"name"`
	// IsAutomated indicates whether the result is automated.
	//
	// Deprecated: the "is_automated" field is deprecated and will always be "false".
	IsAutomated bool `json:"is_automated"`
	// Description is a textual description of the repository
	Description string `json:"description"`
}

SearchResult describes a search result returned from a registry

type SearchResults

type SearchResults struct {
	// Query contains the query string that generated the search results
	Query string `json:"query"`
	// NumResults indicates the number of results the query returned
	NumResults int `json:"num_results"`
	// Results is a slice containing the actual results for the search
	Results []SearchResult `json:"results"`
}

SearchResults lists a collection search results returned from a registry

type ServiceConfig

type ServiceConfig struct {
	AllowNondistributableArtifactsCIDRs     []*NetIPNet
	AllowNondistributableArtifactsHostnames []string
	InsecureRegistryCIDRs                   []*NetIPNet           `json:"InsecureRegistryCIDRs"`
	IndexConfigs                            map[string]*IndexInfo `json:"IndexConfigs"`
	Mirrors                                 []string
}

ServiceConfig stores daemon registry services configuration.

Jump to

Keyboard shortcuts

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