dockerreg package¶
Subpackages¶
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.
-
class
dockerreg.auth.
BearerToken
(token, realm, expires_in=0, issued_at='', username=None, fields={})[source]¶ Bases:
dockerreg.auth.AuthorizationValue
-
field_string
¶
-
realm
¶
-
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.
-
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
-
-
class
dockerreg.auth.
DockerConfigAuth
(configfile=None)[source]¶ Bases:
dockerreg.auth.Auth
dockerreg.exceptions module¶
-
exception
dockerreg.exceptions.
DockerRegistryAPIError
(httpcode, errors=[])[source]¶ Bases:
dockerreg.exceptions.DockerRegistryError
-
count
¶
-
httpcode
¶
-
-
exception
dockerreg.exceptions.
DockerRegistryError
[source]¶ Bases:
exceptions.Exception