Skip to content

Commit ac8c353

Browse files
authored
Revert "fix: Issue #1347: ExternalAccountCredentials serialization is broken" (#1359)
1 parent 06253eb commit ac8c353

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
import com.google.errorprone.annotations.CanIgnoreReturnValue;
4343
import java.io.IOException;
4444
import java.io.InputStream;
45-
import java.io.ObjectInputStream;
4645
import java.math.BigDecimal;
4746
import java.net.URI;
4847
import java.nio.charset.StandardCharsets;
@@ -541,13 +540,6 @@ public CredentialSource getCredentialSource() {
541540
return credentialSource;
542541
}
543542

544-
@SuppressWarnings("unused")
545-
private void readObject(ObjectInputStream input) throws IOException, ClassNotFoundException {
546-
// Properly deserialize the transient transportFactory.
547-
input.defaultReadObject();
548-
transportFactory = newInstance(transportFactoryClassName);
549-
}
550-
551543
@Nullable
552544
public String getServiceAccountImpersonationUrl() {
553545
return serviceAccountImpersonationUrl;

google-auth-library-java/oauth2_http/javatests/com/google/auth/oauth2/ExternalAccountCredentialsTest.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,9 +1117,6 @@ public void serialize() throws IOException, ClassNotFoundException {
11171117
testCredentials.getServiceAccountImpersonationOptions().getLifetime(),
11181118
deserializedCredentials.getServiceAccountImpersonationOptions().getLifetime());
11191119
assertSame(deserializedCredentials.clock, Clock.SYSTEM);
1120-
assertEquals(
1121-
MockExternalAccountCredentialsTransportFactory.class,
1122-
deserializedCredentials.toBuilder().getHttpTransportFactory().getClass());
11231120
}
11241121

11251122
@Test
@@ -1310,30 +1307,17 @@ protected TestCredentialSource(Map<String, Object> credentialSourceMap) {
13101307
}
13111308
}
13121309

1313-
@Override
1314-
public Builder toBuilder() {
1315-
return new Builder(this);
1316-
}
1317-
13181310
public static Builder newBuilder() {
13191311
return new Builder();
13201312
}
13211313

13221314
static class Builder extends ExternalAccountCredentials.Builder {
13231315
Builder() {}
13241316

1325-
Builder(TestExternalAccountCredentials credentials) {
1326-
super(credentials);
1327-
}
1328-
13291317
@Override
13301318
public TestExternalAccountCredentials build() {
13311319
return new TestExternalAccountCredentials(this);
13321320
}
1333-
1334-
public HttpTransportFactory getHttpTransportFactory() {
1335-
return transportFactory;
1336-
}
13371321
}
13381322

13391323
protected TestExternalAccountCredentials(ExternalAccountCredentials.Builder builder) {

0 commit comments

Comments
 (0)