@Override public final String toString() { return MoreObjects.toStringHelper(RegistryAuth.class) .add("username", username()) // don't log the password or email .add("serveraddress", serverAddress()) .add("identitytoken", identityToken()) .toString(); }
/** * Set the auth parameters for pull/push requests from/to private repositories. * * @param registryAuth RegistryAuth object * @return Builder * * @deprecated in favor of {@link #registryAuthSupplier(RegistryAuthSupplier)} */ @Deprecated public Builder registryAuth(final RegistryAuth registryAuth) { if (this.registryAuthSupplier != null) { throw new IllegalStateException(ERROR_MESSAGE); } this.registryAuth = registryAuth; // stuff the static RegistryAuth into a RegistryConfigs instance to maintain what // DefaultDockerClient used to do with the RegistryAuth before we introduced the // RegistryAuthSupplier final RegistryConfigs configs = RegistryConfigs.create(singletonMap( MoreObjects.firstNonNull(registryAuth.serverAddress(), ""), registryAuth )); this.registryAuthSupplier = new FixedRegistryAuthSupplier(registryAuth, configs); return this; }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RegistryAuth) { RegistryAuth that = (RegistryAuth) o; return ((this.username == null) ? (that.username() == null) : this.username.equals(that.username())) && ((this.password == null) ? (that.password() == null) : this.password.equals(that.password())) && ((this.email == null) ? (that.email() == null) : this.email.equals(that.email())) && ((this.serverAddress == null) ? (that.serverAddress() == null) : this.serverAddress.equals(that.serverAddress())) && ((this.identityToken == null) ? (that.identityToken() == null) : this.identityToken.equals(that.identityToken())); } return false; }
Builder(RegistryAuth source) { this.username = source.username(); this.password = source.password(); this.email = source.email(); this.serverAddress = source.serverAddress(); this.identityToken = source.identityToken(); } @Override
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof RegistryAuth) { RegistryAuth that = (RegistryAuth) o; return ((this.username == null) ? (that.username() == null) : this.username.equals(that.username())) && ((this.password == null) ? (that.password() == null) : this.password.equals(that.password())) && ((this.email == null) ? (that.email() == null) : this.email.equals(that.email())) && ((this.serverAddress == null) ? (that.serverAddress() == null) : this.serverAddress.equals(that.serverAddress())) && ((this.identityToken == null) ? (that.identityToken() == null) : this.identityToken.equals(that.identityToken())); } return false; }
/** * Set the auth parameters for pull/push requests from/to private repositories. * * @param registryAuth RegistryAuth object * @return Builder * * @deprecated in favor of {@link #registryAuthSupplier(RegistryAuthSupplier)} */ @Deprecated public Builder registryAuth(final RegistryAuth registryAuth) { if (this.registryAuthSupplier != null) { throw new IllegalStateException(ERROR_MESSAGE); } this.registryAuth = registryAuth; // stuff the static RegistryAuth into a RegistryConfigs instance to maintain what // DefaultDockerClient used to do with the RegistryAuth before we introduced the // RegistryAuthSupplier final RegistryConfigs configs = RegistryConfigs.create(singletonMap( MoreObjects.firstNonNull(registryAuth.serverAddress(), ""), registryAuth )); this.registryAuthSupplier = new FixedRegistryAuthSupplier(registryAuth, configs); return this; }
Builder(RegistryAuth source) { this.username = source.username(); this.password = source.password(); this.email = source.email(); this.serverAddress = source.serverAddress(); this.identityToken = source.identityToken(); } @Override
@Override public final String toString() { return MoreObjects.toStringHelper(RegistryAuth.class) .add("username", username()) // don't log the password or email .add("serveraddress", serverAddress()) .add("identitytoken", identityToken()) .toString(); }