Skip to content

Commit e0bcaa2

Browse files
committed
fix: Override toBuilder() for ExternalAccountCredential and subclasses
1 parent 1669dc8 commit e0bcaa2

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

oauth2_http/java/com/google/auth/oauth2/AwsCredentials.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,11 @@ public static AwsCredentials.Builder newBuilder(AwsCredentials awsCredentials) {
233233
return new AwsCredentials.Builder(awsCredentials);
234234
}
235235

236+
@Override
237+
public AwsCredentials.Builder toBuilder() {
238+
return new AwsCredentials.Builder(this);
239+
}
240+
236241
public static class Builder extends ExternalAccountCredentials.Builder {
237242

238243
private AwsSecurityCredentialsSupplier awsSecurityCredentialsSupplier;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,9 @@ private static boolean isValidUrl(String url) {
682682
return true;
683683
}
684684

685+
@Override
686+
public abstract ExternalAccountCredentials.Builder toBuilder();
687+
685688
/**
686689
* Encapsulates the service account impersonation options portion of the configuration for
687690
* ExternalAccountCredentials.

oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentials.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ public static Builder newBuilder(IdentityPoolCredentials identityPoolCredentials
153153
return new Builder(identityPoolCredentials);
154154
}
155155

156+
@Override
157+
public IdentityPoolCredentials.Builder toBuilder() {
158+
return new IdentityPoolCredentials.Builder(this);
159+
}
160+
156161
private IdentityPoolSubjectTokenSupplier createCertificateSubjectTokenSupplier(
157162
Builder builder, IdentityPoolCredentialSource credentialSource) throws IOException {
158163
// Configure the mTLS transport with the x509 keystore.

oauth2_http/java/com/google/auth/oauth2/PluggableAuthCredentials.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ public static Builder newBuilder(PluggableAuthCredentials pluggableAuthCredentia
203203
return new Builder(pluggableAuthCredentials);
204204
}
205205

206+
@Override
207+
public PluggableAuthCredentials.Builder toBuilder() {
208+
return new PluggableAuthCredentials.Builder(this);
209+
}
210+
206211
@VisibleForTesting
207212
@Nullable
208213
ExecutableHandler getExecutableHandler() {

0 commit comments

Comments
 (0)