dockerreg package

Submodules

dockerreg.auth module

class dockerreg.auth.Auth[source]

Bases: object

get_auth(host, username=None, repository=None)[source]

Return a py:class:AuthValue encoded HTTP Authorization header value that matches the host, repository, and username arguments. If None is returned, and if username=None, our caller will attempt an anonymous login (i.e., no Authorization header sent to the token server). So, if a given Auth module does not want to support anonymous authentication attempts, it must throw a py:class:dockerreg.exceptions.MissingCredentialsError if username=None, rather than returning None in that case.

Parameters:
  • (str) (repository) – the FQDN of the registry (possibly with a :port appended if desired).
  • (str) – if the credential should be keyed on a username, filter results by that username.
  • (str) – if the credential should be keyed on a specific repository, filter by that repo name.

:return (py:class:AuthValue): a py:class:AuthValue encoded HTTP Authorization header value that matches the host, repository, and username arguments.

class dockerreg.auth.AuthorizationValue[source]

Bases: object

An object representing the value for an HTTP Authorization header.

expired(slop=0)[source]
Parameters:(int) (slop) – Number of seconds plus current time to declare the token expired.
Returns (bool):True if token has expired or will expire prior to now + slop; False if not.
scheme()[source]
Returns (str):the HTTP Authorization header scheme (i.e. Basic or Bearer).
token()[source]
Returns:an encoded token value.
class dockerreg.auth.BasicAuthToken(username, password)[source]

Bases: dockerreg.auth.AuthorizationValue

__init__(username, password)[source]
expired(slop=0)[source]
classmethod from_b64(kls, b64str)[source]
scheme()[source]
token()[source]
class dockerreg.auth.BearerToken(token, realm, expires_in=0, issued_at='', username=None, fields={})[source]

Bases: dockerreg.auth.AuthorizationValue

__init__(token, realm, expires_in=0, issued_at='', username=None, fields={})[source]
expired(slop=0)[source]
field_string
classmethod from_json_http_response(kls, response_json, realm, username=None, fields={})[source]
realm
scheme()[source]
token()[source]
username
class dockerreg.auth.BearerTokenCache(slop=0, filename='~/.dockerreg.token-cache')[source]

Bases: object

Caches Bearer tokens according to the fields in the original WWW-Authenticate response header (response being the HTTP response to an unauthenticated request). Ages out tokens when they are within a slop factor of expiration.

__init__(slop=0, filename='~/.dockerreg.token-cache')[source]
add(token)[source]
cache = None

A multi-level dict; first key is host/repository; second level is an ordered string of the fields from the WWW-Authenticate header that generated this token

format_dump(sep='\n', expired=True)[source]
get(realm, username=None, fields={})[source]
purge_expired()[source]
reset()[source]
save()[source]
class dockerreg.auth.DockerConfigAuth(configfile=None)[source]

Bases: dockerreg.auth.Auth

__init__(configfile=None)[source]
classmethod configfile_exists(kls, configfile=None)[source]
get_auth(host, username=None, repository=None)[source]
class dockerreg.auth.IndexedBasicAuth(db)[source]

Bases: dockerreg.auth.Auth

__init__(db)[source]
classmethod from_dict(kls, d)[source]
classmethod from_user_pass(kls, host, username, password=None, skip_docker_config=False)[source]
get_auth(host, username=None, repository=None)[source]

dockerreg.exceptions module

exception dockerreg.exceptions.AuthStorageError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.AuthorizationRequiredError(errors=[])[source]

Bases: dockerreg.exceptions.DockerRegistryAPIError

__init__(errors=[])[source]
exception dockerreg.exceptions.BearerRedirectError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.BearerTokenError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.DockerRegistryAPIError(httpcode, errors=[])[source]

Bases: dockerreg.exceptions.DockerRegistryError

__init__(httpcode, errors=[])[source]
code(idx=0)[source]
count
detail(idx=0)[source]
httpcode
message(idx=0)[source]
exception dockerreg.exceptions.DockerRegistryError[source]

Bases: exceptions.Exception

exception dockerreg.exceptions.IllegalArgumentError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.ImageNotFoundError(errors=[])[source]

Bases: dockerreg.exceptions.DockerRegistryAPIError

__init__(errors=[])[source]
exception dockerreg.exceptions.LayerContentMismatch[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.LayerNotFoundError(errors=[])[source]

Bases: dockerreg.exceptions.DockerRegistryAPIError

__init__(errors=[])[source]
exception dockerreg.exceptions.MalformedManifestError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.MalformedManifestListError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.MissingCredentialsError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.ModelApiVersionMismatch[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.RepositoryNotFoundError(errors=[])[source]

Bases: dockerreg.exceptions.DockerRegistryAPIError

__init__(errors=[])[source]
exception dockerreg.exceptions.TagNotFoundError(errors=[])[source]

Bases: dockerreg.exceptions.DockerRegistryAPIError

__init__(errors=[])[source]
exception dockerreg.exceptions.UnknownManifestFormat[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.UnsupportedAuthorizationTypeError[source]

Bases: dockerreg.exceptions.DockerRegistryError

exception dockerreg.exceptions.UnsupportedRegistryVersionError[source]

Bases: dockerreg.exceptions.DockerRegistryError

dockerreg.log module

dockerreg.log.getLogger()[source]
dockerreg.log.isEnabled()[source]
dockerreg.log.logEnable(level)[source]
dockerreg.log.setLogger(new_logger)[source]

dockerreg.version module

Module contents