Skip to content

Commit

Permalink
fix: getAuthenticationType in EmulatorCredentials should not throw.
Browse files Browse the repository at this point in the history
`EmulatorCredentials` extends the abstract `Credentials` class. The
signature of `getAuthenticationType()` function of this class does not indicate
that this API could throw, and based on [this description](https://cloud.google.com/java/docs/reference/google-auth-library/latest/com.google.auth.oauth2.OAuth2Credentials#com_google_auth_oauth2_OAuth2Credentials_getAuthenticationType__),
I don't think it should.

Fixes #2002.
  • Loading branch information
ehsannas committed Jan 31, 2025
1 parent 8395106 commit d156916
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public static class EmulatorCredentials extends Credentials {

@Override
public String getAuthenticationType() {
throw new IllegalArgumentException("Not supported");
return "Unauthenticated";
}

@Override
Expand Down

0 comments on commit d156916

Please sign in to comment.