Skip to content

Commit 95ccf41

Browse files
authored
Merge pull request #1065 from watson-developer-cloud/release-7.1.0
Release 7.1.0
2 parents 9919968 + 6737d8f commit 95ccf41

File tree

251 files changed

+7934
-3411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+7934
-3411
lines changed

README.md

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Java client library to use the [Watson APIs][wdc].
1919
* [Authentication](#authentication)
2020
* [IAM](#iam)
2121
* [Username and password](#username-and-password)
22-
* [API key](#api-key)
22+
* [ICP](#icp)
2323
* [Using the SDK](#using-the-sdk)
2424
* [Parsing responses](#parsing-responses)
2525
* [Configuring the HTTP client](#configuring-the-http-client)
@@ -184,6 +184,7 @@ Watson services are migrating to token-based Identity and Access Management (IAM
184184

185185
- With some service instances, you authenticate to the API by using **[IAM](#iam)**.
186186
- In other instances, you authenticate by providing the **[username and password](#username-and-password)** for the service instance.
187+
- If you're using a Watson service on ICP, you'll need to authenticate in a [specific way](#icp).
187188

188189
### Getting credentials
189190

@@ -245,55 +246,63 @@ You supply either an IAM service **API key** or an **access token**:
245246
Supplying the IAM API key:
246247

247248
```java
248-
// in the constructor, letting the SDK manage the IAM token
249+
// letting the SDK manage the IAM token
249250
IamOptions options = new IamOptions.Builder()
250251
.apiKey("<iam_api_key>")
251252
.url("<iam_url>") // optional - the default value is https://iam.cloud.ibm.com/identity/token
252253
.build();
253254
Discovery service = new Discovery("2017-11-07", options);
254255
```
255256

256-
```java
257-
// after instantiation, letting the SDK manage the IAM token
258-
Discovery service = new Discovery("2017-11-07");
259-
IamOptions options = new IamOptions.Builder()
260-
.apiKey("<iam_api_key>")
261-
.build();
262-
service.setIamCredentials(options);
263-
```
264-
265257
Supplying the access token:
266258

267259
```java
268-
// in the constructor, assuming control of managing IAM token
260+
// assuming control of managing IAM token
269261
IamOptions options = new IamOptions.Builder()
270262
.accessToken("<access_token>")
271263
.build();
272264
Discovery service = new Discovery("2017-11-07", options);
273265
```
274266

267+
#### Username and password
268+
275269
```java
276-
// after instantiation, assuming control of managing IAM token
277-
Discovery service = new Discovery("2017-11-07");
278-
IamOptions options = new IamOptions.Builder()
279-
.accessToken("<access_token>")
270+
// in the constructor
271+
BasicAuthConfig config = new BasicAuthConfig.Builder()
272+
.username("<username>")
273+
.password("<password")
280274
.build();
281-
service.setIamCredentials(options);
275+
Discovery service = new Discovery("2017-11-07", config);
282276
```
283277

284-
#### Username and password
278+
#### ICP
279+
Like IAM, you can pass in credentials to let the SDK manage an access token for you or directly supply an access token to do it yourself.
285280

286281
```java
287-
// in the constructor
288-
Discovery service = new Discovery("2017-11-07", "<username>", "<password>");
282+
// letting the SDK manage the token
283+
ICP4DConfig config = new ICP4DConfig.Builder()
284+
.url("<ICP token exchange base URL>")
285+
.username("<username>")
286+
.password("<password>")
287+
.disableSSLVerification(true)
288+
.build();
289+
Discovery service = new Discovery("2017-11-07", config);
290+
service.setEndPoint("<service ICP URL>");
289291
```
290292

291293
```java
292-
// after instantiation
293-
Discovery service = new Discovery("2017-11-07");
294-
service.setUsernameAndPassword("<username>", "<password>");
294+
// assuming control of managing the access token
295+
ICP4DConfig config = new ICP4DConfig.Builder()
296+
.url("<ICP token exchange base URL>")
297+
.userManagedAccessToken("<access token>")
298+
.disableSSLVerification(true)
299+
.build();
300+
Discovery service = new Discovery("2017-11-07", config);
301+
service.setEndPoint("<service ICP URL>");
295302
```
296303

304+
Be sure to both disable SSL verification when authenticating and set the endpoint explicitly to the URL given in ICP.
305+
297306
## Using the SDK
298307

299308
### Parsing responses

assistant/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ task sourcesJar(type: Jar) {
2727
}
2828

2929
repositories {
30-
maven { url = "http://repo.maven.apache.org/maven2" }
30+
maven { url "http://repo.maven.apache.org/maven2" }
31+
maven { url "https://dl.bintray.com/ibm-cloud-sdks/ibm-cloud-sdk-repo" }
3132
}
3233

3334
artifacts {
@@ -59,7 +60,7 @@ checkstyle {
5960
dependencies {
6061
compile project(':common')
6162
testCompile project(':common').sourceSets.test.output
62-
compile 'com.ibm.cloud:sdk-core:3.0.2'
63+
compile 'com.ibm.cloud:sdk-core:4.4.0'
6364
signature 'org.codehaus.mojo.signature:java17:1.0@signature'
6465
}
6566

0 commit comments

Comments
 (0)