Skip to content

Commit 44a5d33

Browse files
elharosduskis
authored andcommitted
Remove deprecated methods (#190)
* add App Engine API to pom.xml with test scope * remove deprecated methods * remove one more deprecated comment * 1.9.71 appngine api
1 parent e8b569b commit 44a5d33

File tree

11 files changed

+28
-249
lines changed

11 files changed

+28
-249
lines changed

appengine/java/com/google/auth/appengine/AppEngineCredentials.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,30 +62,7 @@ public class AppEngineCredentials extends GoogleCredentials implements ServiceAc
6262

6363
private transient AppIdentityService appIdentityService;
6464

65-
/**
66-
* Create a new AppEngineCredential.
67-
*
68-
* @param scopes Collection of scopes to request.
69-
*
70-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
71-
* private in a later version.
72-
*/
73-
@Deprecated
74-
public AppEngineCredentials(Collection<String> scopes) {
75-
this(scopes, null);
76-
}
77-
78-
/**
79-
* Create a new AppEngineCredential.
80-
*
81-
* @param scopes Collection of scopes to request.
82-
* @param appIdentityService Custom service used for signing.
83-
*
84-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
85-
* private in a later version.
86-
*/
87-
@Deprecated
88-
public AppEngineCredentials(Collection<String> scopes, AppIdentityService appIdentityService) {
65+
private AppEngineCredentials(Collection<String> scopes, AppIdentityService appIdentityService) {
8966
this.scopes = scopes == null ? ImmutableSet.<String>of() : ImmutableList.copyOf(scopes);
9067
this.appIdentityService = appIdentityService != null ? appIdentityService
9168
: AppIdentityServiceFactory.getAppIdentityService();

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,8 @@ public static ClientId fromStream(InputStream stream) throws IOException {
136136
*
137137
* @param clientId Text identifier of the Client ID.
138138
* @param clientSecret Secret to associated with the Client ID.
139-
* @deprecated Use {@link #of(String, String)} instead. This constructor will either be deleted
140-
* or made private in a later version.
141139
*/
142-
@Deprecated
143-
public ClientId(String clientId, String clientSecret) {
140+
private ClientId(String clientId, String clientSecret) {
144141
this.clientId = Preconditions.checkNotNull(clientId);
145142
this.clientSecret = clientSecret;
146143
}

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public class CloudShellCredentials extends GoogleCredentials {
5555

5656
/**
5757
* The Cloud Shell back authorization channel uses serialized
58-
* Javascript Protobufers, preceeded by the message length and a
58+
* Javascript Protobuffers, preceded by the message length and a
5959
* new line character. However, the request message has no content,
6060
* so a token request consists of an empty JsPb, and its 2 character
6161
* length prefix.
@@ -65,27 +65,11 @@ public class CloudShellCredentials extends GoogleCredentials {
6565

6666
private final int authPort;
6767

68-
/**
69-
* @param authPort Authentication port.
70-
* @return The CloudShellCredentials.
71-
* @deprecated Use {@link #create(int)} instead. This method will be deleted in a later version.
72-
*/
73-
@Deprecated
74-
public static CloudShellCredentials of(int authPort) {
75-
return create(authPort);
76-
}
77-
7868
public static CloudShellCredentials create(int authPort) {
7969
return CloudShellCredentials.newBuilder().setAuthPort(authPort).build();
8070
}
8171

82-
/**
83-
* @param authPort Authentication port.
84-
* @deprecated Use {@link #create(int)} instead. This constructor will either be deleted or
85-
* made private in a later version.
86-
*/
87-
@Deprecated
88-
public CloudShellCredentials(int authPort) {
72+
private CloudShellCredentials(int authPort) {
8973
this.authPort = authPort;
9074
}
9175

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

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -97,40 +97,13 @@ public class ComputeEngineCredentials extends GoogleCredentials implements Servi
9797
private transient HttpTransportFactory transportFactory;
9898
private transient String serviceAccountEmail;
9999

100-
/**
101-
* Returns a credentials instance from the given transport factory
102-
*
103-
* @param transportFactory The Http transport factory
104-
* @return the credential instance
105-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
106-
* private in a later version.
107-
*/
108-
@Deprecated
109-
public static ComputeEngineCredentials of(HttpTransportFactory transportFactory) {
110-
return ComputeEngineCredentials.newBuilder().setHttpTransportFactory(transportFactory).build();
111-
}
112-
113-
/**
114-
* Create a new ComputeEngineCredentials instance with default behavior.
115-
*
116-
* @deprecated Use {@link #create()} instead. This constructor will either be deleted or
117-
* made private in a later version.
118-
*/
119-
@Deprecated
120-
public ComputeEngineCredentials() {
121-
this(null);
122-
}
123-
124100
/**
125101
* Constructor with overridden transport.
126102
*
127103
* @param transportFactory HTTP transport factory, creates the transport used to get access
128104
* tokens.
129-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
130-
* private in a later version.
131105
*/
132-
@Deprecated
133-
public ComputeEngineCredentials(HttpTransportFactory transportFactory) {
106+
private ComputeEngineCredentials(HttpTransportFactory transportFactory) {
134107
this.transportFactory = firstNonNull(transportFactory,
135108
getFromServiceLoader(HttpTransportFactory.class, OAuth2Utils.HTTP_TRANSPORT_FACTORY));
136109
this.transportFactoryClassName = this.transportFactory.getClass().getName();

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,6 @@ public class GoogleCredentials extends OAuth2Credentials {
5454
private static final DefaultCredentialsProvider defaultCredentialsProvider =
5555
new DefaultCredentialsProvider();
5656

57-
/**
58-
* Returns the credentials instance from the given access token.
59-
*
60-
* @param accessToken the access token
61-
* @return the credentials instance
62-
* @deprecated Use {@link #create(AccessToken)} instead. This method will be deleted in a later
63-
* version.
64-
*/
65-
@Deprecated
66-
public static GoogleCredentials of(AccessToken accessToken) {
67-
return create(accessToken);
68-
}
69-
7057
/**
7158
* Returns the credentials instance from the given access token.
7259
*
@@ -189,11 +176,8 @@ protected GoogleCredentials() {
189176
/**
190177
* Constructor with explicit access token.
191178
*
192-
* @param accessToken Initial or temporary access token.
193-
* @deprecated Use {@link #create(AccessToken)} instead. This constructor will either be deleted
194-
* or made protected/private in a later version.
195-
**/
196-
@Deprecated
179+
* @param accessToken initial or temporary access token
180+
*/
197181
public GoogleCredentials(AccessToken accessToken) {
198182
super(accessToken);
199183
}

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

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -71,19 +71,6 @@ public class OAuth2Credentials extends Credentials {
7171
@VisibleForTesting
7272
transient Clock clock = Clock.SYSTEM;
7373

74-
/**
75-
* Returns the credentials instance from the given access token.
76-
*
77-
* @param accessToken the access token
78-
* @return the credentials instance
79-
* @deprecated Use {@link #create(AccessToken)} instead. This method will be deleted in a later
80-
* version.
81-
*/
82-
@Deprecated
83-
public static OAuth2Credentials of(AccessToken accessToken) {
84-
return create(accessToken);
85-
}
86-
8774
/**
8875
* Returns the credentials instance from the given access token.
8976
*
@@ -104,12 +91,9 @@ protected OAuth2Credentials() {
10491
/**
10592
* Constructor with explicit access token.
10693
*
107-
* @param accessToken Initial or temporary access token.
108-
* @deprecated Use {@link #create(AccessToken)} instead. This constructor will either be deleted
109-
* or made private in a later version.
94+
* @param accessToken initial or temporary access token
11095
**/
111-
@Deprecated
112-
public OAuth2Credentials(AccessToken accessToken) {
96+
protected OAuth2Credentials(AccessToken accessToken) {
11397
if (accessToken != null) {
11498
useAccessToken(accessToken);
11599
}

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -102,47 +102,6 @@ public class ServiceAccountCredentials extends GoogleCredentials implements Serv
102102

103103
private transient HttpTransportFactory transportFactory;
104104

105-
/**
106-
* Constructor with minimum identifying information.
107-
*
108-
* @param clientId Client ID of the service account from the console. May be null.
109-
* @param clientEmail Client email address of the service account from the console.
110-
* @param privateKey RSA private key object for the service account.
111-
* @param privateKeyId Private key identifier for the service account. May be null.
112-
* @param scopes Scope strings for the APIs to be called. May be null or an empty collection,
113-
* which results in a credential that must have createScoped called before use.
114-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
115-
* private in a later version.
116-
*/
117-
@Deprecated
118-
public ServiceAccountCredentials(
119-
String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId,
120-
Collection<String> scopes) {
121-
this(clientId, clientEmail, privateKey, privateKeyId, scopes, null, null, null, null);
122-
}
123-
124-
/**
125-
* Constructor with minimum identifying information and custom HTTP transport.
126-
*
127-
* @param clientId Client ID of the service account from the console. May be null.
128-
* @param clientEmail Client email address of the service account from the console.
129-
* @param privateKey RSA private key object for the service account.
130-
* @param privateKeyId Private key identifier for the service account. May be null.
131-
* @param scopes Scope strings for the APIs to be called. May be null or an empty collection,
132-
* which results in a credential that must have createScoped called before use.
133-
* @param transportFactory HTTP transport factory, creates the transport used to get access
134-
* tokens.
135-
* @param tokenServerUri URI of the end point that provides tokens.
136-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
137-
* private in a later version.
138-
*/
139-
@Deprecated
140-
public ServiceAccountCredentials(
141-
String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId,
142-
Collection<String> scopes, HttpTransportFactory transportFactory, URI tokenServerUri) {
143-
this(clientId, clientEmail, privateKey, privateKeyId, scopes, transportFactory, tokenServerUri, null, null);
144-
}
145-
146105
/**
147106
* Constructor with minimum identifying information and custom HTTP transport.
148107
*

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

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,6 @@ public class ServiceAccountJwtAccessCredentials extends Credentials
9696
@VisibleForTesting
9797
transient Clock clock = Clock.SYSTEM;
9898

99-
/**
100-
* Constructor with minimum identifying information.
101-
*
102-
* @param clientId Client ID of the service account from the console. May be null.
103-
* @param clientEmail Client email address of the service account from the console.
104-
* @param privateKey RSA private key object for the service account.
105-
* @param privateKeyId Private key identifier for the service account. May be null.
106-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
107-
* private in a later version.
108-
*/
109-
@Deprecated
110-
public ServiceAccountJwtAccessCredentials(
111-
String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId) {
112-
this(clientId, clientEmail, privateKey, privateKeyId, null);
113-
}
114-
11599
/**
116100
* Constructor with full information.
117101
*
@@ -120,11 +104,8 @@ public ServiceAccountJwtAccessCredentials(
120104
* @param privateKey RSA private key object for the service account.
121105
* @param privateKeyId Private key identifier for the service account. May be null.
122106
* @param defaultAudience Audience to use if not provided by transport. May be null.
123-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
124-
* private in a later version.
125107
*/
126-
@Deprecated
127-
public ServiceAccountJwtAccessCredentials(String clientId, String clientEmail,
108+
private ServiceAccountJwtAccessCredentials(String clientId, String clientEmail,
128109
PrivateKey privateKey, String privateKeyId, URI defaultAudience) {
129110
this.clientId = clientId;
130111
this.clientEmail = Preconditions.checkNotNull(clientEmail);
@@ -135,7 +116,7 @@ public ServiceAccountJwtAccessCredentials(String clientId, String clientEmail,
135116
}
136117

137118
/**
138-
* Returns service account crentials defined by JSON using the format supported by the Google
119+
* Returns service account credentials defined by JSON using the format supported by the Google
139120
* Developers Console.
140121
*
141122
* @param json a map from the JSON representing the credentials.

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

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -69,52 +69,20 @@ public class UserAuthorizer {
6969
private final URI tokenServerUri;
7070
private final URI userAuthUri;
7171

72-
/**
73-
* Constructor with minimal parameters.
74-
*
75-
* @param clientId Client ID to identify the OAuth2 consent prompt.
76-
* @param scopes OAUth2 scopes defining the user consent.
77-
* @param tokenStore Implementation of component for long term storage of tokens.
78-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
79-
* private in a later version.
80-
*/
81-
@Deprecated
82-
public UserAuthorizer(ClientId clientId, Collection<String> scopes, TokenStore tokenStore) {
83-
this(clientId, scopes, tokenStore, null, null, null, null);
84-
}
85-
86-
/**
87-
* Constructor with common parameters.
88-
*
89-
* @param clientId Client ID to identify the OAuth2 consent prompt.
90-
* @param scopes OAUth2 scopes defining the user consent.
91-
* @param tokenStore Implementation of component for long term storage of tokens.
92-
* @param callbackUri URI for implementation of the OAuth2 web callback.
93-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
94-
* private in a later version.
95-
*/
96-
@Deprecated
97-
public UserAuthorizer(ClientId clientId, Collection<String> scopes, TokenStore tokenStore, URI callbackUri) {
98-
this(clientId, scopes, tokenStore, callbackUri, null, null, null);
99-
}
100-
10172
/**
10273
* Constructor with all parameters.
10374
*
104-
* @param clientId Client ID to identify the OAuth2 consent prompt.
105-
* @param scopes OAUth2 scopes defining the user consent.
106-
* @param tokenStore Implementation of a component for long term storage of tokens.
107-
* @param callbackUri URI for implementation of the OAuth2 web callback.
75+
* @param clientId Client ID to identify the OAuth2 consent prompt
76+
* @param scopes OAuth2 scopes defining the user consent
77+
* @param tokenStore Implementation of a component for long term storage of tokens
78+
* @param callbackUri URI for implementation of the OAuth2 web callback
10879
* @param transportFactory HTTP transport factory, creates the transport used to get access
10980
* tokens.
110-
* @param tokenServerUri URI of the end point that provides tokens.
111-
* @param userAuthUri URI of the Web UI for user consent.
112-
* @deprecated Use {@link #newBuilder()} instead. This constructor will either be deleted or made
113-
* private in a later version.
81+
* @param tokenServerUri URI of the end point that provides tokens
82+
* @param userAuthUri URI of the Web UI for user consent
11483
*/
115-
@Deprecated
116-
public UserAuthorizer(ClientId clientId, Collection<String> scopes, TokenStore tokenStore,
117-
URI callbackUri, HttpTransportFactory transportFactory, URI tokenServerUri, URI userAuthUri) {
84+
private UserAuthorizer(ClientId clientId, Collection<String> scopes, TokenStore tokenStore,
85+
URI callbackUri, HttpTransportFactory transportFactory, URI tokenServerUri, URI userAuthUri) {
11886
this.clientId = Preconditions.checkNotNull(clientId);
11987
this.scopes = ImmutableList.copyOf(Preconditions.checkNotNull(scopes));
12088
this.callbackUri = (callbackUri == null) ? DEFAULT_CALLBACK_URI : callbackUri;

0 commit comments

Comments
 (0)