Skip to content

Commit a9c3de6

Browse files
authored
fix: Override toBuilder() for ExternalAccountCredential and subclasses (#1793)
* fix: Override toBuilder() for ExternalAccountCredential and subclasses * chore: Update to use local Builder class * chore: Set a default impl for toBuilder in ExternalAccountCredentials * chore: Remove override from ExternalAccountCredentials
1 parent 7b51cb3 commit a9c3de6

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-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 Builder toBuilder() {
238+
return new Builder(this);
239+
}
240+
236241
public static class Builder extends ExternalAccountCredentials.Builder {
237242

238243
private AwsSecurityCredentialsSupplier awsSecurityCredentialsSupplier;

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 Builder toBuilder() {
158+
return new 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 Builder toBuilder() {
208+
return new Builder(this);
209+
}
210+
206211
@VisibleForTesting
207212
@Nullable
208213
ExecutableHandler getExecutableHandler() {

0 commit comments

Comments
 (0)