Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuthConfig ¶
type BasicAuthConfig struct {
// Auth is the base64 encoded "username:password" string.
Auth *Token `json:"auth,omitempty" yaml:"auth,omitempty"`
// Username holds the username used to gain access to a non-public image.
Username string `json:"username" yaml:"username"`
// Password holds the password used to gain access to a non-public image.
Password string `json:"password" yaml:"password"`
}
BasicAuthConfig contains authorization information for basic auth.
func (BasicAuthConfig) Empty ¶
func (ba BasicAuthConfig) Empty() bool
Empty checks if the auth information is empty.
func (*BasicAuthConfig) Validate ¶
func (ba *BasicAuthConfig) Validate() error
Validate validates the spec.
type ImageRepoDetails ¶
type ImageRepoDetails struct {
BasicAuthConfig `json:",inline" yaml:",inline"`
TokenAuthConfig `json:",inline" yaml:",inline"`
// Repository is the namespace of the image repo.
Repository string `json:"repository,omitempty" yaml:"repository,omitempty"`
// ServerAddress is the auth server address.
ServerAddress string `json:"serveraddress,omitempty" yaml:"serveraddress,omitempty"`
// Region is the cloud region.
Region string `json:"region,omitempty" yaml:"region,omitempty"`
}
ImageRepoDetails contains authorization information for connecting to a Registry.
func NewImageRepoDetails ¶
func NewImageRepoDetails(contentOrPath string) (o *ImageRepoDetails, err error)
NewImageRepoDetails tries to parse a file path or file content and returns an instance of ImageRepoDetails.
func (ImageRepoDetails) AuthEqual ¶
func (rid ImageRepoDetails) AuthEqual(r ImageRepoDetails) bool
AuthEqual compares if the provided one equals to current repository detail.
func (ImageRepoDetails) Content ¶
func (rid ImageRepoDetails) Content() string
Content returns the json marshalled string with raw credentials.
func (ImageRepoDetails) Empty ¶
func (rid ImageRepoDetails) Empty() bool
Empty checks if the auth information is empty.
func (ImageRepoDetails) IsPrivate ¶
func (rid ImageRepoDetails) IsPrivate() bool
IsPrivate checks if the repository detail is private.
func (ImageRepoDetails) SecretData ¶
func (rid ImageRepoDetails) SecretData() ([]byte, error)
SecretData returns secret data format.
func (*ImageRepoDetails) Validate ¶
func (rid *ImageRepoDetails) Validate() error
Validate validates the spec.
type Token ¶
type Token struct {
// Value is the value of the token.
Value string
// ExpiresAt is the unix time in seconds and milliseconds when the authorization token expires.
ExpiresAt *time.Time
}
Token defines a token value with expiration time.
func (Token) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (*Token) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaller interface.
type TokenAuthConfig ¶
type TokenAuthConfig struct {
Email string `json:"email,omitempty" yaml:"email,omitempty"`
// IdentityToken is used to authenticate the user and get
// an access token for the registry.
IdentityToken *Token `json:"identitytoken,omitempty" yaml:"identitytoken,omitempty"`
// RegistryToken is a bearer token to be sent to a registry
RegistryToken *Token `json:"registrytoken,omitempty" yaml:"registrytoken,omitempty"`
}
TokenAuthConfig contains authorization information for token auth. Juju does not support the docker credential helper because k8s does not support it either. https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-registry
func (TokenAuthConfig) Empty ¶
func (ac TokenAuthConfig) Empty() bool
Empty checks if the auth information is empty.
func (*TokenAuthConfig) Validate ¶
func (ac *TokenAuthConfig) Validate() error
Validate validates the spec.