public boolean doPushBearerAuth() throws IOException, RegistryException {
    return doBearerAuth(false);
  }
Attempts bearer authentication for pull and push.

@return true if bearer authentication succeeded; false if the server expects basic
    authentication (and thus bearer authentication was not attempted)
@throws IOException if communicating with the endpoint fails
@throws RegistryException if communicating with the endpoint fails
@throws RegistryAuthenticationFailedException if authentication fails
@throws RegistryCredentialsNotSentException if authentication failed and credentials were not
    sent over plain HTTP
jib-core/src/main/java/com/google/cloud/tools/jib/registry/RegistryClient.java