Documentation ¶
Index ¶
Constants ¶
const DefaultRegistryBinaryPath = "./tmp/test/bin/registry"
Variables ¶
This section is empty.
Functions ¶
func CreateHtpasswd ¶
CreateHtpasswd creates a htpasswd string for a username and password
func RandString ¶
RandString creates a random string with n characters.
Types ¶
type Auth ¶
type Auth struct { Silly *SillyAuth `json:"silly,omitempty"` Httpasswd *HttpasswdAuth `json:"htpasswd,omitempty"` }
Auth describes the authentication mechanism that should be used for the registry. https://github.com/distribution/distribution/blob/main/docs/configuration.md#auth
type Certificate ¶
Certificate defines a certificate with a CA. All certs and keys are PEM encoded.
func GenerateCertificates ¶
func GenerateCertificates() (*Certificate, error)
GenerateCertificates generates a new ca and signed cert. Generated cert is only valid for 127.0.0.1. Only use this for testing as insecure keys are used.
type Environment ¶
type Environment struct { RegistryBinaryPath string RegistryConfiguration RegistryConfiguration ReadinessTimeout time.Duration Stdout io.Writer Stderr io.Writer Certificate *Certificate // Contains the host information as soon as the registry is started. // The host is of the format "ip:port" Addr string // Transport to communicate with the registry. // Includes the trusted ca. Transport *http.Transport // BasicAuth defines the basic auth credentials to access the registry. BasicAuth *BasicAuth // contains filtered or unexported fields }
func (*Environment) Close ¶
func (e *Environment) Close() error
func (*Environment) GetConfigFileBytes ¶
func (e *Environment) GetConfigFileBytes() ([]byte, error)
GetConfigFileBytes returns the docker configfile containing the registry auth for the registry.
func (*Environment) WaitForRegistryToBeHealthy ¶
func (e *Environment) WaitForRegistryToBeHealthy() error
type FilesystemStorage ¶
type HTTPConfig ¶
type HTTPConfig struct { // Defaults to localhost:5000 Addr string `json:"addr,omitempty"` Prefix string `json:"prefix,omitempty"` Host string `json:"host,omitempty"` TLS *HTTPTLSConfig `json:"tls,omitempty"` }
type HTTPTLSConfig ¶
type HttpasswdAuth ¶
HttpasswdAuth allows you to configure basic authentication using an Apache htpasswd file. The only supported password format is bcrypt. Entries with other hash types are ignored. The htpasswd file is loaded once, at startup. If the file is invalid, the registry will display an error and will not start.
type Options ¶
type RegistryConfiguration ¶
type RegistryConfiguration struct { Version string `json:"version"` Storage Storage `json:"storage,omitempty"` Auth Auth `json:"auth,omitempty"` HTTPConfig HTTPConfig `json:"http,omitempty"` }
RegistryConfiguration contains the docker registry configuration. See https://docs.docker.com/registry/configuration/ for more configuration options
func (*RegistryConfiguration) Default ¶
func (cfg *RegistryConfiguration) Default(tmpDir string) error
Default applies defaults to the registry configuration.
type SillyAuth ¶
SillyAuth is only appropriate for development. It simply checks for the existence of the Authorization header in the HTTP request. It does not check the header’s value. If the header does not exist, the silly auth responds with a challenge response, echoing back the realm, service, and scope for which access was denied.
type Storage ¶
type Storage struct {
Filesystem *FilesystemStorage `json:"filesystem,omitempty"`
}