Skip to content

Commit 4ec205f

Browse files
committed
chore: Clean up PR
1 parent acf5745 commit 4ec205f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,11 @@ static ImpersonatedCredentials fromJson(
413413
}
414414

415415
GoogleCredentials sourceCredentials;
416-
if (sourceCredentialsType.equals(GoogleCredentialsInfo.USER_CREDENTIALS.getFileType())) {
416+
if (GoogleCredentialsInfo.USER_CREDENTIALS.getFileType().equals(sourceCredentialsType)) {
417417
sourceCredentials = UserCredentials.fromJson(sourceCredentialsJson, transportFactory);
418-
} else if (sourceCredentialsType.equals(
419-
GoogleCredentialsInfo.SERVICE_ACCOUNT_CREDENTIALS.getFileType())) {
418+
} else if (GoogleCredentialsInfo.SERVICE_ACCOUNT_CREDENTIALS.getFileType().equals(sourceCredentialsType)) {
420419
sourceCredentials =
421420
ServiceAccountCredentials.fromJson(sourceCredentialsJson, transportFactory);
422-
423421
} else {
424422
throw new IOException(
425423
String.format(
@@ -477,8 +475,6 @@ private ImpersonatedCredentials(Builder builder) throws IOException {
477475
this.sourceCredentials = builder.getSourceCredentials();
478476
this.targetPrincipal = builder.getTargetPrincipal();
479477
this.delegates = builder.getDelegates();
480-
481-
// Precedence for scopes: 1. User configured scopes 2. Scopes set in the JSON
482478
this.scopes = ImmutableList.copyOf(builder.getScopes());
483479
this.lifetime = builder.getLifetime();
484480
this.transportFactory =

0 commit comments

Comments
 (0)