Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back in deprecated methods in ServiceAccountJwtAccessCredentials #238

Merged
merged 4 commits into from
Mar 27, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ public class ServiceAccountJwtAccessCredentials extends Credentials
@VisibleForTesting
transient Clock clock = Clock.SYSTEM;

/**
* Constructor with minimum identifying information.
*
* @param clientId Client ID of the service account from the console. May be null.
* @param clientEmail Client email address of the service account from the console.
* @param privateKey RSA private key object for the service account.
* @param privateKeyId Private key identifier for the service account. May be null.
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
* private in a later version.
*/
@Deprecated
public ServiceAccountJwtAccessCredentials(
String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId) {
this(clientId, clientEmail, privateKey, privateKeyId, null);
}

/**
* Constructor with full information.
*
Expand All @@ -104,8 +120,11 @@ public class ServiceAccountJwtAccessCredentials extends Credentials
* @param privateKey RSA private key object for the service account.
* @param privateKeyId Private key identifier for the service account. May be null.
* @param defaultAudience Audience to use if not provided by transport. May be null.
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
* private in a later version.
*/
private ServiceAccountJwtAccessCredentials(String clientId, String clientEmail,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, this constructor should continue to be private.

@Deprecated
public ServiceAccountJwtAccessCredentials(String clientId, String clientEmail,
PrivateKey privateKey, String privateKeyId, URI defaultAudience) {
this.clientId = clientId;
this.clientEmail = Preconditions.checkNotNull(clientEmail);
Expand Down