class RegistryClient {

  public void configureBasicAuth() {
    Preconditions.checkNotNull(credential);
    Preconditions.checkState(!credential.isOAuth2RefreshToken());

    authorization.set(
        Authorization.fromBasicCredentials(credential.getUsername(), credential.getPassword()));

    String registry = registryEndpointRequestProperties.getServerUrl();
    String repository = registryEndpointRequestProperties.getImageName();
    eventHandlers.dispatch(
        LogEvent.debug("configured basic auth for " + registry + "/" + repository));
  }

  private  RegistryClient(
      EventHandlers eventHandlers,
      @Nullable Credential credential,
      RegistryEndpointRequestProperties registryEndpointRequestProperties,
      @Nullable String userAgent,
      FailoverHttpClient httpClient);

}