Skip to content

Commit

Permalink
docs(readme): update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
apaparazzi0329 committed Dec 5, 2024
1 parent 2fc3d6d commit e73ef5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 61 deletions.
50 changes: 0 additions & 50 deletions MIGRATION-V11.md

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The file downloaded will be called `ibm-credentials.env`. This is the name the S
As long as you set that up correctly, you don't have to worry about setting any authentication options in your code. So, for example, if you created and downloaded the credential file for your Discovery instance, you just need to do the following:

```java
Discovery service = new Discovery("2019-04-30");
Discovery service = new Discovery("2023-03-31");
```

And that's it!
Expand Down Expand Up @@ -144,23 +144,23 @@ Builder pattern approach:
Authenticator authenticator = new IamAuthenticator.Builder()
.apikey("<iam_api_key>")
.build();
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

Deprecated constructor approach:

```java
// letting the SDK manage the IAM token
Authenticator authenticator = new IamAuthenticator("<iam_api_key>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

Supplying the access token:

```java
// assuming control of managing IAM token
Authenticator authenticator = new BearerTokenAuthenticator("<access_token>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

#### Username and password
Expand All @@ -172,22 +172,22 @@ Authenticator authenticator = new BasicAuthenticator.Builder()
.username("<username>")
.password("<password>")
.build();
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

Deprecated constructor approach:

```java
Authenticator authenticator = new BasicAuthenticator("<username>", "<password>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
```

#### ICP
Authenticating with ICP is similar to the basic username and password method, except that you need to make sure to disable SSL verification to authenticate properly. See [here](#configuring-the-http-client) for more information.

```java
Authenticator authenticator = new BasicAuthenticator("<username>", "<password>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);

HttpConfigOptions options = new HttpConfigOptions.Builder()
.disableSslVerification(true)
Expand All @@ -210,7 +210,7 @@ Authenticator authenticator = new CloudPakForDataAuthenticator.Builder()
.disableSSLVerification(true)
.headers(null)
.build();
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
service.setServiceUrl("<service CP4D URL>");
```

Expand All @@ -225,14 +225,14 @@ Authenticator authenticator = new CloudPakForDataAuthenticator(
true, // disabling SSL verification
null,
);
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
service.setServiceUrl("<service CP4D URL>");
```

```java
// assuming control of managing the access token
Authenticator authenticator = new BearerTokenAuthenticator("<access_token>");
Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);
service.setServiceUrl("<service CP4D URL>");
```

Expand Down Expand Up @@ -288,7 +288,7 @@ Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("proxyHost", 8080
IamAuthenticator authenticator = new IamAuthenticator(apiKey);
authenticator.setProxy(proxy);

Discovery service = new Discovery("2019-04-30", authenticator);
Discovery service = new Discovery("2023-03-31", authenticator);

// setting configuration options
HttpConfigOptions options = new HttpConfigOptions.Builder()
Expand Down

0 comments on commit e73ef5a

Please sign in to comment.