DockerRegistryAuthentication Type — spring-boot Architecture
Architecture documentation for the DockerRegistryAuthentication type/interface in DockerRegistryAuthentication.java from the spring-boot codebase.
Entity Profile
Source Code
buildpack/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/configuration/DockerRegistryAuthentication.java lines 32–118
@FunctionalInterface
public interface DockerRegistryAuthentication {
/**
* An empty {@link #user(String, String, String, String)} authentication.
* @since 3.5.0
*/
DockerRegistryAuthentication EMPTY_USER = DockerRegistryAuthentication.user("", "", "", "");
/**
* Returns the auth header that should be used for docker authentication for the given
* image reference.
* @param imageReference the image reference or {@code null}
* @return the auth header
* @since 3.5.0
*/
default @Nullable String getAuthHeader(@Nullable ImageReference imageReference) {
return getAuthHeader();
}
/**
* Returns the auth header that should be used for docker authentication.
* @return the auth header
*/
@Nullable String getAuthHeader();
/**
* Factory method to that returns a new {@link DockerRegistryAuthentication} instance
* that uses a header generated by base64 encoding a JSON payload created from the
* given parameters.
* @param identityToken the identity token JSON field
* @return a new {@link DockerRegistryAuthentication} instance
* @since 3.5.0
*/
static DockerRegistryAuthentication token(String identityToken) {
return new DockerRegistryTokenAuthentication(identityToken);
}
/**
* Factory method to that returns a new {@link DockerRegistryAuthentication} instance
* that uses a header generated by base64 encoding a JSON payload created from the
* given parameters.
* @param username the username JSON field
* @param password the password JSON field
* @param serverAddress the server address JSON field
* @param email the email JSON field
* @return a new {@link DockerRegistryAuthentication} instance
* @since 3.5.0
*/
static DockerRegistryAuthentication user(String username, String password, @Nullable String serverAddress,
@Nullable String email) {
return new DockerRegistryUserAuthentication(username, password, serverAddress, email);
}
/**
* Factory method that returns a new {@link DockerRegistryAuthentication} instance
* that uses the standard docker JSON config (including support for credential
* helpers) to generate auth headers.
* @param fallback the fallback authentication to use if no suitable config is found,
* may be {@code null}
* @return a new {@link DockerRegistryAuthentication} instance
* @since 3.5.0
* @see #configuration(DockerRegistryAuthentication, BiConsumer)
*/
static DockerRegistryAuthentication configuration(@Nullable DockerRegistryAuthentication fallback) {
return configuration(fallback, (message, ex) -> System.out.println(message));
}
/**
* Factory method that returns a new {@link DockerRegistryAuthentication} instance
* that uses the standard docker JSON config (including support for credential
* helpers) to generate auth headers.
* @param fallback the fallback authentication to use if no suitable config is found,
* may be {@code null}
* @param credentialHelperExceptionHandler callback that should handle credential
* helper exceptions, never {@code null}
* @return a new {@link DockerRegistryAuthentication} instance
* @since 3.5.0
* @see #configuration(DockerRegistryAuthentication, BiConsumer)
*/
static DockerRegistryAuthentication configuration(@Nullable DockerRegistryAuthentication fallback,
BiConsumer<String, Exception> credentialHelperExceptionHandler) {
Assert.notNull(credentialHelperExceptionHandler, () -> "'credentialHelperExceptionHandler' must not be null");
return new DockerRegistryConfigAuthentication(fallback, credentialHelperExceptionHandler);
}
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free