DockerCredentials

class controller.models.domain.docker.DockerCredentials(username, password)

Bases: object

Holds the credentials for one Docker API server.

Parameters:
  • username (str)

  • password (str)

Attributes Summary

authorization

Authentication string for Authorization header.

credentials

Credentials in encoded form suitable for Authorization.

Methods Summary

from_config(config)

Create from a Docker config entry (such as a pull secret).

to_config()

Convert the credentials to a Docker config entry.

Attributes Documentation

authorization

Authentication string for Authorization header.

credentials

Credentials in encoded form suitable for Authorization.

Methods Documentation

classmethod from_config(config)

Create from a Docker config entry (such as a pull secret).

This requires the auth field be set and ignores the username and password field.

Parameters:

config (dict[str, str]) – The entry for that hostname in the configuration.

Returns:

The resulting credentials.

Return type:

DockerCredentials

to_config()

Convert the credentials to a Docker config entry.

Return type:

dict[str, str]

Returns:

Docker config entry for this host.