Interface DockerRegistryAuthentication
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Docker registry authentication configuration.
- Since:
- 2.4.0
- Author:
- Scott Frederick
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DockerRegistryAuthenticationAn emptyuser(String, String, String, String)authentication. -
Method Summary
Modifier and TypeMethodDescriptionstatic DockerRegistryAuthenticationconfiguration(DockerRegistryAuthentication fallback) Factory method that returns a newDockerRegistryAuthenticationinstance that uses the standard docker JSON config (including support for credential helpers) to generate auth headers.static DockerRegistryAuthenticationconfiguration(DockerRegistryAuthentication fallback, BiConsumer<String, Exception> credentialHelperExceptionHandler) Factory method that returns a newDockerRegistryAuthenticationinstance that uses the standard docker JSON config (including support for credential helpers) to generate auth headers.Returns the auth header that should be used for docker authentication.default StringgetAuthHeader(ImageReference imageReference) Returns the auth header that should be used for docker authentication for the given image reference.static DockerRegistryAuthenticationFactory method to that returns a newDockerRegistryAuthenticationinstance that uses a header generated by base64 encoding a JSON payload created from the given parameters.static DockerRegistryAuthenticationFactory method to that returns a newDockerRegistryAuthenticationinstance that uses a header generated by base64 encoding a JSON payload created from the given parameters.
-
Field Details
-
EMPTY_USER
An emptyuser(String, String, String, String)authentication.- Since:
- 3.5.0
-
-
Method Details
-
getAuthHeader
Returns the auth header that should be used for docker authentication for the given image reference.- Parameters:
imageReference- the image reference ornull- Returns:
- the auth header
- Since:
- 3.5.0
-
getAuthHeader
String getAuthHeader()Returns the auth header that should be used for docker authentication.- Returns:
- the auth header
-
token
Factory method to that returns a newDockerRegistryAuthenticationinstance that uses a header generated by base64 encoding a JSON payload created from the given parameters.- Parameters:
identityToken- the identity token JSON field- Returns:
- a new
DockerRegistryAuthenticationinstance - Since:
- 3.5.0
-
user
static DockerRegistryAuthentication user(String username, String password, String serverAddress, String email) Factory method to that returns a newDockerRegistryAuthenticationinstance that uses a header generated by base64 encoding a JSON payload created from the given parameters.- Parameters:
username- the username JSON fieldpassword- the password JSON fieldserverAddress- the server address JSON fieldemail- the email JSON field- Returns:
- a new
DockerRegistryAuthenticationinstance - Since:
- 3.5.0
-
configuration
Factory method that returns a newDockerRegistryAuthenticationinstance that uses the standard docker JSON config (including support for credential helpers) to generate auth headers.- Parameters:
fallback- the fallback authentication to use if no suitable config is found, may benull- Returns:
- a new
DockerRegistryAuthenticationinstance - Since:
- 3.5.0
- See Also:
-
configuration
static DockerRegistryAuthentication configuration(DockerRegistryAuthentication fallback, BiConsumer<String, Exception> credentialHelperExceptionHandler) Factory method that returns a newDockerRegistryAuthenticationinstance that uses the standard docker JSON config (including support for credential helpers) to generate auth headers.- Parameters:
fallback- the fallback authentication to use if no suitable config is found, may benullcredentialHelperExceptionHandler- callback that should handle credential helper exceptions, nevernull- Returns:
- a new
DockerRegistryAuthenticationinstance - Since:
- 3.5.0
- See Also:
-