use of com.google.cloud.tools.jib.registry.RegistryAuthenticator in project jib by google.
the class AuthenticatePushStep method call.
/**
* Depends on {@link RetrieveRegistryCredentialsStep}.
*/
@Override
@Nullable
public Authorization call() throws ExecutionException, InterruptedException, RegistryAuthenticationFailedException, IOException, RegistryException {
try (Timer ignored = new Timer(buildConfiguration.getBuildLogger(), String.format(DESCRIPTION, buildConfiguration.getTargetRegistry()))) {
Authorization registryCredentials = NonBlockingFutures.get(registryCredentialsFuture);
RegistryAuthenticator registryAuthenticator = RegistryAuthenticators.forOther(buildConfiguration.getTargetRegistry(), buildConfiguration.getTargetRepository());
if (registryAuthenticator == null) {
return registryCredentials;
}
return registryAuthenticator.setAuthorization(NonBlockingFutures.get(registryCredentialsFuture)).authenticatePush();
}
}
use of com.google.cloud.tools.jib.registry.RegistryAuthenticator in project jib by google.
the class AuthenticatePullStep method call.
/**
* Depends on {@link RetrieveRegistryCredentialsStep}.
*/
@Override
public Authorization call() throws RegistryAuthenticationFailedException, IOException, RegistryException, ExecutionException, InterruptedException {
try (Timer ignored = new Timer(buildConfiguration.getBuildLogger(), String.format(DESCRIPTION, buildConfiguration.getBaseImageRegistry()))) {
Authorization registryCredentials = NonBlockingFutures.get(registryCredentialsFuture);
RegistryAuthenticator registryAuthenticator = RegistryAuthenticators.forOther(buildConfiguration.getBaseImageRegistry(), buildConfiguration.getBaseImageRepository());
if (registryAuthenticator == null) {
return registryCredentials;
}
return registryAuthenticator.setAuthorization(registryCredentials).authenticatePull();
}
}
Aggregations