From 376c4a1524bd5b17d79da9303be29da0a0870376 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 30 Apr 2026 15:14:40 -0400 Subject: [PATCH 1/8] MLE-28498 Permission fixes --- .../example/handle/URIHandleExample.java | 7 ++- .../TestBulkWriteWithTransformations.java | 2 +- .../TestJSResourceExtensions.java | 2 +- .../client/functionaltest/TestBiTemporal.java | 2 +- .../security/roles/java-test-xdmp-login.json | 46 +++++++++++++++++++ .../security/roles/test-rest-writer.json | 20 ++++++++ .../ml-config/security/users/rest-admin.json | 3 +- .../security/users/rest-transform-user.json | 9 ++++ .../ml-config/security/users/rest-writer.json | 3 +- .../users/writer-no-default-permissions.json | 3 +- 10 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json create mode 100644 test-app/src/main/ml-config/security/users/rest-transform-user.json diff --git a/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java b/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java index 9f6f5a9ea..8f63b2cff 100644 --- a/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java +++ b/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java @@ -12,6 +12,7 @@ import com.marklogic.client.document.XMLDocumentManager; import com.marklogic.client.example.cookbook.Util; import com.marklogic.client.example.cookbook.Util.ExampleProperties; +import com.marklogic.client.io.DocumentMetadataHandle; import com.marklogic.client.io.InputStreamHandle; /** @@ -82,7 +83,11 @@ public static void setUpExample(XMLDocumentManager docMgr, String docId, String InputStreamHandle handle = new InputStreamHandle(); handle.set(docStream); - docMgr.write(docId, handle); + DocumentMetadataHandle metadata = new DocumentMetadataHandle(); + metadata.getPermissions().add("rest-writer", + DocumentMetadataHandle.Capability.READ, DocumentMetadataHandle.Capability.UPDATE); + + docMgr.write(docId, metadata, handle); } // clean up by deleting the documents for the example diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java index 71093cf73..5fddfe739 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java @@ -54,7 +54,7 @@ public static void tearDownAfterClass() throws Exception { @BeforeEach public void setUp() throws Exception { // create new connection for each test below - createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke"); + createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke", "xdmp-login"); createRESTUser("eval-user", "x", "test-eval", "rest-admin", "rest-writer", "rest-reader"); client = newClientAsUser("eval-user", "x"); } diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java index f79a761a8..b79683bec 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java @@ -112,7 +112,7 @@ public String deleteJSON(String docUri) { @BeforeAll public static void setUpBeforeClass() throws Exception { - createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:value", "xdmp:eval", "xdmp:eval-in", "any-uri", "xdbc:invoke"); + createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:value", "xdmp:eval", "xdmp:eval-in", "any-uri", "xdbc:invoke", "xdmp-login"); createRESTUser("eval-user", "x", "test-eval", "rest-admin", "rest-writer", "rest-reader", "rest-extension-user"); } diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestBiTemporal.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestBiTemporal.java index 1fdfe67d6..2cdf136b5 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestBiTemporal.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/functionaltest/TestBiTemporal.java @@ -121,7 +121,7 @@ public static void tearDownAfterClass() throws Exception { @BeforeEach public void setUp() throws Exception { createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", - "xdbc:invoke", "temporal:statement-set-system-time"); + "xdbc:invoke", "temporal:statement-set-system-time", "xdmp-login"); createRESTUser("eval-user", "x", "test-eval", "rest-admin", "rest-writer", "rest-reader", "temporal-admin"); adminClient = getDatabaseClient("rest-admin", "x", getConnType()); diff --git a/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json b/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json new file mode 100644 index 000000000..7f4fcc235 --- /dev/null +++ b/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json @@ -0,0 +1,46 @@ +{ + "role-name": "java-test-xdmp-login", + "description": "Grants privileges required in ML 11 for invoking server-side transforms and resource extensions", + "privilege": [ + { + "privilege-name": "xdmp-login", + "action": "http://marklogic.com/xdmp/privileges/xdmp-login", + "kind": "execute" + }, + { + "privilege-name": "rest-reader", + "action": "http://marklogic.com/xdmp/privileges/rest-reader", + "kind": "execute" + }, + { + "privilege-name": "xdmp:xslt-eval", + "action": "http://marklogic.com/xdmp/privileges/xslt-eval", + "kind": "execute" + }, + { + "privilege-name": "xdmp:xslt-invoke", + "action": "http://marklogic.com/xdmp/privileges/xslt-invoke", + "kind": "execute" + }, + { + "privilege-name": "xdmp:invoke", + "action": "http://marklogic.com/xdmp/privileges/xdmp-invoke", + "kind": "execute" + }, + { + "privilege-name": "unprotected-uri", + "action": "http://marklogic.com/xdmp/privileges/unprotected-uri", + "kind": "execute" + }, + { + "privilege-name": "unprotected-collections", + "action": "http://marklogic.com/xdmp/privileges/unprotected-collections", + "kind": "execute" + }, + { + "privilege-name": "xdmp:value", + "action": "http://marklogic.com/xdmp/privileges/xdmp-value", + "kind": "execute" + } + ] +} diff --git a/test-app/src/main/ml-config/security/roles/test-rest-writer.json b/test-app/src/main/ml-config/security/roles/test-rest-writer.json index 09d3e69f9..c299b804f 100644 --- a/test-app/src/main/ml-config/security/roles/test-rest-writer.json +++ b/test-app/src/main/ml-config/security/roles/test-rest-writer.json @@ -16,6 +16,26 @@ "privilege-name": "rest-tracer", "action": "http://marklogic.com/xdmp/privileges/rest-tracer", "kind": "execute" + }, + { + "privilege-name": "xdmp-login", + "action": "http://marklogic.com/xdmp/privileges/xdmp-login", + "kind": "execute" + }, + { + "privilege-name": "xdmp:invoke", + "action": "http://marklogic.com/xdmp/privileges/xdmp-invoke", + "kind": "execute" + }, + { + "privilege-name": "unprotected-uri", + "action": "http://marklogic.com/xdmp/privileges/unprotected-uri", + "kind": "execute" + }, + { + "privilege-name": "unprotected-collections", + "action": "http://marklogic.com/xdmp/privileges/unprotected-collections", + "kind": "execute" } ] } \ No newline at end of file diff --git a/test-app/src/main/ml-config/security/users/rest-admin.json b/test-app/src/main/ml-config/security/users/rest-admin.json index ec0921db4..2a62b49b6 100644 --- a/test-app/src/main/ml-config/security/users/rest-admin.json +++ b/test-app/src/main/ml-config/security/users/rest-admin.json @@ -3,7 +3,8 @@ "description": "rest-admin user", "role": [ "rest-admin", - "java-test-delete-temporal" + "java-test-delete-temporal", + "java-test-xdmp-login" ], "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/rest-transform-user.json b/test-app/src/main/ml-config/security/users/rest-transform-user.json new file mode 100644 index 000000000..13b0eddd2 --- /dev/null +++ b/test-app/src/main/ml-config/security/users/rest-transform-user.json @@ -0,0 +1,9 @@ +{ + "user-name": "rest-transform-user", + "description": "REST API transform execution user", + "role": ["rest-transform-internal", "rest-reader", "rest-writer", "java-test-xdmp-login"], + "permission": [ + {"role-name": "rest-reader", "capability": "read"}, + {"role-name": "rest-writer", "capability": "update"} + ] +} diff --git a/test-app/src/main/ml-config/security/users/rest-writer.json b/test-app/src/main/ml-config/security/users/rest-writer.json index 98ab00679..50c2cb5d4 100644 --- a/test-app/src/main/ml-config/security/users/rest-writer.json +++ b/test-app/src/main/ml-config/security/users/rest-writer.json @@ -3,7 +3,8 @@ "description": "rest-writer user", "role": [ "rest-writer", - "java-test-delete-graph" + "java-test-delete-graph", + "java-test-xdmp-login" ], "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json b/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json index 8748a1325..e6d56ea40 100644 --- a/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json +++ b/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json @@ -5,7 +5,8 @@ "test-rest-writer", "java-test-delete-graph", "rest-extension-user", - "rest-reader" + "rest-reader", + "java-test-xdmp-login" ], "password": "x" } From d77b572d7d3d9c0b792291f724754ee191e1ff70 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 30 Apr 2026 16:27:12 -0400 Subject: [PATCH 2/8] MLE-28498 More fixes and whitespace changes --- .../StringQueryHostBatcherTest.java | 2 +- .../security/roles/java-test-xdmp-login.json | 88 +++++++++---------- .../security/roles/test-rest-writer.json | 80 ++++++++--------- .../ml-config/security/users/opticUser.json | 28 +++--- .../ml-config/security/users/rest-admin.json | 12 +-- .../security/users/rest-evaluator.json | 10 +-- .../security/users/rest-transform-user.json | 19 ++-- .../ml-config/security/users/rest-writer.json | 12 +-- .../users/writer-no-default-permissions.json | 20 ++--- 9 files changed, 133 insertions(+), 138 deletions(-) diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java index 2fb85af21..c6b0f7c4d 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java @@ -92,7 +92,7 @@ public static void setUpBeforeClass() throws Exception { }; addRangePathIndex(dbName, rangePaths); - createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke"); + createUserRolesWithPrevilages("test-eval", "xdbc:eval", "xdbc:eval-in", "xdmp:eval-in", "any-uri", "xdbc:invoke", "xdmp-login"); createRESTUser("eval-user", "x", "test-eval", "rest-admin", "rest-writer", "rest-reader", "rest-extension-user", "manage-user"); } diff --git a/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json b/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json index 7f4fcc235..e23c8407c 100644 --- a/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json +++ b/test-app/src/main/ml-config/security/roles/java-test-xdmp-login.json @@ -1,46 +1,46 @@ { - "role-name": "java-test-xdmp-login", - "description": "Grants privileges required in ML 11 for invoking server-side transforms and resource extensions", - "privilege": [ - { - "privilege-name": "xdmp-login", - "action": "http://marklogic.com/xdmp/privileges/xdmp-login", - "kind": "execute" - }, - { - "privilege-name": "rest-reader", - "action": "http://marklogic.com/xdmp/privileges/rest-reader", - "kind": "execute" - }, - { - "privilege-name": "xdmp:xslt-eval", - "action": "http://marklogic.com/xdmp/privileges/xslt-eval", - "kind": "execute" - }, - { - "privilege-name": "xdmp:xslt-invoke", - "action": "http://marklogic.com/xdmp/privileges/xslt-invoke", - "kind": "execute" - }, - { - "privilege-name": "xdmp:invoke", - "action": "http://marklogic.com/xdmp/privileges/xdmp-invoke", - "kind": "execute" - }, - { - "privilege-name": "unprotected-uri", - "action": "http://marklogic.com/xdmp/privileges/unprotected-uri", - "kind": "execute" - }, - { - "privilege-name": "unprotected-collections", - "action": "http://marklogic.com/xdmp/privileges/unprotected-collections", - "kind": "execute" - }, - { - "privilege-name": "xdmp:value", - "action": "http://marklogic.com/xdmp/privileges/xdmp-value", - "kind": "execute" - } - ] + "role-name": "java-test-xdmp-login", + "description": "Grants privileges required in ML 11 for invoking server-side transforms and resource extensions", + "privilege": [ + { + "privilege-name": "xdmp-login", + "action": "http://marklogic.com/xdmp/privileges/xdmp-login", + "kind": "execute" + }, + { + "privilege-name": "rest-reader", + "action": "http://marklogic.com/xdmp/privileges/rest-reader", + "kind": "execute" + }, + { + "privilege-name": "xdmp:xslt-eval", + "action": "http://marklogic.com/xdmp/privileges/xslt-eval", + "kind": "execute" + }, + { + "privilege-name": "xdmp:xslt-invoke", + "action": "http://marklogic.com/xdmp/privileges/xslt-invoke", + "kind": "execute" + }, + { + "privilege-name": "xdmp:invoke", + "action": "http://marklogic.com/xdmp/privileges/xdmp-invoke", + "kind": "execute" + }, + { + "privilege-name": "unprotected-uri", + "action": "http://marklogic.com/xdmp/privileges/unprotected-uri", + "kind": "execute" + }, + { + "privilege-name": "unprotected-collections", + "action": "http://marklogic.com/xdmp/privileges/unprotected-collections", + "kind": "execute" + }, + { + "privilege-name": "xdmp:value", + "action": "http://marklogic.com/xdmp/privileges/xdmp-value", + "kind": "execute" + } + ] } diff --git a/test-app/src/main/ml-config/security/roles/test-rest-writer.json b/test-app/src/main/ml-config/security/roles/test-rest-writer.json index c299b804f..156eb7355 100644 --- a/test-app/src/main/ml-config/security/roles/test-rest-writer.json +++ b/test-app/src/main/ml-config/security/roles/test-rest-writer.json @@ -1,41 +1,41 @@ { - "role-name": "test-rest-writer", - "description": "Role for test users that can write documents; does not inherit the OOTB rest-writer role so as to avoid having default permissions", - "privilege": [ - { - "privilege-name": "rest-writer", - "action": "http://marklogic.com/xdmp/privileges/rest-writer", - "kind": "execute" - }, - { - "privilege-name": "rest-reader", - "action": "http://marklogic.com/xdmp/privileges/rest-reader", - "kind": "execute" - }, - { - "privilege-name": "rest-tracer", - "action": "http://marklogic.com/xdmp/privileges/rest-tracer", - "kind": "execute" - }, - { - "privilege-name": "xdmp-login", - "action": "http://marklogic.com/xdmp/privileges/xdmp-login", - "kind": "execute" - }, - { - "privilege-name": "xdmp:invoke", - "action": "http://marklogic.com/xdmp/privileges/xdmp-invoke", - "kind": "execute" - }, - { - "privilege-name": "unprotected-uri", - "action": "http://marklogic.com/xdmp/privileges/unprotected-uri", - "kind": "execute" - }, - { - "privilege-name": "unprotected-collections", - "action": "http://marklogic.com/xdmp/privileges/unprotected-collections", - "kind": "execute" - } - ] -} \ No newline at end of file + "role-name": "test-rest-writer", + "description": "Role for test users that can write documents; does not inherit the OOTB rest-writer role so as to avoid having default permissions", + "privilege": [ + { + "privilege-name": "rest-writer", + "action": "http://marklogic.com/xdmp/privileges/rest-writer", + "kind": "execute" + }, + { + "privilege-name": "rest-reader", + "action": "http://marklogic.com/xdmp/privileges/rest-reader", + "kind": "execute" + }, + { + "privilege-name": "rest-tracer", + "action": "http://marklogic.com/xdmp/privileges/rest-tracer", + "kind": "execute" + }, + { + "privilege-name": "xdmp-login", + "action": "http://marklogic.com/xdmp/privileges/xdmp-login", + "kind": "execute" + }, + { + "privilege-name": "xdmp:invoke", + "action": "http://marklogic.com/xdmp/privileges/xdmp-invoke", + "kind": "execute" + }, + { + "privilege-name": "unprotected-uri", + "action": "http://marklogic.com/xdmp/privileges/unprotected-uri", + "kind": "execute" + }, + { + "privilege-name": "unprotected-collections", + "action": "http://marklogic.com/xdmp/privileges/unprotected-collections", + "kind": "execute" + } + ] +} diff --git a/test-app/src/main/ml-config/security/users/opticUser.json b/test-app/src/main/ml-config/security/users/opticUser.json index f2bd8b578..a5d2ab370 100644 --- a/test-app/src/main/ml-config/security/users/opticUser.json +++ b/test-app/src/main/ml-config/security/users/opticUser.json @@ -1,15 +1,15 @@ { - "user-name": "opticUser", - "description": "user discription", - "password": "0pt1c", - "role": [ - "tde-admin", - "tde-view", - "opticRole", - "rest-admin", - "rest-writer", - "rest-reader", - "rest-extension-user", - "manage-user" - ] -} \ No newline at end of file + "user-name": "opticUser", + "description": "user discription", + "password": "0pt1c", + "role": [ + "tde-admin", + "tde-view", + "opticRole", + "rest-admin", + "rest-writer", + "rest-reader", + "rest-extension-user", + "manage-user" + ] +} diff --git a/test-app/src/main/ml-config/security/users/rest-admin.json b/test-app/src/main/ml-config/security/users/rest-admin.json index 2a62b49b6..a30b724a3 100644 --- a/test-app/src/main/ml-config/security/users/rest-admin.json +++ b/test-app/src/main/ml-config/security/users/rest-admin.json @@ -1,10 +1,6 @@ { - "user-name": "rest-admin", - "description": "rest-admin user", - "role": [ - "rest-admin", - "java-test-delete-temporal", - "java-test-xdmp-login" - ], - "password": "x" + "user-name": "rest-admin", + "description": "rest-admin user", + "role": ["rest-admin", "java-test-delete-temporal", "java-test-xdmp-login"], + "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/rest-evaluator.json b/test-app/src/main/ml-config/security/users/rest-evaluator.json index bb39fcb35..5b0692e79 100644 --- a/test-app/src/main/ml-config/security/users/rest-evaluator.json +++ b/test-app/src/main/ml-config/security/users/rest-evaluator.json @@ -1,8 +1,6 @@ { - "user-name": "rest-evaluator", - "description": "Test user for the java-client-api-project", - "role": [ - "java-test-evaluator" - ], - "password": "x" + "user-name": "rest-evaluator", + "description": "Test user for the java-client-api-project", + "role": ["java-test-evaluator", "java-test-xdmp-login"], + "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/rest-transform-user.json b/test-app/src/main/ml-config/security/users/rest-transform-user.json index 13b0eddd2..e7090f252 100644 --- a/test-app/src/main/ml-config/security/users/rest-transform-user.json +++ b/test-app/src/main/ml-config/security/users/rest-transform-user.json @@ -1,9 +1,14 @@ { - "user-name": "rest-transform-user", - "description": "REST API transform execution user", - "role": ["rest-transform-internal", "rest-reader", "rest-writer", "java-test-xdmp-login"], - "permission": [ - {"role-name": "rest-reader", "capability": "read"}, - {"role-name": "rest-writer", "capability": "update"} - ] + "user-name": "rest-transform-user", + "description": "REST API transform execution user", + "role": [ + "rest-transform-internal", + "rest-reader", + "rest-writer", + "java-test-xdmp-login" + ], + "permission": [ + { "role-name": "rest-reader", "capability": "read" }, + { "role-name": "rest-writer", "capability": "update" } + ] } diff --git a/test-app/src/main/ml-config/security/users/rest-writer.json b/test-app/src/main/ml-config/security/users/rest-writer.json index 50c2cb5d4..c1cd1056d 100644 --- a/test-app/src/main/ml-config/security/users/rest-writer.json +++ b/test-app/src/main/ml-config/security/users/rest-writer.json @@ -1,10 +1,6 @@ { - "user-name": "rest-writer", - "description": "rest-writer user", - "role": [ - "rest-writer", - "java-test-delete-graph", - "java-test-xdmp-login" - ], - "password": "x" + "user-name": "rest-writer", + "description": "rest-writer user", + "role": ["rest-writer", "java-test-delete-graph", "java-test-xdmp-login"], + "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json b/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json index e6d56ea40..fe863561a 100644 --- a/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json +++ b/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json @@ -1,12 +1,12 @@ { - "user-name": "writer-no-default-permissions", - "description": "test user that does not have the rest-writer role so as to avoid having default permissions", - "role": [ - "test-rest-writer", - "java-test-delete-graph", - "rest-extension-user", - "rest-reader", - "java-test-xdmp-login" - ], - "password": "x" + "user-name": "writer-no-default-permissions", + "description": "test user that does not have the rest-writer role so as to avoid having default permissions", + "role": [ + "test-rest-writer", + "java-test-delete-graph", + "rest-extension-user", + "rest-reader", + "java-test-xdmp-login" + ], + "password": "x" } From 864801f50c40a6c4f565ac758dfb081c2371bda6 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Fri, 1 May 2026 15:41:34 -0400 Subject: [PATCH 3/8] MLE-28498 Copyright Update --- .../com/marklogic/client/example/handle/URIHandleExample.java | 2 +- .../functionaltests/StringQueryHostBatcherTest.java | 2 +- .../client/fastfunctest/TestBulkWriteWithTransformations.java | 2 +- .../marklogic/client/fastfunctest/TestJSResourceExtensions.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java b/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java index 8f63b2cff..1c5ba5955 100644 --- a/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java +++ b/examples/src/main/java/com/marklogic/client/example/handle/URIHandleExample.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. + * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ package com.marklogic.client.example.handle; diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java index c6b0f7c4d..cf396f600 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/StringQueryHostBatcherTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. + * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ package com.marklogic.client.datamovement.functionaltests; diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java index 5fddfe739..53cdd8870 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBulkWriteWithTransformations.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. + * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ package com.marklogic.client.fastfunctest; diff --git a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java index b79683bec..6b77663ef 100644 --- a/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java +++ b/marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestJSResourceExtensions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. + * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ package com.marklogic.client.fastfunctest; From cba38f5cfcf316faad2a88dab63791a094bed462 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Fri, 1 May 2026 16:07:08 -0400 Subject: [PATCH 4/8] MLE-28498 Copilot Suggestions --- test-app/src/main/ml-config/security/users/opticUser.json | 2 +- .../src/main/ml-config/security/users/rest-transform-user.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test-app/src/main/ml-config/security/users/opticUser.json b/test-app/src/main/ml-config/security/users/opticUser.json index a5d2ab370..29d499c73 100644 --- a/test-app/src/main/ml-config/security/users/opticUser.json +++ b/test-app/src/main/ml-config/security/users/opticUser.json @@ -1,6 +1,6 @@ { "user-name": "opticUser", - "description": "user discription", + "description": "user description", "password": "0pt1c", "role": [ "tde-admin", diff --git a/test-app/src/main/ml-config/security/users/rest-transform-user.json b/test-app/src/main/ml-config/security/users/rest-transform-user.json index e7090f252..dbbb45d0e 100644 --- a/test-app/src/main/ml-config/security/users/rest-transform-user.json +++ b/test-app/src/main/ml-config/security/users/rest-transform-user.json @@ -1,6 +1,7 @@ { "user-name": "rest-transform-user", "description": "REST API transform execution user", + "password": "x", "role": [ "rest-transform-internal", "rest-reader", From 32f21d65907e590ee7f5460a91f3b701ea85ed9f Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 4 May 2026 13:08:20 -0400 Subject: [PATCH 5/8] MLE-28498 testResultIgnore() Test fix --- .../client/datamovement/ApplyTransformListener.java | 6 ++---- .../client/test/datamovement/ApplyTransformTest.java | 8 ++++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java b/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java index 6935fa2dd..bfee7421f 100644 --- a/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java +++ b/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java @@ -253,10 +253,8 @@ public enum ApplyResult { REPLACE, /** Run the transform on each document, but ignore the value returned by - * the transform because the transform will do any necessary database - * modifications or other processing. For example, a transform might call - * out to an external REST service or perhaps write multiple additional - * documents. + * the transform because the transform will do any necessary other processing. + * For example, a transform might call out to an external REST service. */ IGNORE }; diff --git a/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java b/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java index db76a7719..e18bd8122 100644 --- a/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java +++ b/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java @@ -25,7 +25,9 @@ import java.util.List; import java.util.Random; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.fail; @@ -92,17 +94,19 @@ public void testResultIgnore() throws Exception { StructuredQueryDefinition query = sqb.value(sqb.jsonProperty("testProperty"), "test2"); ServerTransform transform = new ServerTransform(transformName2) .addParameter("newValue", "test2a"); + AtomicReference e = new AtomicReference<>(); ApplyTransformListener listener = new ApplyTransformListener() .withTransform(transform) - .withApplyResult(ApplyResult.IGNORE); + .withApplyResult(ApplyResult.IGNORE).onFailure((batch, throwable) -> e.set(throwable)); QueryBatcher batcher = moveMgr.newQueryBatcher(query) .onUrisReady(listener); JobTicket ticket = moveMgr.startJob( batcher ); batcher.awaitCompletion(); moveMgr.stopJob(ticket); + assertNotNull(e.get()); JsonNode docContents = docMgr.readAs(collection + "/test2.json", JsonNode.class); - assertEquals("test2a", docContents.get("testProperty").textValue() ); + assertEquals("test2", docContents.get("testProperty").textValue() ); } @Test From 4f463a9eeee44f4ed208b0ba7c5d8ee6b7e429c8 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Mon, 4 May 2026 13:33:35 -0400 Subject: [PATCH 6/8] MLE-28498 Copyright Fix 2 --- .../marklogic/client/datamovement/ApplyTransformListener.java | 2 +- .../marklogic/client/test/datamovement/ApplyTransformTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java b/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java index bfee7421f..9d5972b2d 100644 --- a/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java +++ b/marklogic-client-api/src/main/java/com/marklogic/client/datamovement/ApplyTransformListener.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. + * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ package com.marklogic.client.datamovement; diff --git a/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java b/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java index e18bd8122..72078c22b 100644 --- a/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java +++ b/marklogic-client-api/src/test/java/com/marklogic/client/test/datamovement/ApplyTransformTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. + * Copyright (c) 2010-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved. */ package com.marklogic.client.test.datamovement; From 1c0fe2d8c7bbb99b8336b6220d3bda2ce25c4d56 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 5 May 2026 09:01:25 -0400 Subject: [PATCH 7/8] MLE-28498 Whitespace fix --- .../ml-config/security/users/opticUser.json | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/test-app/src/main/ml-config/security/users/opticUser.json b/test-app/src/main/ml-config/security/users/opticUser.json index 29d499c73..cc120735e 100644 --- a/test-app/src/main/ml-config/security/users/opticUser.json +++ b/test-app/src/main/ml-config/security/users/opticUser.json @@ -1,15 +1,15 @@ { - "user-name": "opticUser", - "description": "user description", - "password": "0pt1c", - "role": [ - "tde-admin", - "tde-view", - "opticRole", - "rest-admin", - "rest-writer", - "rest-reader", - "rest-extension-user", - "manage-user" - ] + "user-name": "opticUser", + "description": "user description", + "password": "0pt1c", + "role": [ + "tde-admin", + "tde-view", + "opticRole", + "rest-admin", + "rest-writer", + "rest-reader", + "rest-extension-user", + "manage-user" + ] } From 056cc837443654cb5654933925321f3cd1163305 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 5 May 2026 09:04:33 -0400 Subject: [PATCH 8/8] MLE-28498 JSON whitespace fixes --- .../ml-config/security/users/rest-admin.json | 8 +++--- .../security/users/rest-evaluator.json | 8 +++--- .../security/users/rest-transform-user.json | 26 +++++++++---------- .../ml-config/security/users/rest-writer.json | 8 +++--- .../users/writer-no-default-permissions.json | 20 +++++++------- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/test-app/src/main/ml-config/security/users/rest-admin.json b/test-app/src/main/ml-config/security/users/rest-admin.json index a30b724a3..6cdf8c9fb 100644 --- a/test-app/src/main/ml-config/security/users/rest-admin.json +++ b/test-app/src/main/ml-config/security/users/rest-admin.json @@ -1,6 +1,6 @@ { - "user-name": "rest-admin", - "description": "rest-admin user", - "role": ["rest-admin", "java-test-delete-temporal", "java-test-xdmp-login"], - "password": "x" + "user-name": "rest-admin", + "description": "rest-admin user", + "role": ["rest-admin", "java-test-delete-temporal", "java-test-xdmp-login"], + "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/rest-evaluator.json b/test-app/src/main/ml-config/security/users/rest-evaluator.json index 5b0692e79..c2d5b3449 100644 --- a/test-app/src/main/ml-config/security/users/rest-evaluator.json +++ b/test-app/src/main/ml-config/security/users/rest-evaluator.json @@ -1,6 +1,6 @@ { - "user-name": "rest-evaluator", - "description": "Test user for the java-client-api-project", - "role": ["java-test-evaluator", "java-test-xdmp-login"], - "password": "x" + "user-name": "rest-evaluator", + "description": "Test user for the java-client-api-project", + "role": ["java-test-evaluator", "java-test-xdmp-login"], + "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/rest-transform-user.json b/test-app/src/main/ml-config/security/users/rest-transform-user.json index dbbb45d0e..591446bc3 100644 --- a/test-app/src/main/ml-config/security/users/rest-transform-user.json +++ b/test-app/src/main/ml-config/security/users/rest-transform-user.json @@ -1,15 +1,15 @@ { - "user-name": "rest-transform-user", - "description": "REST API transform execution user", - "password": "x", - "role": [ - "rest-transform-internal", - "rest-reader", - "rest-writer", - "java-test-xdmp-login" - ], - "permission": [ - { "role-name": "rest-reader", "capability": "read" }, - { "role-name": "rest-writer", "capability": "update" } - ] + "user-name": "rest-transform-user", + "description": "REST API transform execution user", + "password": "x", + "role": [ + "rest-transform-internal", + "rest-reader", + "rest-writer", + "java-test-xdmp-login" + ], + "permission": [ + { "role-name": "rest-reader", "capability": "read" }, + { "role-name": "rest-writer", "capability": "update" } + ] } diff --git a/test-app/src/main/ml-config/security/users/rest-writer.json b/test-app/src/main/ml-config/security/users/rest-writer.json index c1cd1056d..ba434365c 100644 --- a/test-app/src/main/ml-config/security/users/rest-writer.json +++ b/test-app/src/main/ml-config/security/users/rest-writer.json @@ -1,6 +1,6 @@ { - "user-name": "rest-writer", - "description": "rest-writer user", - "role": ["rest-writer", "java-test-delete-graph", "java-test-xdmp-login"], - "password": "x" + "user-name": "rest-writer", + "description": "rest-writer user", + "role": ["rest-writer", "java-test-delete-graph", "java-test-xdmp-login"], + "password": "x" } diff --git a/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json b/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json index fe863561a..e6d56ea40 100644 --- a/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json +++ b/test-app/src/main/ml-config/security/users/writer-no-default-permissions.json @@ -1,12 +1,12 @@ { - "user-name": "writer-no-default-permissions", - "description": "test user that does not have the rest-writer role so as to avoid having default permissions", - "role": [ - "test-rest-writer", - "java-test-delete-graph", - "rest-extension-user", - "rest-reader", - "java-test-xdmp-login" - ], - "password": "x" + "user-name": "writer-no-default-permissions", + "description": "test user that does not have the rest-writer role so as to avoid having default permissions", + "role": [ + "test-rest-writer", + "java-test-delete-graph", + "rest-extension-user", + "rest-reader", + "java-test-xdmp-login" + ], + "password": "x" }