Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 20 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": "(?i)^\\s*\"(?:transaction|x-couch-request|x-request)-id\": \"[^\"]+\",?$|^\\s*\"(?:last_|update_|purge_|checkpointed_source_|source_|through_)?seq\": \"[^\"]+\",?$|^\\s*\"(?:doc_)?id\": \"[^\"]+\",?$|^\\s*\"(?:signature|name|uuid)\": \"[^\"]+\",?$"
},
"generated_at": "2025-08-15T10:13:02Z",
"generated_at": "2025-10-03T09:50:57Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -132,6 +132,14 @@
}
],
"examples/README.md": [
{
"hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a",
"is_secret": false,
"is_verified": false,
"line_number": 476,
"type": "Base64 High Entropy String",
"verified_result": null
},
{
"hashed_secret": "c2a6b03f190dfb2b4aa91f8af8d477a9bc3401dc",
"is_secret": false,
Expand All @@ -141,6 +149,16 @@
"verified_result": null
}
],
"examples/snippets/putReplicationDocument/example_request.java": [
{
"hashed_secret": "7740cecbbf3c508248997e0b3b1c24cc00a2759a",
"is_secret": false,
"is_verified": false,
"line_number": 18,
"type": "Base64 High Entropy String",
"verified_result": null
}
],
"modules/cloudant/src/test/java/com/ibm/cloud/cloudant/v1/CloudantIT.java": [
{
"hashed_secret": "166b7db1d38ae47816b3840e6187b7a2631e04a8",
Expand Down Expand Up @@ -216,7 +234,7 @@
}
]
},
"version": "0.13.1+ibm.62.dss",
"version": "0.13.1+ibm.64.dss",
"word_list": {
"file": null,
"hash": null
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ or programmatically.

Quick start for Cloudant with an IAM API key:
```sh
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key
```

Quick start for Apache CouchDB with a username/password session:
```sh
CLOUDANT_AUTH_TYPE=COUCHDB_SESSION
CLOUDANT_URL=http://~replaceWithYourUniqueHost~.example:5984 # use your CouchDB URL
CLOUDANT_URL=https://~replace-with-your-unique-host~.example:6984 # use your CouchDB URL
CLOUDANT_USERNAME=username # replace with your username
CLOUDANT_PASSWORD=password # replace with your password
```
Expand Down
20 changes: 10 additions & 10 deletions docs/Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ amending the values with your own
`CLOUDANT_AUTH_TYPE` to `IAM` because it is the default when supplying an `APIKEY`.

```sh
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_APIKEY=a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3 # use your own IAM API key
```

Expand All @@ -69,8 +69,8 @@ amending with your own correct values. There is no need to set
`CLOUDANT_AUTH_TYPE` to `CONTAINER` because it is the default.

```sh
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID
```

Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
Expand All @@ -83,8 +83,8 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=VPC
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID
```

Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
Expand All @@ -98,8 +98,8 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=IAMASSUME
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-aaaa-4444-bbbb-0123456789ab # use your own IAM profile ID
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_IAM_PROFILE_ID=iam-Profile-00000000-0000-0000-0000-000000000000 # use your own IAM profile ID
```

Alternatives to `CLOUDANT_IAM_PROFILE_ID`:
Expand All @@ -113,7 +113,7 @@ amending with your own [service credentials](https://cloud.ibm.com/docs/Cloudant

```sh
CLOUDANT_AUTH_TYPE=COUCHDB_SESSION
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_USERNAME=username # replace with your Cloudant legacy username
CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM)
```
Expand All @@ -127,7 +127,7 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=BEARERTOKEN
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_BEARER_TOKEN=A1b2C3QiOiIyMDE4MDgxNDAwMDAwMDAwMDAwMDBjNzYwNzY2YjYxYjYwYjYwIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJ1c2VyQGdtYWlsLmNvbSIsImF1ZCI6Imh0dHBzOi8vaWF1LmNsb3VkLmlibS5jb20iLCJpYXQiOjE2ODg4ODg4ODgsImV4cCI6MTY4ODg5MjQ4OCwiaXNzIjoiaHR0cHM6Ly9pYXUuY2xvdWQuaWJtLmNvbSIsInNjb3BlIjpbImNsb3VkLnJlYWRlciJdfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c # replace with your bearer token
```

Expand All @@ -140,7 +140,7 @@ amending with your own correct values.

```sh
CLOUDANT_AUTH_TYPE=BASIC
CLOUDANT_URL=https://~replaceWithYourUniqueHost~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_URL=https://~replace-with-cloudant-host~.cloudantnosqldb.appdomain.cloud # use your own Cloudant public or private URL
CLOUDANT_USERNAME=username # replace with your Cloudant legacy username
CLOUDANT_PASSWORD=password # replace with your Cloudant legacy password or API key (not IAM)
```
Expand Down
35 changes: 19 additions & 16 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Cloudant service = Cloudant.newInstance();
DeleteReplicationDocumentOptions replicationDocOptions =
new DeleteReplicationDocumentOptions.Builder()
.docId("repldoc-example")
.rev("3-a0ccbdc6fe95b4184f9031d086034d85")
.rev("1-00000000000000000000000000000000")
.build();

DocumentResult response =
Expand Down Expand Up @@ -468,12 +468,12 @@ import com.ibm.cloud.cloudant.v1.model.ReplicationDocument;
Cloudant service = Cloudant.newInstance();

ReplicationDatabase sourceDb = new ReplicationDatabase.Builder()
.url("<your-source-service-url>/animaldb")
.url("https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb")
.build();

ReplicationDatabaseAuthIam targetAuthIam =
new ReplicationDatabaseAuthIam.Builder()
.apiKey("<your-iam-api-key>")
.apiKey("a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3") //use your own IAM API key
.build();

ReplicationDatabaseAuth targetAuth = new ReplicationDatabaseAuth.Builder()
Expand All @@ -482,7 +482,7 @@ ReplicationDatabaseAuth targetAuth = new ReplicationDatabaseAuth.Builder()

ReplicationDatabase targetDb = new ReplicationDatabase.Builder()
.auth(targetAuth)
.url("<your-target-service-url>/animaldb-target")
.url("https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target")
.build();

ReplicationDocument replDocument = new ReplicationDocument();
Expand Down Expand Up @@ -752,7 +752,7 @@ Cloudant service = Cloudant.newInstance();

DeleteDatabaseOptions databaseOptions =
new DeleteDatabaseOptions.Builder()
.db("<db-name>")
.db("products")
.build();

Ok response =
Expand Down Expand Up @@ -1056,12 +1056,12 @@ Cloudant service = Cloudant.newInstance();

Document eventDoc1 = new Document();
eventDoc1.setId("ns1HJS13AMkK:0007241142412418284");
eventDoc1.setRev("1-5005d65514fe9e90f8eccf174af5dd64");
eventDoc1.setRev("1-00000000000000000000000000000000");
eventDoc1.setDeleted(true);

Document eventDoc2 = new Document();
eventDoc2.setId("H8tDIwfadxp9:0007241142412418285");
eventDoc1.setRev("1-2d7810b054babeda4812b3924428d6d6");
eventDoc1.setRev("1-00000000000000000000000000000000");
eventDoc1.setDeleted(true);

BulkDocs bulkDocs = new BulkDocs.Builder()
Expand Down Expand Up @@ -1158,12 +1158,12 @@ List<BulkGetQueryDocument> bulkGetDocs = new ArrayList<>();
bulkGetDocs.add(
new BulkGetQueryDocument.Builder()
.id(docId)
.rev("3-917fa2381192822767f010b95b45325b")
.rev("3-22222222222222222222222222222222")
.build());
bulkGetDocs.add(
new BulkGetQueryDocument.Builder()
.id(docId)
.rev("4-a5be949eeb7296747cc271766e9a498b")
.rev("4-33333333333333333333333333333333")
.build());

PostBulkGetOptions bulkGetOptions = new PostBulkGetOptions.Builder()
Expand Down Expand Up @@ -1227,7 +1227,7 @@ Cloudant service = Cloudant.newInstance();
BulkGetQueryDocument bulkGetQueryDocument =
new BulkGetQueryDocument.Builder()
.id("order00058")
.addAttsSince("1-99b02e08da151943c2dcb40090160bb8")
.addAttsSince("1-00000000000000000000000000000000")
.build();

PostBulkGetOptions postBulkGetOptions =
Expand Down Expand Up @@ -1317,7 +1317,7 @@ DeleteDesignDocumentOptions designDocumentOptions =
new DeleteDesignDocumentOptions.Builder()
.db("products")
.ddoc("appliances")
.rev("1-98e6a25b3b45df62e7d47095ac15b16a")
.rev("1-00000000000000000000000000000000")
.build();

DocumentResult response =
Expand Down Expand Up @@ -2246,9 +2246,12 @@ import java.util.Arrays;
// section: code
Cloudant service = Cloudant.newInstance();

Map<String, List<String>> docRevisions =
Collections.singletonMap("order00077", Arrays.asList("<1-missing-revision>",
"<2-missing-revision>", "<3-possible-ancestor-revision>"));
Map<String, List<String>> docRevisions =
Collections.singletonMap("order00077", Arrays.asList(
"1-00000000000000000000000000000000", // missing revision
"2-11111111111111111111111111111111", // missing revision
"3-22222222222222222222222222222222" // possible ancestor revision
));

PostRevsDiffOptions revsDiffOptions =
new PostRevsDiffOptions.Builder()
Expand Down Expand Up @@ -2406,7 +2409,7 @@ DeleteDocumentOptions documentOptions =
new DeleteDocumentOptions.Builder()
.db("orders")
.docId("order00058")
.rev("1-99b02e08da151943c2dcb40090160bb8")
.rev("1-00000000000000000000000000000000")
.build();

DocumentResult response =
Expand Down Expand Up @@ -2533,7 +2536,7 @@ DeleteAttachmentOptions attachmentOptions =
.db("products")
.docId("1000042")
.attachmentName("product_details.txt")
.rev("4-1a0d1cd6f40472509e9aac646183736a")
.rev("4-33333333333333333333333333333333")
.build();

DocumentResult response =
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/deleteAttachment/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
.db("products")
.docId("1000042")
.attachmentName("product_details.txt")
.rev("4-1a0d1cd6f40472509e9aac646183736a")
.rev("4-33333333333333333333333333333333")
.build();

DocumentResult response =
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/deleteDatabase/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

DeleteDatabaseOptions databaseOptions =
new DeleteDatabaseOptions.Builder()
.db("<db-name>")
.db("products")
.build();

Ok response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
new DeleteDesignDocumentOptions.Builder()
.db("products")
.ddoc("appliances")
.rev("1-98e6a25b3b45df62e7d47095ac15b16a")
.rev("1-00000000000000000000000000000000")
.build();

DocumentResult response =
Expand Down
2 changes: 1 addition & 1 deletion examples/snippets/deleteDocument/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
new DeleteDocumentOptions.Builder()
.db("orders")
.docId("order00058")
.rev("1-99b02e08da151943c2dcb40090160bb8")
.rev("1-00000000000000000000000000000000")
.build();

DocumentResult response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
DeleteReplicationDocumentOptions replicationDocOptions =
new DeleteReplicationDocumentOptions.Builder()
.docId("repldoc-example")
.rev("3-a0ccbdc6fe95b4184f9031d086034d85")
.rev("1-00000000000000000000000000000000")
.build();

DocumentResult response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

Document eventDoc1 = new Document();
eventDoc1.setId("ns1HJS13AMkK:0007241142412418284");
eventDoc1.setRev("1-5005d65514fe9e90f8eccf174af5dd64");
eventDoc1.setRev("1-00000000000000000000000000000000");
eventDoc1.setDeleted(true);

Document eventDoc2 = new Document();
eventDoc2.setId("H8tDIwfadxp9:0007241142412418285");
eventDoc1.setRev("1-2d7810b054babeda4812b3924428d6d6");
eventDoc1.setRev("1-00000000000000000000000000000000");
eventDoc1.setDeleted(true);

BulkDocs bulkDocs = new BulkDocs.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
BulkGetQueryDocument bulkGetQueryDocument =
new BulkGetQueryDocument.Builder()
.id("order00058")
.addAttsSince("1-99b02e08da151943c2dcb40090160bb8")
.addAttsSince("1-00000000000000000000000000000000")
.build();

PostBulkGetOptions postBulkGetOptions =
Expand Down
4 changes: 2 additions & 2 deletions examples/snippets/postBulkGet/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
bulkGetDocs.add(
new BulkGetQueryDocument.Builder()
.id(docId)
.rev("3-917fa2381192822767f010b95b45325b")
.rev("3-22222222222222222222222222222222")
.build());
bulkGetDocs.add(
new BulkGetQueryDocument.Builder()
.id(docId)
.rev("4-a5be949eeb7296747cc271766e9a498b")
.rev("4-33333333333333333333333333333333")
.build());

PostBulkGetOptions bulkGetOptions = new PostBulkGetOptions.Builder()
Expand Down
9 changes: 6 additions & 3 deletions examples/snippets/postRevsDiff/example_request.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
// section: code
Cloudant service = Cloudant.newInstance();

Map<String, List<String>> docRevisions =
Collections.singletonMap("order00077", Arrays.asList("<1-missing-revision>",
"<2-missing-revision>", "<3-possible-ancestor-revision>"));
Map<String, List<String>> docRevisions =
Collections.singletonMap("order00077", Arrays.asList(
"1-00000000000000000000000000000000", // missing revision
"2-11111111111111111111111111111111", // missing revision
"3-22222222222222222222222222222222" // possible ancestor revision
));

PostRevsDiffOptions revsDiffOptions =
new PostRevsDiffOptions.Builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
Cloudant service = Cloudant.newInstance();

ReplicationDatabase sourceDb = new ReplicationDatabase.Builder()
.url("<your-source-service-url>/animaldb")
.url("https://~replace-with-source-host~.cloudantnosqldb.appdomain.cloud/animaldb")
.build();

ReplicationDatabaseAuthIam targetAuthIam =
new ReplicationDatabaseAuthIam.Builder()
.apiKey("<your-iam-api-key>")
.apiKey("a1b2c3d4e5f6f1g4h7j3k6l9m2p5q8s1t4v7x0z3") //use your own IAM API key
.build();

ReplicationDatabaseAuth targetAuth = new ReplicationDatabaseAuth.Builder()
Expand All @@ -24,7 +24,7 @@

ReplicationDatabase targetDb = new ReplicationDatabase.Builder()
.auth(targetAuth)
.url("<your-target-service-url>/animaldb-target")
.url("https://~replace-with-target-host~.cloudantnosqldb.appdomain.cloud/animaldb-target")
.build();

ReplicationDocument replDocument = new ReplicationDocument();
Expand Down