Skip to content

Commit 6c1c18e

Browse files
committed
refactor: Remove deprecated token auth
1 parent 03d1a32 commit 6c1c18e

File tree

1 file changed

+3
-32
lines changed

1 file changed

+3
-32
lines changed

src/main/java/com/ibm/cloud/sdk/core/service/BaseService.java

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,10 @@
5555
import java.util.regex.Pattern;
5656

5757
/**
58-
* Watson service abstract common functionality of various Watson Services. It handle authentication and default url.
59-
*
60-
* @see <a href="http://www.ibm.com/watson/developercloud/"> IBM Watson Developer Cloud</a>
58+
* Abstracts common functionality of various IBM Cloud services.
6159
*/
6260
public abstract class BaseService {
6361

64-
private static final String URL = "url";
65-
private static final String PATH_AUTHORIZATION_V1_TOKEN = "/v1/token";
66-
private static final String AUTHORIZATION = "authorization";
6762
private static final String BASIC = "Basic ";
6863
private static final String BEARER = "Bearer ";
6964
private static final String APIKEY_AS_USERNAME = "apikey";
@@ -80,17 +75,10 @@ public abstract class BaseService {
8075
private OkHttpClient client;
8176

8277
/** The default headers. */
83-
protected Headers defaultHeaders = null;
78+
private Headers defaultHeaders = null;
8479

8580
/** The skip authentication. */
86-
protected boolean skipAuthentication = false;
87-
88-
/** The Constant MESSAGE_CODE. */
89-
protected static final String MESSAGE_CODE = "code";
90-
91-
92-
/** The Constant VERSION. */
93-
protected static final String VERSION = "version";
81+
private boolean skipAuthentication = false;
9482

9583

9684
// Regular expression for JSON-related mimetypes.
@@ -276,23 +264,6 @@ public String getEndPoint() {
276264
return endPoint;
277265
}
278266

279-
/**
280-
* Gets an authorization token that can be use to authorize API calls.
281-
*
282-
*
283-
* @return the token
284-
*/
285-
public ServiceCall<String> getToken() {
286-
HttpUrl url = HttpUrl.parse(getEndPoint()).newBuilder()
287-
.setPathSegment(0, AUTHORIZATION)
288-
.addPathSegment(PATH_AUTHORIZATION_V1_TOKEN)
289-
.build();
290-
Request request = RequestBuilder.get(url)
291-
.header(HttpHeaders.ACCEPT, HttpMediaType.TEXT_PLAIN).query(URL, getEndPoint()).build();
292-
293-
return createServiceCall(request, ResponseConverterUtils.getString());
294-
}
295-
296267
/**
297268
* Checks the status of the tokenManager.
298269
*

0 commit comments

Comments
 (0)