From 95dc45362af68cb88852365b3b9eccd81b285d48 Mon Sep 17 00:00:00 2001 From: wout Date: Fri, 14 Mar 2025 16:27:53 +0100 Subject: [PATCH 001/283] 127822: update researcherid -> webofscience --- dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl b/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl index 905187494dd3..d496b9c1421e 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl @@ -369,7 +369,7 @@ + schemeURI="https://www.webofscience.com"> From 0834fb9515445b25ea71cdcf1496023d53296869 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Tue, 9 Sep 2025 10:01:29 +0200 Subject: [PATCH 002/283] Set eperson attributes with fallback email from netid_email_domain when ldap email does not exist --- .../authenticate/LDAPAuthentication.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index da6a70924818..6a616749d68d 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -322,7 +322,7 @@ public int authenticate(Context context, log.info(LogHelper.getHeader(context, "type=ldap-login", "type=ldap_but_already_email")); context.turnOffAuthorisationSystem(); - setEpersonAttributes(context, eperson, ldap, Optional.of(netid)); + setEpersonAttributes(context, eperson, ldap, Optional.of(netid), email); ePersonService.update(context, eperson); context.dispatchEvents(); context.restoreAuthSystemState(); @@ -339,7 +339,7 @@ public int authenticate(Context context, try { context.turnOffAuthorisationSystem(); eperson = ePersonService.create(context); - setEpersonAttributes(context, eperson, ldap, Optional.of(netid)); + setEpersonAttributes(context, eperson, ldap, Optional.of(netid), email); eperson.setCanLogIn(true); authenticationService.initEPerson(context, request, eperson); ePersonService.update(context, eperson); @@ -381,11 +381,24 @@ public int authenticate(Context context, * Update eperson's attributes */ private void setEpersonAttributes(Context context, EPerson eperson, SpeakerToLDAP ldap, Optional netid) - throws SQLException { + throws SQLException { + setEpersonAttributes(context, eperson, ldap, netid, null); + } + /** + * Update eperson's attributes + */ + private void setEpersonAttributes(Context context, EPerson eperson, SpeakerToLDAP ldap, Optional netid, + String email) + throws SQLException { + + // Set email address: first try LDAP email, then fallback to provided email parameter if (StringUtils.isNotEmpty(ldap.ldapEmail)) { eperson.setEmail(ldap.ldapEmail); + } else if (StringUtils.isNotEmpty(email)) { + eperson.setEmail(email); } + if (StringUtils.isNotEmpty(ldap.ldapGivenName)) { eperson.setFirstName(context, ldap.ldapGivenName); } From 653b4a1ffe1d1f6a1cc55619d0cf74a4f341fb71 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 17 Dec 2025 11:12:30 -0600 Subject: [PATCH 003/283] [maven-release-plugin] prepare for next development iteration --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-rest/pom.xml | 4 ++-- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/rest/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 32 ++++++++++++++++---------------- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 46c251fc7d78..d0493a4c7467 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index 0f1e665002db..38dc845d0b1c 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index df82bff7c4d5..5ea46fc1db14 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 1fdc43af6319..8c7a6fa42258 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-rest/pom.xml b/dspace-rest/pom.xml index 30a097bcd30a..f37cf04ecf27 100644 --- a/dspace-rest/pom.xml +++ b/dspace-rest/pom.xml @@ -3,7 +3,7 @@ org.dspace dspace-rest war - 7.6.6 + 7.6.7-SNAPSHOT DSpace (Deprecated) REST Webapp DSpace RESTful Web Services API. NOTE: this REST API is DEPRECATED. Please consider using the REST API in the dspace-server-webapp instead! @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 4c9bebcdd419..0ac7b38b0783 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index 716302433d45..fa5643c48eb8 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 0585d2bbeed3..7b43bd3765d8 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index 23cf37aa9016..d97c39bba336 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index 06b8244490e9..a316d600cd98 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 69d54221cefe..72649577de79 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT ../../pom.xml diff --git a/dspace/modules/rest/pom.xml b/dspace/modules/rest/pom.xml index 7ed7268debac..39d1973c31e1 100644 --- a/dspace/modules/rest/pom.xml +++ b/dspace/modules/rest/pom.xml @@ -13,7 +13,7 @@ org.dspace modules - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index 919f687c97fb..ea548ba7f35b 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.6 + 7.6.7-SNAPSHOT .. diff --git a/dspace/pom.xml b/dspace/pom.xml index 9ca0c13d4283..da6820074a5d 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.6 + 7.6.7-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 1ba81c6b1fb3..36b14b13311f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.6 + 7.6.7-SNAPSHOT DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -875,14 +875,14 @@ org.dspace dspace-rest - 7.6.6 + 7.6.7-SNAPSHOT jar classes org.dspace dspace-rest - 7.6.6 + 7.6.7-SNAPSHOT war @@ -1031,69 +1031,69 @@ org.dspace dspace-api - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-api test-jar - 7.6.6 + 7.6.7-SNAPSHOT test org.dspace.modules additions - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-sword - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-swordv2 - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-oai - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-services - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-server-webapp test-jar - 7.6.6 + 7.6.7-SNAPSHOT test org.dspace dspace-rdf - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-iiif - 7.6.6 + 7.6.7-SNAPSHOT org.dspace dspace-server-webapp - 7.6.6 + 7.6.7-SNAPSHOT jar classes org.dspace dspace-server-webapp - 7.6.6 + 7.6.7-SNAPSHOT war @@ -1939,7 +1939,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-7.6.6 + dspace-7_x From 6d178b69d6edc33cfeb33b73d060d5ddbba0279e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 17 Dec 2025 11:55:27 -0600 Subject: [PATCH 004/283] Revert bouncycastle to version that is compatible with maven-gpg-plugin. --- pom.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 36b14b13311f..b3859104c30a 100644 --- a/pom.xml +++ b/pom.xml @@ -44,8 +44,9 @@ 1.7.36 3.2.3 - 1.82 - + + 1.81 2.10.0 From 9241a748af82714d9d637bfc2917712855efbf5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 23:24:04 +0000 Subject: [PATCH 005/283] build(deps): bump pdfbox-version from 3.0.5 to 3.0.6 Bumps `pdfbox-version` from 3.0.5 to 3.0.6. Updates `org.apache.pdfbox:pdfbox` from 3.0.5 to 3.0.6 Updates `org.apache.pdfbox:fontbox` from 3.0.5 to 3.0.6 --- updated-dependencies: - dependency-name: org.apache.pdfbox:pdfbox dependency-version: 3.0.6 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.pdfbox:fontbox dependency-version: 3.0.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3859104c30a..e5a30de034ed 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 9.4.58.v20250814 2.25.2 - 3.0.5 + 3.0.6 1.19.0 1.7.36 3.2.3 From c33204f3aa2bbbced2cb4fecbc6e3f6c67f7d20d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jan 2026 02:14:05 +0000 Subject: [PATCH 006/283] build(deps): bump io.grpc:grpc-context from 1.77.0 to 1.78.0 Bumps [io.grpc:grpc-context](https://github.com/grpc/grpc-java) from 1.77.0 to 1.78.0. - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.77.0...v1.78.0) --- updated-dependencies: - dependency-name: io.grpc:grpc-context dependency-version: 1.78.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3859104c30a..6dc975d0f434 100644 --- a/pom.xml +++ b/pom.xml @@ -1719,7 +1719,7 @@ io.grpc grpc-context - 1.77.0 + 1.78.0 com.google.http-client From 6283ab4c1adc63970e33d871246036f5158410ef Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 12 Jan 2026 16:42:01 -0600 Subject: [PATCH 007/283] Remove unnecessary tty/stdin_open settings from several Docker Compose scripts --- docker-compose-cli.yml | 2 -- docker-compose.yml | 6 ------ dspace/src/main/docker-compose/docker-compose-angular.yml | 2 -- .../src/main/docker-compose/docker-compose-shibboleth.yml | 2 -- 4 files changed, 12 deletions(-) diff --git a/docker-compose-cli.yml b/docker-compose-cli.yml index ce7676bdc6c3..77901c97618c 100644 --- a/docker-compose-cli.yml +++ b/docker-compose-cli.yml @@ -30,8 +30,6 @@ services: - ./dspace/config:/dspace/config entrypoint: /dspace/bin/dspace command: help - tty: true - stdin_open: true volumes: assetstore: diff --git a/docker-compose.yml b/docker-compose.yml index a16c3677503c..54051d3ea379 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,8 +43,6 @@ services: target: 8009 - published: 8000 target: 8000 - stdin_open: true - tty: true volumes: # Keep DSpace assetstore directory between reboots - assetstore:/dspace/assetstore @@ -78,8 +76,6 @@ services: ports: - published: 5432 target: 5432 - stdin_open: true - tty: true volumes: # Keep Postgres data directory between reboots - pgdata:/pgdata @@ -99,8 +95,6 @@ services: ports: - published: 8983 target: 8983 - stdin_open: true - tty: true working_dir: /var/solr/data volumes: # Keep Solr data directory between reboots diff --git a/dspace/src/main/docker-compose/docker-compose-angular.yml b/dspace/src/main/docker-compose/docker-compose-angular.yml index c9b87c904f17..bafbd6ceecc3 100644 --- a/dspace/src/main/docker-compose/docker-compose-angular.yml +++ b/dspace/src/main/docker-compose/docker-compose-angular.yml @@ -32,5 +32,3 @@ services: target: 4000 - published: 9876 target: 9876 - stdin_open: true - tty: true diff --git a/dspace/src/main/docker-compose/docker-compose-shibboleth.yml b/dspace/src/main/docker-compose/docker-compose-shibboleth.yml index f7fb2dcbd1ae..0b3178b75453 100644 --- a/dspace/src/main/docker-compose/docker-compose-shibboleth.yml +++ b/dspace/src/main/docker-compose/docker-compose-shibboleth.yml @@ -30,8 +30,6 @@ services: target: 80 - published: 443 target: 443 - stdin_open: true - tty: true environment: # Default to using "localhost" for Apache & Shibboleth # However, you can override this via the "DSPACE_HOSTNAME" environment variable. From bc0768a4b1c32f5eee3431dbec95fd1ecb9dcd1d Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 12 Jan 2026 16:52:00 -0600 Subject: [PATCH 008/283] Correct several docker compose scripts to use $DOCKER_REGISTRY and $DOCKER_OWNER env variables. --- dspace/src/main/docker-compose/db.entities.yml | 2 +- dspace/src/main/docker-compose/db.restore.yml | 2 +- dspace/src/main/docker-compose/docker-compose-angular.yml | 4 +--- dspace/src/main/docker-compose/docker-compose-shibboleth.yml | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dspace/src/main/docker-compose/db.entities.yml b/dspace/src/main/docker-compose/db.entities.yml index 3480c0df870d..db28fef80b85 100644 --- a/dspace/src/main/docker-compose/db.entities.yml +++ b/dspace/src/main/docker-compose/db.entities.yml @@ -8,7 +8,7 @@ services: dspacedb: - image: dspace/dspace-postgres-pgcrypto:dspace-7_x-loadsql + image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-7_x}-loadsql" environment: # This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data - LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql diff --git a/dspace/src/main/docker-compose/db.restore.yml b/dspace/src/main/docker-compose/db.restore.yml index 09990e675619..8584eee8272f 100644 --- a/dspace/src/main/docker-compose/db.restore.yml +++ b/dspace/src/main/docker-compose/db.restore.yml @@ -12,7 +12,7 @@ # This can be used to restore a "dspacedb" container from a pg_dump, or during upgrade to a new version of PostgreSQL. services: dspacedb: - image: dspace/dspace-postgres-pgcrypto:dspace-7_x-loadsql + image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-7_x}-loadsql" environment: # Location where the dump SQL file will be available on the running container - LOCALSQL=/tmp/pgdump.sql diff --git a/dspace/src/main/docker-compose/docker-compose-angular.yml b/dspace/src/main/docker-compose/docker-compose-angular.yml index bafbd6ceecc3..536b34bf8cf9 100644 --- a/dspace/src/main/docker-compose/docker-compose-angular.yml +++ b/dspace/src/main/docker-compose/docker-compose-angular.yml @@ -26,9 +26,7 @@ services: DSPACE_REST_HOST: localhost DSPACE_REST_PORT: 8080 DSPACE_REST_NAMESPACE: /server - image: dspace/dspace-angular:dspace-7_x + image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-7_x}" ports: - published: 4000 target: 4000 - - published: 9876 - target: 9876 diff --git a/dspace/src/main/docker-compose/docker-compose-shibboleth.yml b/dspace/src/main/docker-compose/docker-compose-shibboleth.yml index 0b3178b75453..1290fbc1e909 100644 --- a/dspace/src/main/docker-compose/docker-compose-shibboleth.yml +++ b/dspace/src/main/docker-compose/docker-compose-shibboleth.yml @@ -21,7 +21,7 @@ services: container_name: dspace-shibboleth depends_on: - dspace - image: dspace/dspace-shibboleth + image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-shibboleth" build: # Must be relative to root, so that it can be built alongside [src]/docker-compose.yml context: ./dspace/src/main/docker/dspace-shibboleth From c04b39efdbda13023b6a31c862f1294e0c86b46a Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 12 Jan 2026 16:54:13 -0600 Subject: [PATCH 009/283] Update Angular docker compose script to use production mode (as dev mode is only useful with src code). Requires minor update to backend docker compose script. --- docker-compose.yml | 3 +++ dspace/src/main/docker-compose/docker-compose-angular.yml | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 54051d3ea379..49139d9bab43 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,9 @@ services: # Uncomment to set a non-default value for dspace.server.url or dspace.ui.url # dspace__P__server__P__url: http://localhost:8080/server # dspace__P__ui__P__url: http://localhost:4000 + # Set SSR URL to the Docker container name so that UI can contact container directly in Production mode. + # (This is necessary for docker-compose-angular.yml as it uses production mode by default) + dspace__P__server__P__ssr__P__url: http://dspace:8080/server dspace__P__name: 'DSpace Started with Docker Compose' # db.url: Ensure we are using the 'dspacedb' image for our database db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace' diff --git a/dspace/src/main/docker-compose/docker-compose-angular.yml b/dspace/src/main/docker-compose/docker-compose-angular.yml index 536b34bf8cf9..dcfc61905230 100644 --- a/dspace/src/main/docker-compose/docker-compose-angular.yml +++ b/dspace/src/main/docker-compose/docker-compose-angular.yml @@ -26,7 +26,9 @@ services: DSPACE_REST_HOST: localhost DSPACE_REST_PORT: 8080 DSPACE_REST_NAMESPACE: /server - image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-7_x}" + # Ensure SSR can use the 'dspace' Docker image directly (see docker-compose-rest.yml) + DSPACE_REST_SSRBASEURL: http://dspace:8080/server + image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-7_x-dist}" ports: - published: 4000 target: 4000 From c7b1294330b6aafdf17624744de27c9ceabc7a9c Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Mon, 12 Jan 2026 17:03:15 -0600 Subject: [PATCH 010/283] Fix minor networking inconsistencies similar to https://github.com/DSpace/dspace-angular/pull/4987 --- docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index 49139d9bab43..83474bde86a7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ networks: # Define a custom subnet for our DSpace network, so that we can easily trust requests from host to container. # If you customize this value, be sure to customize the 'proxies.trusted.ipranges' env variable below. - subnet: 172.23.0.0/16 + # Explicitly set external=false because this script creates the network. + external: false services: # DSpace (backend) webapp container dspace: From d6e84fddf22ce24789c6d8000aac4cfdc948ad93 Mon Sep 17 00:00:00 2001 From: April Herron Date: Mon, 13 Aug 2018 14:18:17 -0400 Subject: [PATCH 011/283] Fix updateMissingBitstreams to use single database operation instead of o-o operations [DS-3975] Includes toniprieto's suggested change in #2169 discussion and additional logging (e.g. how many bitstreams are missing). (cherry picked from commit fc1bd872b016695a2e60dfa554c55f206f9f359f) --- .../MostRecentChecksumServiceImpl.java | 55 ++----------------- .../checker/dao/MostRecentChecksumDAO.java | 2 + .../dao/impl/MostRecentChecksumDAOImpl.java | 18 ++++++ 3 files changed, 25 insertions(+), 50 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java b/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java index d267171aa0d9..9ee777a3e15b 100644 --- a/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/checker/MostRecentChecksumServiceImpl.java @@ -90,61 +90,16 @@ public List findBitstreamResultTypeReport(Context context, D /** * Queries the bitstream table for bitstream IDs that are not yet in the * most_recent_checksum table, and inserts them into the - * most_recent_checksum and checksum_history tables. - * + * most_recent_checksum table. * @param context Context * @throws SQLException if database error */ @Override public void updateMissingBitstreams(Context context) throws SQLException { -// "insert into most_recent_checksum ( " -// + "bitstream_id, to_be_processed, expected_checksum, current_checksum, " -// + "last_process_start_date, last_process_end_date, " -// + "checksum_algorithm, matched_prev_checksum, result ) " -// + "select bitstream.bitstream_id, " -// + "CASE WHEN bitstream.deleted = false THEN true ELSE false END, " -// + "CASE WHEN bitstream.checksum IS NULL THEN '' ELSE bitstream.checksum END, " -// + "CASE WHEN bitstream.checksum IS NULL THEN '' ELSE bitstream.checksum END, " -// + "?, ?, CASE WHEN bitstream.checksum_algorithm IS NULL " -// + "THEN 'MD5' ELSE bitstream.checksum_algorithm END, true, " -// + "CASE WHEN bitstream.deleted = true THEN 'BITSTREAM_MARKED_DELETED' else 'CHECKSUM_MATCH' END " -// + "from bitstream where not exists( " -// + "select 'x' from most_recent_checksum " -// + "where most_recent_checksum.bitstream_id = bitstream.bitstream_id )"; - - List unknownBitstreams = bitstreamService.findBitstreamsWithNoRecentChecksum(context); - for (Bitstream bitstream : unknownBitstreams) { - log.info(bitstream + " " + bitstream.getID().toString() + " " + bitstream.getName()); - - MostRecentChecksum mostRecentChecksum = new MostRecentChecksum(); - mostRecentChecksum.setBitstream(bitstream); - //Only process if our bitstream isn't deleted - mostRecentChecksum.setToBeProcessed(!bitstream.isDeleted()); - if (bitstream.getChecksum() == null) { - mostRecentChecksum.setCurrentChecksum(""); - mostRecentChecksum.setExpectedChecksum(""); - } else { - mostRecentChecksum.setCurrentChecksum(bitstream.getChecksum()); - mostRecentChecksum.setExpectedChecksum(bitstream.getChecksum()); - } - mostRecentChecksum.setProcessStartDate(new Date()); - mostRecentChecksum.setProcessEndDate(new Date()); - if (bitstream.getChecksumAlgorithm() == null) { - mostRecentChecksum.setChecksumAlgorithm("MD5"); - } else { - mostRecentChecksum.setChecksumAlgorithm(bitstream.getChecksumAlgorithm()); - } - mostRecentChecksum.setMatchedPrevChecksum(true); - ChecksumResult checksumResult; - if (bitstream.isDeleted()) { - checksumResult = checksumResultService.findByCode(context, ChecksumResultCode.BITSTREAM_MARKED_DELETED); - } else { - checksumResult = checksumResultService.findByCode(context, ChecksumResultCode.CHECKSUM_MATCH); - } - mostRecentChecksum.setChecksumResult(checksumResult); - mostRecentChecksumDAO.create(context, mostRecentChecksum); - mostRecentChecksumDAO.save(context, mostRecentChecksum); - } + log.info("Retrieving missing bitsreams (bitstream IDs that are not yet in most_recent_checksum table)..."); + int updated = mostRecentChecksumDAO.updateMissingBitstreams(context); + log.info("Updated most_recent_checksum for " + updated + " bitstreams."); + log.info("Missing bitsreams processing done."); } @Override diff --git a/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java b/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java index 56485c9b4b4b..73a81e4d9b4f 100644 --- a/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java +++ b/dspace-api/src/main/java/org/dspace/checker/dao/MostRecentChecksumDAO.java @@ -33,6 +33,8 @@ public List findByNotProcessedInDateRange(Context context, D public List findByResultTypeInDateRange(Context context, Date startDate, Date endDate, ChecksumResultCode resultCode) throws SQLException; + public int updateMissingBitstreams(Context context) throws SQLException; + public void deleteByBitstream(Context context, Bitstream bitstream) throws SQLException; public MostRecentChecksum getOldestRecord(Context context) throws SQLException; diff --git a/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java b/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java index 6de60bd4fdb2..3ca2f9f822e8 100644 --- a/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java @@ -66,6 +66,24 @@ public List findByNotProcessedInDateRange(Context context, D return list(context, criteriaQuery, false, MostRecentChecksum.class, -1, -1); } + @Override + public int updateMissingBitstreams(Context context) throws SQLException { + String hql = "INSERT INTO MostRecentChecksum(bitstream, toBeProcessed, expectedChecksum, currentChecksum, " + + "processStartDate, processEndDate, checksumAlgorithm, matchedPrevChecksum, checksumResult) " + + "SELECT b, " + + "CASE WHEN deleted = false THEN true ELSE false END, " + + "CASE WHEN checksum IS NULL THEN '' ELSE checksum END, " + + "CASE WHEN checksum IS NULL THEN '' ELSE checksum END, " + + "current_date(), current_date(), " + + "CASE WHEN checksumAlgorithm IS NULL THEN 'MD5' ELSE checksumAlgorithm END, " + + "CAST(1 AS boolean), " + + "(SELECT cr FROM ChecksumResult AS cr WHERE " + + "(resultCode='BITSTREAM_MARKED_DELETED' AND b.deleted = true) " + + "OR (resultCode='CHECKSUM_MATCH' AND b.deleted = false)) " + + "FROM Bitstream AS b WHERE NOT EXISTS(SELECT 'x' FROM MostRecentChecksum WHERE id=b.id)"; + Query query = createQuery(context, hql); + return query.executeUpdate(); + } @Override public MostRecentChecksum findByBitstream(Context context, Bitstream bitstream) throws SQLException { From 677bea1d7f5be200c3b1baf8472347b9e14822b3 Mon Sep 17 00:00:00 2001 From: Miika Nurminen Date: Fri, 15 Aug 2025 19:34:50 +0300 Subject: [PATCH 012/283] Fix types used in updateMissingBitstreams HQL Error found when running checker ITs in #11144. (cherry picked from commit c358e885ae6833ab8bf8d8a28789ef31443c4545) --- .../checker/dao/impl/MostRecentChecksumDAOImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java b/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java index 3ca2f9f822e8..6ecd94f67f97 100644 --- a/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/checker/dao/impl/MostRecentChecksumDAOImpl.java @@ -74,13 +74,13 @@ public int updateMissingBitstreams(Context context) throws SQLException { "CASE WHEN deleted = false THEN true ELSE false END, " + "CASE WHEN checksum IS NULL THEN '' ELSE checksum END, " + "CASE WHEN checksum IS NULL THEN '' ELSE checksum END, " + - "current_date(), current_date(), " + + "current_timestamp(), current_timestamp(), " + "CASE WHEN checksumAlgorithm IS NULL THEN 'MD5' ELSE checksumAlgorithm END, " + "CAST(1 AS boolean), " + "(SELECT cr FROM ChecksumResult AS cr WHERE " + - "(resultCode='BITSTREAM_MARKED_DELETED' AND b.deleted = true) " + - "OR (resultCode='CHECKSUM_MATCH' AND b.deleted = false)) " + - "FROM Bitstream AS b WHERE NOT EXISTS(SELECT 'x' FROM MostRecentChecksum WHERE id=b.id)"; + "(resultCode = 'BITSTREAM_MARKED_DELETED' AND b.deleted = true) " + + "OR (resultCode = 'CHECKSUM_MATCH' AND b.deleted = false)) " + + "FROM Bitstream AS b WHERE NOT EXISTS(SELECT 'x' FROM MostRecentChecksum AS c WHERE c.bitstream = b)"; Query query = createQuery(context, hql); return query.executeUpdate(); } From 8488f0601a5fbfc352f679275bebbd7b1c773eb9 Mon Sep 17 00:00:00 2001 From: Drew Heles Date: Wed, 21 Jan 2026 08:50:15 -0500 Subject: [PATCH 013/283] Add DataCite sandbox url to crosswalk (cherry picked from commit 3a9f3b28b2028076d822b413b344acc49aa461e5) --- dspace/config/crosswalks/DIM2DataCite.xsl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index 935b3dc4038a..64b004b063c3 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -350,6 +350,9 @@ + + + From 9d9c031f87cd978ce831de3cc70a018534bfa351 Mon Sep 17 00:00:00 2001 From: milanmajchrak <90026355+milanmajchrak@users.noreply.github.com> Date: Tue, 15 Apr 2025 11:01:44 +0200 Subject: [PATCH 014/283] ZCU-PUB/The bitstream name is encoded in the URL. Updated the test to test special characters in the URL (#930) (cherry picked from commit 29199d5935ded1f48dbd30727af5530bc6c2ef6c) --- .../src/test/java/org/dspace/app/sword2/Swordv2IT.java | 3 ++- .../src/main/java/org/dspace/sword2/SwordUrlManager.java | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java b/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java index 3ff79f78055c..f24a09c8e563 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java @@ -220,7 +220,8 @@ public void depositAndEditViaSwordTest() throws Exception { // Add required headers HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); - headers.setContentDisposition(ContentDisposition.attachment().filename("example.zip").build()); + // Test the file with spaces or special characters in the name + headers.setContentDisposition(ContentDisposition.attachment().filename("example .zip").build()); headers.set("Packaging", "http://purl.org/net/sword/package/METSDSpaceSIP"); headers.setAccept(List.of(MediaType.APPLICATION_ATOM_XML)); diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java index 1d49bc27977c..4ba0f9950e11 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordUrlManager.java @@ -7,6 +7,8 @@ */ package org.dspace.sword2; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.sql.SQLException; import java.util.List; @@ -386,10 +388,10 @@ public String getBitstreamUrl(Bitstream bitstream) if (handle != null && !"".equals(handle)) { bsLink = bsLink + "/bitstream/" + handle + "/" + - bitstream.getSequenceID() + "/" + bitstream.getName(); + bitstream.getSequenceID() + "/" + URLEncoder.encode(bitstream.getName(), StandardCharsets.UTF_8); } else { bsLink = bsLink + "/retrieve/" + bitstream.getID() + "/" + - bitstream.getName(); + URLEncoder.encode(bitstream.getName(), StandardCharsets.UTF_8); } return bsLink; @@ -401,7 +403,7 @@ public String getBitstreamUrl(Bitstream bitstream) public String getActionableBitstreamUrl(Bitstream bitstream) throws DSpaceSwordException { return this.getSwordBaseUrl() + "/edit-media/bitstream/" + - bitstream.getID() + "/" + bitstream.getName(); + bitstream.getID() + "/" + URLEncoder.encode(bitstream.getName(), StandardCharsets.UTF_8); } public boolean isActionableBitstreamUrl(Context context, String url) { From fe54d800ea12731b032c6c08a54d5874e18cbfb9 Mon Sep 17 00:00:00 2001 From: Mark Patton Date: Mon, 15 Dec 2025 11:14:53 -0500 Subject: [PATCH 015/283] Make sure that bitstream downloads have a content-disposition header set (cherry picked from commit 9ae59e7a3e634e3bf71b3643d124ea9a8d625d84) --- .../main/java/org/dspace/app/rest/BitstreamRestController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java index 242b231654c6..1ff9f7520c16 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java @@ -160,6 +160,8 @@ public ResponseEntity retrieve(@PathVariable UUID uuid, HttpServletResponse resp if ((dispositionThreshold >= 0 && filesize > dispositionThreshold) || checkFormatForContentDisposition(format)) { httpHeadersInitializer.withDisposition(HttpHeadersInitializer.CONTENT_DISPOSITION_ATTACHMENT); + } else { + httpHeadersInitializer.withDisposition(HttpHeadersInitializer.CONTENT_DISPOSITION_INLINE); } //We have all the data we need, close the connection to the database so that it doesn't stay open during From 905429773f473fd073e1b5691f155521e94212fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 07:36:06 +0000 Subject: [PATCH 016/283] build(deps): bump log4j.version from 2.25.2 to 2.25.3 Bumps `log4j.version` from 2.25.2 to 2.25.3. Updates `org.apache.logging.log4j:log4j-api` from 2.25.2 to 2.25.3 Updates `org.apache.logging.log4j:log4j-core` from 2.25.2 to 2.25.3 Updates `org.apache.logging.log4j:log4j-1.2-api` from 2.25.2 to 2.25.3 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-version: 2.25.3 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-core dependency-version: 2.25.3 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-1.2-api dependency-version: 2.25.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e5a30de034ed..ca643941936c 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 1.1.1 9.4.58.v20250814 - 2.25.2 + 2.25.3 3.0.6 1.19.0 1.7.36 From a70b71febaddb10b0cc8f5d789952f02eba29a1c Mon Sep 17 00:00:00 2001 From: hsb-app Date: Mon, 26 Jan 2026 13:53:51 +0100 Subject: [PATCH 017/283] #11792 Bug fix link checker stops when url has spaces (cherry picked from commit 570fb9c0fcc5623a8e5701abbc1a1370a7ed6019) --- .../java/org/dspace/ctask/general/BasicLinkChecker.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java b/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java index 020331842703..476c673ec952 100644 --- a/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java +++ b/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java @@ -9,12 +9,15 @@ import java.io.IOException; import java.net.HttpURLConnection; +import java.net.URI; +import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.logging.log4j.Logger; import org.dspace.app.client.DSpaceHttpClientFactory; @@ -141,7 +144,8 @@ protected boolean checkURL(String url, StringBuilder results) { protected int getResponseStatus(String url, int redirects) { RequestConfig config = RequestConfig.custom().setRedirectsEnabled(true).build(); try (CloseableHttpClient httpClient = DSpaceHttpClientFactory.getInstance().buildWithRequestConfig(config)) { - CloseableHttpResponse httpResponse = httpClient.execute(new HttpGet(url)); + URI uri = new URIBuilder(url).build(); + CloseableHttpResponse httpResponse = httpClient.execute(new HttpGet(uri)); int statusCode = httpResponse.getStatusLine().getStatusCode(); int maxRedirect = configurationService.getIntProperty("curate.checklinks.max-redirect", 0); if ((statusCode == HttpURLConnection.HTTP_MOVED_TEMP || statusCode == HttpURLConnection.HTTP_MOVED_PERM || @@ -153,6 +157,9 @@ protected int getResponseStatus(String url, int redirects) { } } return statusCode; + } catch (URISyntaxException e) { + log.error("Invalid URL: ", url, e); + return 0; } catch (IOException ioe) { // Must be a bad URL log.debug("Bad link: " + ioe.getMessage()); From cf4b0442aca19b1b4ef7521fd5f8f66561ca57ae Mon Sep 17 00:00:00 2001 From: zhaw-hsb Date: Mon, 26 Jan 2026 14:38:38 +0100 Subject: [PATCH 018/283] checkstyle removed trailing spaces (cherry picked from commit 1cb88279efcab123c62150a731ebfe038b2168fd) --- .../main/java/org/dspace/ctask/general/BasicLinkChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java b/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java index 476c673ec952..3c116df13bd2 100644 --- a/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java +++ b/dspace-api/src/main/java/org/dspace/ctask/general/BasicLinkChecker.java @@ -158,7 +158,7 @@ protected int getResponseStatus(String url, int redirects) { } return statusCode; } catch (URISyntaxException e) { - log.error("Invalid URL: ", url, e); + log.error("Invalid URL: ", url, e); return 0; } catch (IOException ioe) { // Must be a bad URL From b434d84271fbdbd4f0dd263e25ef1abf33cc8bd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:18:21 +0000 Subject: [PATCH 019/283] Bump the build-tools group with 4 updates Bumps the build-tools group with 4 updates: [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin), [org.codehaus.mojo:xml-maven-plugin](https://github.com/mojohaus/xml-maven-plugin), [org.codehaus.mojo:license-maven-plugin](https://github.com/mojohaus/license-maven-plugin) and [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin). Updates `org.sonatype.central:central-publishing-maven-plugin` from 0.9.0 to 0.10.0 - [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits) Updates `org.codehaus.mojo:xml-maven-plugin` from 1.2.0 to 1.2.1 - [Release notes](https://github.com/mojohaus/xml-maven-plugin/releases) - [Commits](https://github.com/mojohaus/xml-maven-plugin/compare/1.2.0...xml-maven-plugin-1.2.1) Updates `org.codehaus.mojo:license-maven-plugin` from 2.7.0 to 2.7.1 - [Release notes](https://github.com/mojohaus/license-maven-plugin/releases) - [Commits](https://github.com/mojohaus/license-maven-plugin/compare/2.7.0...2.7.1) Updates `org.codehaus.mojo:buildnumber-maven-plugin` from 3.2.1 to 3.3.0 - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](https://github.com/mojohaus/buildnumber-maven-plugin/compare/3.2.1...buildnumber-maven-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.sonatype.central:central-publishing-maven-plugin dependency-version: 0.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.codehaus.mojo:xml-maven-plugin dependency-version: 1.2.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.codehaus.mojo:license-maven-plugin dependency-version: 2.7.1 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin dependency-version: 3.3.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 2 +- pom.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index d0493a4c7467..8bd941709d90 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -102,7 +102,7 @@ org.codehaus.mojo buildnumber-maven-plugin - 3.2.1 + 3.3.0 UNKNOWN_REVISION diff --git a/pom.xml b/pom.xml index ca643941936c..09e75a04f548 100644 --- a/pom.xml +++ b/pom.xml @@ -358,7 +358,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.9.0 + 0.10.0 @@ -473,7 +473,7 @@ org.codehaus.mojo xml-maven-plugin - 1.2.0 + 1.2.1 validate-ALL-xml-and-xsl @@ -681,7 +681,7 @@ org.codehaus.mojo license-maven-plugin - 2.7.0 + 2.7.1 false From 1efdd2715208e3039107e0f0291bff73c8d71446 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:18:38 +0000 Subject: [PATCH 020/283] Bump the fasterxml group with 4 updates Bumps the fasterxml group with 4 updates: [com.fasterxml:classmate](https://github.com/FasterXML/java-classmate), [com.fasterxml.jackson.core:jackson-annotations](https://github.com/FasterXML/jackson), [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core) and [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson). Updates `com.fasterxml:classmate` from 1.7.1 to 1.7.3 - [Commits](https://github.com/FasterXML/java-classmate/compare/classmate-1.7.1...classmate-1.7.3) Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.20 to 2.21 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-core` from 2.20.1 to 2.21.0 - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.20.1...jackson-core-2.21.0) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.20.1 to 2.21.0 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.20.1 to 2.21.0 - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml:classmate dependency-version: 1.7.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-version: '2.21' dependency-type: direct:production update-type: version-update:semver-minor dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-version: 2.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: fasterxml ... Signed-off-by: dependabot[bot] --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ca643941936c..55ef2080e354 100644 --- a/pom.xml +++ b/pom.xml @@ -30,8 +30,8 @@ 3.11.1 2.31.0 - 2.20.1 - 2.20 + 2.21.0 + 2.21 1.3.2 2.3.1 2.3.9 @@ -1772,7 +1772,7 @@ com.fasterxml classmate - 1.7.1 + 1.7.3 com.fasterxml.jackson.core From 4ebae2132b6df9c04f73f069d806495659ed8747 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:19:48 +0000 Subject: [PATCH 021/283] Bump org.apache.bcel:bcel from 6.11.0 to 6.12.0 Bumps [org.apache.bcel:bcel](https://github.com/apache/commons-bcel) from 6.11.0 to 6.12.0. - [Changelog](https://github.com/apache/commons-bcel/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-bcel/compare/rel/commons-bcel-6.11.0...rel/commons-bcel-6.12.0) --- updated-dependencies: - dependency-name: org.apache.bcel:bcel dependency-version: 6.12.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index d0493a4c7467..8906beac67a1 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -822,7 +822,7 @@ org.apache.bcel bcel - 6.11.0 + 6.12.0 test From ca4ff14c28b9576c5b332187cd53a9ebb6f2c5b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:20:29 +0000 Subject: [PATCH 022/283] Bump dnsjava:dnsjava from 3.6.3 to 3.6.4 Bumps [dnsjava:dnsjava](https://github.com/dnsjava/dnsjava) from 3.6.3 to 3.6.4. - [Release notes](https://github.com/dnsjava/dnsjava/releases) - [Changelog](https://github.com/dnsjava/dnsjava/blob/master/Changelog) - [Commits](https://github.com/dnsjava/dnsjava/compare/v3.6.3...v3.6.4) --- updated-dependencies: - dependency-name: dnsjava:dnsjava dependency-version: 3.6.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index d0493a4c7467..137ab82d082a 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -628,7 +628,7 @@ dnsjava dnsjava - 3.6.3 + 3.6.4 From 6fe8d4653007b8fa2b719d454a62e8f556245bac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:21:37 +0000 Subject: [PATCH 023/283] Bump org.postgresql:postgresql from 42.7.8 to 42.7.9 Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.8 to 42.7.9. - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.7.8...REL42.7.9) --- updated-dependencies: - dependency-name: org.postgresql:postgresql dependency-version: 42.7.9 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ca643941936c..b5e504420518 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 5.7.14 5.6.15.Final 6.2.5.Final - 42.7.8 + 42.7.9 8.11.4 3.11.1 From e7117be54c562ca1466c5b3d771c168216c991fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 02:52:59 +0000 Subject: [PATCH 024/283] build(deps): bump the amazon-s3 group with 2 updates Bumps the amazon-s3 group with 2 updates: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.38.8 to 2.39.6 Updates `software.amazon.awssdk.crt:aws-crt` from 0.39.4 to 0.40.1 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.39.4...v0.40.1) --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.39.6 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.40.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index d0493a4c7467..1bfc30e660d7 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -739,7 +739,7 @@ software.amazon.awssdk s3 - 2.38.8 + 2.41.14 software.amazon.awssdk @@ -755,7 +755,7 @@ software.amazon.awssdk.crt aws-crt - 0.39.4 + 0.42.2 From baa994f64dccdb4f33b2c97b44843c0b32b32052 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Feb 2026 03:01:56 +0000 Subject: [PATCH 025/283] Bump the apache-commons group across 1 directory with 4 updates Bumps the apache-commons group with 4 updates in the / directory: [commons-codec:commons-codec](https://github.com/apache/commons-codec), org.apache.commons:commons-dbcp2, org.apache.commons:commons-pool2 and [org.apache.commons:commons-text](https://github.com/apache/commons-text). Updates `commons-codec:commons-codec` from 1.20.0 to 1.21.0 - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.20.0...rel/commons-codec-1.21.0) Updates `org.apache.commons:commons-dbcp2` from 2.13.0 to 2.14.0 Updates `org.apache.commons:commons-pool2` from 2.12.1 to 2.13.1 Updates `org.apache.commons:commons-text` from 1.14.0 to 1.15.0 - [Changelog](https://github.com/apache/commons-text/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-text/compare/rel/commons-text-1.14.0...rel/commons-text-1.15.0) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-version: 1.21.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-dbcp2 dependency-version: 2.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-pool2 dependency-version: 2.13.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-text dependency-version: 1.15.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons ... Signed-off-by: dependabot[bot] --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index ca643941936c..82aa88b92a55 100644 --- a/pom.xml +++ b/pom.xml @@ -1479,7 +1479,7 @@ commons-codec commons-codec - 1.20.0 + 1.21.0 org.apache.commons @@ -1494,7 +1494,7 @@ org.apache.commons commons-dbcp2 - 2.13.0 + 2.14.0 commons-io @@ -1521,12 +1521,12 @@ org.apache.commons commons-pool2 - 2.12.1 + 2.13.1 org.apache.commons commons-text - 1.14.0 + 1.15.0 commons-validator From 33686254bf94961f5c8b1925bdc07a1419107d77 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Tue, 3 Feb 2026 21:25:08 +0100 Subject: [PATCH 026/283] Move same-collection check to inheritDefaultPolicies move method (cherry picked from commit cfff8040b3f0fcf079f87fef51451b12107c80b6) --- .../org/dspace/content/ItemServiceImpl.java | 10 ++++----- .../java/org/dspace/content/ItemTest.java | 21 +++++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java index c1072969df20..744666baff91 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java @@ -1134,11 +1134,6 @@ public void adjustItemPolicies(Context context, Item item, Collection collection public void move(Context context, Item item, Collection from, Collection to) throws SQLException, AuthorizeException, IOException { - // If the two collections are the same, do nothing. - if (from.equals(to)) { - return; - } - // Use the normal move method, and default to not inherit permissions this.move(context, item, from, to, false); } @@ -1153,6 +1148,11 @@ public void move(Context context, Item item, Collection from, Collection to, boo authorizeService.authorizeAction(context, item, Constants.WRITE); } + // If the two collections are the same, do nothing. + if (from.equals(to)) { + return; + } + // Move the Item from one Collection to the other collectionService.addItem(context, to, item); collectionService.removeItem(context, from, item); diff --git a/dspace-api/src/test/java/org/dspace/content/ItemTest.java b/dspace-api/src/test/java/org/dspace/content/ItemTest.java index 00dbf2994d98..1f520926b982 100644 --- a/dspace-api/src/test/java/org/dspace/content/ItemTest.java +++ b/dspace-api/src/test/java/org/dspace/content/ItemTest.java @@ -1604,6 +1604,27 @@ public void testMoveSameCollection() throws Exception { verify(itemServiceSpy, times(0)).delete(context, it); } + /** + * Test of move with inherit default policies method, of class Item, where both Collections are the same. + */ + @Test + public void testMoveSameCollectionWithInheritDefaultPolicies() throws Exception { + context.turnOffAuthorisationSystem(); + while (it.getCollections().size() > 1) { + it.removeCollection(it.getCollections().get(0)); + } + + Collection collection = it.getCollections().get(0); + it.setOwningCollection(collection); + ItemService itemServiceSpy = spy(itemService); + + itemService.move(context, it, collection, collection, true); + context.restoreAuthSystemState(); + assertThat("testMoveSameCollection 0", it.getOwningCollection(), notNullValue()); + assertThat("testMoveSameCollection 1", it.getOwningCollection(), equalTo(collection)); + verify(itemServiceSpy, times(0)).delete(context, it); + } + /** * Test of hasUploadedFiles method, of class Item. */ From 52d4e83413db41bf248eba81d896fced53891e3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Feb 2026 05:57:52 +0000 Subject: [PATCH 027/283] build(deps): bump the test-tools group with 7 updates Bumps the test-tools group with 7 updates: | Package | From | To | | --- | --- | --- | | [org.testcontainers:testcontainers-localstack](https://github.com/testcontainers/testcontainers-java) | `2.0.2` | `2.0.3` | | [io.netty:netty-buffer](https://github.com/netty/netty) | `4.2.7.Final` | `4.2.9.Final` | | [io.netty:netty-transport](https://github.com/netty/netty) | `4.2.7.Final` | `4.2.9.Final` | | [io.netty:netty-transport-native-unix-common](https://github.com/netty/netty) | `4.2.7.Final` | `4.2.9.Final` | | [io.netty:netty-common](https://github.com/netty/netty) | `4.2.7.Final` | `4.2.9.Final` | | [io.netty:netty-handler](https://github.com/netty/netty) | `4.2.7.Final` | `4.2.9.Final` | | [io.netty:netty-codec](https://github.com/netty/netty) | `4.2.7.Final` | `4.2.9.Final` | Updates `org.testcontainers:testcontainers-localstack` from 2.0.2 to 2.0.3 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/2.0.2...2.0.3) Updates `io.netty:netty-buffer` from 4.2.7.Final to 4.2.9.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.7.Final...netty-4.2.9.Final) Updates `io.netty:netty-transport` from 4.2.7.Final to 4.2.9.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.7.Final...netty-4.2.9.Final) Updates `io.netty:netty-transport-native-unix-common` from 4.2.7.Final to 4.2.9.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.7.Final...netty-4.2.9.Final) Updates `io.netty:netty-common` from 4.2.7.Final to 4.2.9.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.7.Final...netty-4.2.9.Final) Updates `io.netty:netty-handler` from 4.2.7.Final to 4.2.9.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.7.Final...netty-4.2.9.Final) Updates `io.netty:netty-codec` from 4.2.7.Final to 4.2.9.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.7.Final...netty-4.2.9.Final) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers-localstack dependency-version: 2.0.3 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-buffer dependency-version: 4.2.9.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport dependency-version: 4.2.9.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport-native-unix-common dependency-version: 4.2.9.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-common dependency-version: 4.2.9.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-handler dependency-version: 4.2.9.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-codec dependency-version: 4.2.9.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index bf0d1b8800e9..8d72f1f7f21d 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -857,7 +857,7 @@ org.testcontainers testcontainers-localstack - 2.0.2 + 2.0.3 test @@ -877,32 +877,32 @@ io.netty netty-buffer - 4.2.7.Final + 4.2.9.Final io.netty netty-transport - 4.2.7.Final + 4.2.9.Final io.netty netty-transport-native-unix-common - 4.2.7.Final + 4.2.9.Final io.netty netty-common - 4.2.7.Final + 4.2.9.Final io.netty netty-handler - 4.2.7.Final + 4.2.9.Final io.netty netty-codec - 4.2.7.Final + 4.2.9.Final org.apache.velocity From f728ae00a31c624c6e231b9942f03adb6e6a71df Mon Sep 17 00:00:00 2001 From: Paurikova2 Date: Thu, 11 Dec 2025 13:40:42 +0100 Subject: [PATCH 028/283] added test for getVetsion, fix null pointer exception (cherry picked from commit 8a18ca6a79bd2433734088d00ff03170ba38ee59) --- .../versioning/VersionHistoryServiceImpl.java | 3 --- .../org/dspace/content/VersioningTest.java | 21 +++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/versioning/VersionHistoryServiceImpl.java b/dspace-api/src/main/java/org/dspace/versioning/VersionHistoryServiceImpl.java index 96c39ac3a8e8..493861df1c60 100644 --- a/dspace-api/src/main/java/org/dspace/versioning/VersionHistoryServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/versioning/VersionHistoryServiceImpl.java @@ -109,9 +109,6 @@ public Version getVersion(Context context, VersionHistory versionHistory, Item i throws SQLException { Version v = versioningService.getVersion(context, item); if (v != null) { - ; - } - { if (versionHistory.equals(v.getVersionHistory())) { return v; } diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java index c23fe7831967..3723bae2e32f 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java @@ -170,4 +170,25 @@ public void testVersionDelete() throws Exception { assertThat("Test_version_handle_delete", handleService.resolveToObject(context, handle), nullValue()); context.restoreAuthSystemState(); } + + @Test + public void testGetVersionWithNullPointerException() throws Exception { + context.turnOffAuthorisationSystem(); + + // Create item without version + Community community = communityService.create(null, context); + Collection col = collectionService.create(context, community); + WorkspaceItem is = workspaceItemService.create(context, col, false); + Item itemWithoutVersion = installItemService.installItem(context, is); + + VersionHistory versionHistory = versionHistoryService.findByItem(context, originalItem); + + try { + Version result = versionHistoryService.getVersion(context, versionHistory, itemWithoutVersion); + assertThat("getVersion should return null for item without version", result, nullValue()); + } catch (NullPointerException npe) { + fail("NullPointerException should not be thrown. Method should return null gracefully: " + npe.getMessage()); + } + context.restoreAuthSystemState(); + } } From 9cc2e58d90f749b08cb610a278c9a963a0ec6970 Mon Sep 17 00:00:00 2001 From: Paurikova2 Date: Thu, 11 Dec 2025 13:51:33 +0100 Subject: [PATCH 029/283] fix info message (cherry picked from commit 14d4f4fe9beca9faeb43671e899e24efeb0d4710) --- dspace-api/src/test/java/org/dspace/content/VersioningTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java index 3723bae2e32f..fb971dab79fe 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java @@ -187,7 +187,7 @@ public void testGetVersionWithNullPointerException() throws Exception { Version result = versionHistoryService.getVersion(context, versionHistory, itemWithoutVersion); assertThat("getVersion should return null for item without version", result, nullValue()); } catch (NullPointerException npe) { - fail("NullPointerException should not be thrown. Method should return null gracefully: " + npe.getMessage()); + fail("NullPointerException should not be thrown. Method should return null: " + npe.getMessage()); } context.restoreAuthSystemState(); } From 65d7c61febdec1cbbbeec4556fe0762a4e2d43a5 Mon Sep 17 00:00:00 2001 From: Paurikova2 Date: Thu, 11 Dec 2025 14:11:27 +0100 Subject: [PATCH 030/283] added restoreAuthSystemState to finally block (cherry picked from commit f22766a500553bfc87efe3ec2693a2421d4a6a3e) --- .../src/test/java/org/dspace/content/VersioningTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java index fb971dab79fe..5045412969a4 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java @@ -188,7 +188,8 @@ public void testGetVersionWithNullPointerException() throws Exception { assertThat("getVersion should return null for item without version", result, nullValue()); } catch (NullPointerException npe) { fail("NullPointerException should not be thrown. Method should return null: " + npe.getMessage()); + } finally { + context.restoreAuthSystemState(); } - context.restoreAuthSystemState(); } } From 198f2d6d1e29c5fa4e3c27abc10268eb9cea7bd2 Mon Sep 17 00:00:00 2001 From: Paurikova2 Date: Thu, 11 Dec 2025 15:08:56 +0100 Subject: [PATCH 031/283] removed empty lines because of the trailing whitespace (cherry picked from commit 396e8437f8f8b6347729d29a5b0a5d711f20f565) --- .../src/test/java/org/dspace/content/VersioningTest.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java index 5045412969a4..a0a8b82ec150 100644 --- a/dspace-api/src/test/java/org/dspace/content/VersioningTest.java +++ b/dspace-api/src/test/java/org/dspace/content/VersioningTest.java @@ -174,15 +174,12 @@ public void testVersionDelete() throws Exception { @Test public void testGetVersionWithNullPointerException() throws Exception { context.turnOffAuthorisationSystem(); - // Create item without version Community community = communityService.create(null, context); Collection col = collectionService.create(context, community); WorkspaceItem is = workspaceItemService.create(context, col, false); Item itemWithoutVersion = installItemService.installItem(context, is); - VersionHistory versionHistory = versionHistoryService.findByItem(context, originalItem); - try { Version result = versionHistoryService.getVersion(context, versionHistory, itemWithoutVersion); assertThat("getVersion should return null for item without version", result, nullValue()); From 66b4d01c8618a55922f1bc49337e2eb795ae06f7 Mon Sep 17 00:00:00 2001 From: Marie Verdonck Date: Wed, 11 Feb 2026 21:47:25 +0100 Subject: [PATCH 032/283] Type date browse startsWith functionality - input date as start date, not date filter (#10056) * 121661: [Issue#10055] startsWith on date browse should return items starting from that date, not with that exact year https://github.com/DSpace/DSpace/issues/10055 * 121661: [Issue#10055, PR#10056] Use upperBound year when sorting by startsWith date descending, so a year implies => up to end of year, month implied => up to end of month --- .../java/org/dspace/browse/BrowseDAO.java | 2 + .../java/org/dspace/browse/BrowseEngine.java | 32 +++++-- .../java/org/dspace/browse/SolrBrowseDAO.java | 31 +++++++ .../app/rest/BrowsesResourceControllerIT.java | 85 ++++++++++++++++--- 4 files changed, 131 insertions(+), 19 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java b/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java index 03130e39e78b..26983303a152 100644 --- a/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java +++ b/dspace-api/src/main/java/org/dspace/browse/BrowseDAO.java @@ -396,4 +396,6 @@ public interface BrowseDAO { public void setStartsWith(String startsWith); public String getStartsWith(); + + public void setDateStartsWith(String dateStartsWith); } diff --git a/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java b/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java index be7a34086a46..f7f5f2ff7df7 100644 --- a/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java +++ b/dspace-api/src/main/java/org/dspace/browse/BrowseEngine.java @@ -203,12 +203,8 @@ private BrowseInfo browseByItem(BrowserScope bs) // get the table name that we are going to be getting our data from dao.setTable(browseIndex.getTableName()); - if (scope.getBrowseIndex() != null && OrderFormat.TITLE.equals(scope.getBrowseIndex().getDataType())) { - // For browsing by title, apply the same normalization applied to indexed titles - dao.setStartsWith(normalizeJumpToValue(scope.getStartsWith())); - } else { - dao.setStartsWith(StringUtils.lowerCase(scope.getStartsWith())); - } + // Set startsWith or dateStartsWith params on SolrBrowseDAO + addStartsWithParams(bs); // tell the browse query whether we are ascending or descending on the value dao.setAscending(scope.isAscending()); @@ -367,6 +363,30 @@ private BrowseInfo browseByItem(BrowserScope bs) } } + private void addStartsWithParams(BrowserScope bs) throws BrowseException { + if (StringUtils.isNotBlank(scope.getStartsWith())) { + boolean isDateBrowse = bs.getSortOption().getType().equals("date"); + if (!isDateBrowse) { + if (scope.getBrowseIndex() != null + && OrderFormat.TITLE.equals(scope.getBrowseIndex().getDataType())) { + // For browsing by title, apply the same normalization applied to indexed titles + dao.setStartsWith(normalizeJumpToValue(scope.getStartsWith())); + } else { + dao.setStartsWith(StringUtils.lowerCase(scope.getStartsWith())); + } + // clear the old date starts with + dao.setDateStartsWith(null); + } else { + // For "date" sort browses ({@code webui.itemlist.sort-option.*} config): + // sets a date specific filter where the startsWith query is the start date, + // eg `fq=bi_sort_*_sort:+["1940-02" TO + ]` + dao.setDateStartsWith(scope.getStartsWith().trim()); + // clear the old non date starts with + dao.setStartsWith(null); + } + } + } + /** * Browse the archive by single values (such as the name of an author). This * produces a BrowseInfo object that contains Strings as the results of diff --git a/dspace-api/src/main/java/org/dspace/browse/SolrBrowseDAO.java b/dspace-api/src/main/java/org/dspace/browse/SolrBrowseDAO.java index a0a7725fa13a..32841e6c4b34 100644 --- a/dspace-api/src/main/java/org/dspace/browse/SolrBrowseDAO.java +++ b/dspace-api/src/main/java/org/dspace/browse/SolrBrowseDAO.java @@ -11,6 +11,7 @@ import static org.dspace.discovery.SearchUtils.RESOURCE_TYPE_FIELD; import java.io.Serializable; +import java.time.YearMonth; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -99,6 +100,8 @@ public int compare(Object o1, Object o2) { private String startsWith = null; + private String dateStartsWith = null; + /** * field to look for value in */ @@ -221,10 +224,33 @@ private DiscoverResult getSolrResponse() throws BrowseException { } else if (valuePartial) { query.addFilterQueries("{!field f=" + facetField + "_partial}" + value); } + if (StringUtils.isNotBlank(startsWith) && orderField != null) { query.addFilterQueries( "bi_" + orderField + "_sort:" + ClientUtils.escapeQueryChars(startsWith) + "*"); } + if (StringUtils.isNotBlank(dateStartsWith)) { + if (!ascending) { + String raw = dateStartsWith.trim(); + String upperBound; + if (raw.length() == 4) { // YYYY + upperBound = raw + "-12-31"; + } else if (raw.length() == 7) { // YYYY-MM + YearMonth ym = YearMonth.parse(raw); + upperBound = ym.atEndOfMonth().toString(); + } else { // YYYY-MM-DD + upperBound = raw; + } + query.addFilterQueries("bi_" + orderField + "_sort" + ": [* TO \"" + upperBound + "\"]"); + } else { + query.addFilterQueries("bi_" + orderField + "_sort" + ": [\"" + dateStartsWith + "\" TO *]"); + } + } + if (StringUtils.isNotBlank(startsWith) && StringUtils.isNotBlank(dateStartsWith)) { + log.warn(String.format("dateStartsWith %s and startsWith %s both given, only one should " + + "be given since different type of sort filterquery applied depending on which is not blank", + dateStartsWith, startsWith)); + } // filter on item to be sure to don't include any other object // indexed in the Discovery Search core query.addFilterQueries("search.resourcetype:" + IndexableItem.TYPE); @@ -466,6 +492,11 @@ public int getLimit() { return limit; } + @Override + public void setDateStartsWith(String dateStartsWith) { + this.dateStartsWith = dateStartsWith; + } + /* * (non-Javadoc) * diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java index 6b8113e5afac..0b9e355747b5 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BrowsesResourceControllerIT.java @@ -1883,8 +1883,8 @@ public void testBrowseByItemsStartsWith() throws Exception { // ---- BROWSES BY ITEM ---- //** WHEN ** //An anonymous user browses the items in the Browse by date issued endpoint - //with startsWith set to 199 - getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=199") + //with startsWith set to 1990 + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1990") .param("size", "2")) //** THEN ** @@ -1893,8 +1893,8 @@ public void testBrowseByItemsStartsWith() throws Exception { //We expect the content type to be "application/hal+json;charset=UTF-8" .andExpect(content().contentType(contentType)) - //We expect the totalElements to be the 2 items present in the repository - .andExpect(jsonPath("$.page.totalElements", is(2))) + //We expect the totalElements to be the 5 items from 1990 til now + .andExpect(jsonPath("$.page.totalElements", is(5))) //We expect to jump to page 1 of the index .andExpect(jsonPath("$.page.number", is(0))) .andExpect(jsonPath("$.page.size", is(2))) @@ -2055,8 +2055,8 @@ public void testBrowseByStartsWithAndPage() throws Exception { //** WHEN ** //An anonymous user browses the items in the Browse by date issued endpoint - //with startsWith set to 199 and Page to 1 - getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=199") + //with startsWith set to 1990 and Page to 1 + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1990") .param("size", "1").param("page", "1")) //** THEN ** @@ -2065,17 +2065,76 @@ public void testBrowseByStartsWithAndPage() throws Exception { //We expect the content type to be "application/hal+json;charset=UTF-8" .andExpect(content().contentType(contentType)) - //We expect the totalElements to be the 2 items present in the repository - .andExpect(jsonPath("$.page.totalElements", is(2))) + //We expect the totalElements to be the 5 items present in the repository from 1990 until now + .andExpect(jsonPath("$.page.totalElements", is(5))) //We expect to jump to page 1 of the index .andExpect(jsonPath("$.page.number", is(1))) .andExpect(jsonPath("$.page.size", is(1))) - .andExpect(jsonPath("$._links.self.href", containsString("startsWith=199"))) + .andExpect(jsonPath("$._links.self.href", containsString("startsWith=1990"))) - //Verify that the index jumps to the "Java" item. - .andExpect(jsonPath("$._embedded.items", - contains( - ItemMatcher.matchItemWithTitleAndDateIssued(item3, "Java", "1995-05-23") + //Verify that the returned item is 2nd (page 0 first item, page 1 second item) item from 1990 + // Items: Alan Turing - 1912; Blade Runner - 1982-06-25 || Python - 1990; + // Java - 1995-05-23; Zeta Reticuli - 2018-01-01; Moon - 2018-01-02; T-800 - 2029 + // 2nd since 1990: Java + .andExpect(jsonPath("$._embedded.items", + contains(ItemMatcher.matchItemWithTitleAndDateIssued(item3, + "Java", "1995-05-23") + ))); + + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1990") + .param("size", "2").param("page", "1")) + //Verify that the returned item is 3rd&4th item from 1990 + // Items: Alan Turing - 1912; Blade Runner - 1982-06-25 || Python - 1990; + // Java - 1995-05-23; Zeta Reticuli - 2018-01-01; Moon - 2018-01-02; T-800 - 2029 + // => Zeta Reticuli & Moon + .andExpect(jsonPath("$._embedded.items", + contains(ItemMatcher.matchItemWithTitleAndDateIssued(item7, + "Zeta Reticuli", "2018-01-01"), + ItemMatcher.matchItemWithTitleAndDateIssued(item4, + "Moon", "2018-01-02") + ))); + + // Sort descending + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1990&sort=default,DESC") + .param("size", "2").param("page", "0")) + //Verify that the returned items are from 1990 and below dates + // Items: Alan Turing - 1912; Blade Runner - 1982-06-25 || Python - 1990; + // Java - 1995-05-23; Zeta Reticuli - 2018-01-01; Moon - 2018-01-02; T-800 - 2029 + // => Python & Blade Runner + .andExpect(jsonPath("$._embedded.items", + contains(ItemMatcher.matchItemWithTitleAndDateIssued(item5, + "Python", "1990"), + ItemMatcher.matchItemWithTitleAndDateIssued(item2, + "Blade Runner", "1982-06-25") + ))); + + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1990&sort=default,DESC") + .param("size", "1").param("page", "0")) + //Verify that the returned item is the one closest to 1990 but below its upperBound (1990-12-31) + .andExpect(jsonPath("$._embedded.items", + contains(ItemMatcher.matchItemWithTitleAndDateIssued(item5, + "Python", "1990") + ))); + + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1990&sort=default,DESC") + .param("size", "3").param("page", "0")) + //Verify that the 3 returned items are from 1990 and below dates, + // with closest to upperBound 1990-12-31 as first + .andExpect(jsonPath("$._embedded.items", + contains(ItemMatcher.matchItemWithTitleAndDateIssued(item5, + "Python", "1990"), + ItemMatcher.matchItemWithTitleAndDateIssued(item2, + "Blade Runner", "1982-06-25"), + ItemMatcher.matchItemWithTitleAndDateIssued(item1, + "Alan Turing", "1912-06-23") + ))); + + getClient().perform(get("/api/discover/browses/dateissued/items?startsWith=1982-06&sort=default,DESC") + .param("size", "1").param("page", "0")) + //Verify that the returned item is the one closest to 1982-06 but below its upperBound (1982-06-30) + .andExpect(jsonPath("$._embedded.items", + contains(ItemMatcher.matchItemWithTitleAndDateIssued(item2, + "Blade Runner", "1982-06-25") ))); } From 490f907419a602b47cc151a2e2b225dfcf9ec947 Mon Sep 17 00:00:00 2001 From: Jesiel Viana Date: Mon, 9 Feb 2026 14:52:24 -0300 Subject: [PATCH 033/283] return 404 instead of 401 for deleted bitstreams --- .../java/org/dspace/app/rest/BitstreamRestController.java | 2 +- .../security/AuthorizeServicePermissionEvaluatorPlugin.java | 5 +++++ .../BitstreamMetadataReadPermissionEvaluatorPlugin.java | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java index 1ff9f7520c16..57fc73dfc6fa 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java @@ -110,7 +110,7 @@ public ResponseEntity retrieve(@PathVariable UUID uuid, HttpServletResponse resp Bitstream bit = bitstreamService.find(context, uuid); EPerson currentUser = context.getCurrentUser(); - if (bit == null) { + if (bit == null || bit.isDeleted()) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return null; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/AuthorizeServicePermissionEvaluatorPlugin.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/AuthorizeServicePermissionEvaluatorPlugin.java index f0b44187c596..7e87a1a613e8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/AuthorizeServicePermissionEvaluatorPlugin.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/AuthorizeServicePermissionEvaluatorPlugin.java @@ -13,6 +13,7 @@ import org.dspace.app.rest.utils.ContextUtil; import org.dspace.authorize.service.AuthorizeService; +import org.dspace.content.Bitstream; import org.dspace.content.DSpaceObject; import org.dspace.content.Item; import org.dspace.content.factory.ContentServiceFactory; @@ -86,6 +87,10 @@ public boolean hasDSpacePermission(Authentication authentication, Serializable t return true; } + if (dSpaceObject instanceof Bitstream && ((Bitstream) dSpaceObject).isDeleted()) { + return true; // Let downstream REST layer handle with 404 + } + if (dSpaceObject instanceof Item) { Item item = (Item) dSpaceObject; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/BitstreamMetadataReadPermissionEvaluatorPlugin.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/BitstreamMetadataReadPermissionEvaluatorPlugin.java index b4b08c668b0a..d15412cd201e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/BitstreamMetadataReadPermissionEvaluatorPlugin.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/BitstreamMetadataReadPermissionEvaluatorPlugin.java @@ -73,6 +73,9 @@ public boolean hasPermission(Authentication authentication, Serializable targetI } public boolean metadataReadPermissionOnBitstream(Context context, Bitstream bitstream) throws SQLException { + if (bitstream.isDeleted()) { + return true; // Let downstream REST layer handle with 404 + } if (authorizeService.isAdmin(context, bitstream)) { // Is Admin on bitstream return true; From 6a781f636f1344f246d18886ed76997489ba8cc4 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 13 Feb 2026 09:49:22 -0600 Subject: [PATCH 034/283] Fix broken tests due to random order execution. When CreateMissingIdentifiersIT is run before WorkflowCurationIT, it was causing the latter to fail. (cherry picked from commit 816dfbe473effcdc4b6df210e79d3be6d6c7d3bb) --- .../org/dspace/ctask/general/CreateMissingIdentifiersIT.java | 2 ++ .../test/java/org/dspace/workflow/WorkflowCurationIT.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java index 3b50258a5a23..8ecddc6cd50c 100644 --- a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java +++ b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java @@ -45,6 +45,7 @@ public void testPerform() // Must remove any cached named plugins before creating a new one CoreServiceFactory.getInstance().getPluginService().clearNamedPluginClasses(); // Define a new task dynamically + String[] prevTaskDef = configurationService.getArrayProperty(P_TASK_DEF); configurationService.setProperty(P_TASK_DEF, CreateMissingIdentifiers.class.getCanonicalName() + " = " + TASK_NAME); @@ -82,5 +83,6 @@ public void testPerform() curator.curate(context, item); int status = curator.getStatus(TASK_NAME); assertEquals("Curation should succeed", Curator.CURATE_SUCCESS, status); + configurationService.setProperty(P_TASK_DEF, prevTaskDef); } } diff --git a/dspace-api/src/test/java/org/dspace/workflow/WorkflowCurationIT.java b/dspace-api/src/test/java/org/dspace/workflow/WorkflowCurationIT.java index 66dd2cee807f..dfe61a30b2b2 100644 --- a/dspace-api/src/test/java/org/dspace/workflow/WorkflowCurationIT.java +++ b/dspace-api/src/test/java/org/dspace/workflow/WorkflowCurationIT.java @@ -22,6 +22,7 @@ import org.dspace.content.Community; import org.dspace.content.MetadataValue; import org.dspace.content.service.ItemService; +import org.dspace.core.LegacyPluginServiceImpl; import org.dspace.ctask.testing.MarkerTask; import org.dspace.eperson.EPerson; import org.dspace.util.DSpaceConfigurationInitializer; @@ -29,6 +30,7 @@ import org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem; import org.junit.Test; import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringRunner; @@ -46,6 +48,8 @@ public class WorkflowCurationIT extends AbstractIntegrationTestWithDatabase { @Inject private ItemService itemService; + @Autowired + private LegacyPluginServiceImpl legacyPluginService; /** * Basic smoke test of a curation task attached to a workflow step. @@ -56,6 +60,7 @@ public class WorkflowCurationIT public void curationTest() throws Exception { context.turnOffAuthorisationSystem(); + legacyPluginService.clearNamedPluginClasses(); //** GIVEN ** From fe222ad17679e64aadad73f202a2716319c08950 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Sat, 29 Nov 2025 22:10:34 +0100 Subject: [PATCH 035/283] Update community indexing to include all ancestor communities, not just direct parents --- .../dspace/discovery/indexobject/CommunityIndexFactoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/discovery/indexobject/CommunityIndexFactoryImpl.java b/dspace-api/src/main/java/org/dspace/discovery/indexobject/CommunityIndexFactoryImpl.java index e92819601839..9f4b558cce76 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/indexobject/CommunityIndexFactoryImpl.java +++ b/dspace-api/src/main/java/org/dspace/discovery/indexobject/CommunityIndexFactoryImpl.java @@ -126,7 +126,7 @@ public List getLocations(Context context, IndexableCommunity indexableDS final Community target = indexableDSpaceObject.getIndexedObject(); List locations = new ArrayList<>(); // build list of community ids - List communities = target.getParentCommunities(); + List communities = communityService.getAllParents(context, target); // now put those into strings for (Community community : communities) { From 892d61137419073b63de379fe6804ecc4d95a2e7 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Sat, 29 Nov 2025 22:14:56 +0100 Subject: [PATCH 036/283] Replace separate community/collection admin checks with unified isComColAdmin() call --- .../org/dspace/discovery/SolrServicePrivateItemPlugin.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServicePrivateItemPlugin.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServicePrivateItemPlugin.java index db543141e13d..aab1176d5af5 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServicePrivateItemPlugin.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServicePrivateItemPlugin.java @@ -45,9 +45,8 @@ public void additionalSearchParameters(Context context, DiscoverQuery discoveryQ solrQuery.addFilterQuery("NOT(discoverable:false)"); return; } - if (!authorizeService.isCommunityAdmin(context) && !authorizeService.isCollectionAdmin(context)) { + if (!authorizeService.isComColAdmin(context)) { solrQuery.addFilterQuery("NOT(discoverable:false)"); - } } catch (SQLException ex) { log.error(LogHelper.getHeader(context, "Error looking up authorization rights of current user", From 7427e4c1de2ae8f4cfb2f988f670b9b92a5b9b09 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Sat, 29 Nov 2025 22:26:09 +0100 Subject: [PATCH 037/283] Refactor permission indexing to store only direct object permissions and update Solr filter query logic to resolve inherited permissions via the location ancestor field; add authorization-based endpoints for Item, Collection, and Community. --- .../authorize/AuthorizeServiceImpl.java | 146 +++++++++------ .../authorize/service/AuthorizeService.java | 58 +++++- .../dspace/content/CollectionServiceImpl.java | 34 +--- .../org/dspace/content/ItemServiceImpl.java | 28 ++- .../content/service/CollectionService.java | 21 ++- .../dspace/content/service/ItemService.java | 10 +- .../org/dspace/discovery/DiscoverQuery.java | 59 +++++++ .../org/dspace/discovery/SearchService.java | 2 + .../org/dspace/discovery/SolrServiceImpl.java | 52 ++++++ .../SolrServiceResourceRestrictionPlugin.java | 166 +++++++++++------- .../dspace/content/service/ItemServiceIT.java | 20 +-- .../authorization/impl/EditItemFeature.java | 2 +- .../authorization/impl/SubmitFeature.java | 2 +- .../repository/CollectionRestRepository.java | 39 ++-- .../repository/CommunityRestRepository.java | 24 ++- .../rest/repository/ItemRestRepository.java | 24 +++ dspace/config/spring/api/discovery.xml | 2 - 17 files changed, 485 insertions(+), 204 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java index 7198e28d03b9..202d5d42aa07 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java @@ -729,15 +729,15 @@ public List getPoliciesActionFilterExceptRpType(Context c, DSpac /** * Checks that the context's current user is a community admin in the site by querying the solr database. + * This query doesn't use authorization inheritance because direct community admin is enough to perform this check. * * @param context context with the current user * @return true if the current user is a community admin in the site * false when this is not the case, or an exception occurred - * @throws java.sql.SQLException passed through. */ @Override - public boolean isCommunityAdmin(Context context) throws SQLException { - return performCheck(context, RESOURCE_TYPE_FIELD + ":" + IndexableCommunity.TYPE); + public boolean isCommunityAdmin(Context context) { + return performCheck(context, RESOURCE_TYPE_FIELD + ":" + IndexableCommunity.TYPE, false); } /** @@ -746,11 +746,10 @@ public boolean isCommunityAdmin(Context context) throws SQLException { * @param context context with the current user * @return true if the current user is a collection admin in the site * false when this is not the case, or an exception occurred - * @throws java.sql.SQLException passed through. */ @Override - public boolean isCollectionAdmin(Context context) throws SQLException { - return performCheck(context, RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE); + public boolean isCollectionAdmin(Context context) { + return performCheck(context, RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE, true); } /** @@ -759,26 +758,26 @@ public boolean isCollectionAdmin(Context context) throws SQLException { * @param context context with the current user * @return true if the current user is an item admin in the site * false when this is not the case, or an exception occurred - * @throws java.sql.SQLException passed through. */ @Override - public boolean isItemAdmin(Context context) throws SQLException { - return performCheck(context, RESOURCE_TYPE_FIELD + ":" + IndexableItem.TYPE); + public boolean isItemAdmin(Context context) { + return performCheck(context, RESOURCE_TYPE_FIELD + ":" + IndexableItem.TYPE, true); } /** * Checks that the context's current user is a community or collection admin in the site. + * This query doesn't use authorization inheritance because direct community/collection admin is enough to + * perform this check. * * @param context context with the current user * @return true if the current user is a community or collection admin in the site * false when this is not the case, or an exception occurred - * @throws java.sql.SQLException passed through. */ @Override - public boolean isComColAdmin(Context context) throws SQLException { + public boolean isComColAdmin(Context context) { return performCheck(context, "(" + RESOURCE_TYPE_FIELD + ":" + IndexableCommunity.TYPE + " OR " + - RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE + ")"); + RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE + ")", false); } /** @@ -793,11 +792,29 @@ public boolean isComColAdmin(Context context) throws SQLException { */ @Override public List findAdminAuthorizedCommunity(Context context, String query, int offset, int limit) - throws SearchServiceException, SQLException { + throws SearchServiceException { + return findAuthorizedCommunityByAction(context, query, Constants.ADMIN, offset, limit); + } + + /** + * Finds communities for which the logged in user has the rights specified by the action parameter. + * + * @param context the context whose user is checked against + * @param query the optional extra query + * @param action the action to check for + * @param offset the offset for pagination + * @param limit the amount of dso's to return + * @return a list of communities for which the logged in user has the rights specified by the action + * @throws SearchServiceException + */ + @Override + public List findAuthorizedCommunityByAction(Context context, String query, int action, int offset, + int limit) + throws SearchServiceException { List communities = new ArrayList<>(); query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + - IndexableCommunity.TYPE, + IndexableCommunity.TYPE, action, true, offset, limit, null, null); for (IndexableObject solrCollections : discoverResult.getIndexableObjects()) { Community community = ((IndexableCommunity) solrCollections).getIndexedObject(); @@ -816,10 +833,25 @@ public List findAdminAuthorizedCommunity(Context context, String quer */ @Override public long countAdminAuthorizedCommunity(Context context, String query) - throws SearchServiceException, SQLException { + throws SearchServiceException { + return countAuthorizedCommunityByAction(context, query, Constants.ADMIN); + } + + /** + * Counts communities for which the current user has the rights specified by the action parameter. + * + * @param context context with the current user + * @param query the query for which to filter the results more + * @param action the action to check for + * @return the matching communities + * @throws SearchServiceException + */ + @Override + public long countAuthorizedCommunityByAction(Context context, String query, int action) + throws SearchServiceException { query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + - IndexableCommunity.TYPE, + IndexableCommunity.TYPE, action, true, null, 0, null, null); return discoverResult.getTotalSearchResults(); } @@ -836,7 +868,25 @@ public long countAdminAuthorizedCommunity(Context context, String query) */ @Override public List findAdminAuthorizedCollection(Context context, String query, int offset, int limit) - throws SearchServiceException, SQLException { + throws SearchServiceException { + return findAuthorizedCollectionByAction(context, query, Constants.ADMIN, offset, limit); + } + + /** + * Finds collections for which the logged in user has the rights specified by the action parameter. + * + * @param context the context whose user is checked against + * @param query the optional extra query + * @param action the action to check for + * @param offset the offset for pagination + * @param limit the amount of dso's to return + * @return a list of collections for which the logged in user has the rights specified by the action + * @throws SearchServiceException + */ + @Override + public List findAuthorizedCollectionByAction(Context context, String query, + int action, int offset, int limit) + throws SearchServiceException { List collections = new ArrayList<>(); if (context.getCurrentUser() == null) { return collections; @@ -844,7 +894,7 @@ public List findAdminAuthorizedCollection(Context context, String qu query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + - IndexableCollection.TYPE, + IndexableCollection.TYPE, action, true, offset, limit, CollectionService.SOLR_SORT_FIELD, SORT_ORDER.asc); for (IndexableObject solrCollections : discoverResult.getIndexableObjects()) { Collection collection = ((IndexableCollection) solrCollections).getIndexedObject(); @@ -863,31 +913,43 @@ public List findAdminAuthorizedCollection(Context context, String qu */ @Override public long countAdminAuthorizedCollection(Context context, String query) - throws SearchServiceException, SQLException { + throws SearchServiceException { + return countAuthorizedCollectionByAction(context, query, Constants.ADMIN); + } + + /** + * Counts collections for which the current user has the rights specified by the action parameter. + * + * @param context context with the current user + * @param query the query for which to filter the results more + * @param action the action to check for + * @return the matching collections + * @throws SearchServiceException + */ + @Override + public long countAuthorizedCollectionByAction(Context context, String query, int action) + throws SearchServiceException { query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + - IndexableCollection.TYPE, - null, 0, null, null); + IndexableCollection.TYPE, action, + true, null, 0, null, null); return discoverResult.getTotalSearchResults(); } @Override public boolean isAccountManager(Context context) { - try { - return (canCommunityAdminManageAccounts() && isCommunityAdmin(context) - || canCollectionAdminManageAccounts() && isCollectionAdmin(context)); - } catch (SQLException e) { - throw new RuntimeException(e); - } + return (canCommunityAdminManageAccounts() && isCommunityAdmin(context) + || canCollectionAdminManageAccounts() && isCollectionAdmin(context)); } - private boolean performCheck(Context context, String query) throws SQLException { + private boolean performCheck(Context context, String query, boolean inheritAuthorizations) { if (context.getCurrentUser() == null) { return false; } try { - DiscoverResult discoverResult = getDiscoverResult(context, query, null, null, null, null); + DiscoverResult discoverResult = getDiscoverResult(context, query, Constants.ADMIN, inheritAuthorizations, + null, 0, null, null); if (discoverResult.getTotalSearchResults() > 0) { return true; } @@ -899,16 +961,11 @@ private boolean performCheck(Context context, String query) throws SQLException return false; } - private DiscoverResult getDiscoverResult(Context context, String query, Integer offset, Integer limit, - String sortField, SORT_ORDER sortOrder) - throws SearchServiceException, SQLException { - String groupQuery = getGroupToQuery(groupService.allMemberGroups(context, context.getCurrentUser())); + private DiscoverResult getDiscoverResult(Context context, String query, int action, boolean inheritAuthorizations, + Integer offset, Integer limit, String sortField, SORT_ORDER sortOrder) + throws SearchServiceException { DiscoverQuery discoverQuery = new DiscoverQuery(); - if (!this.isAdmin(context)) { - query = query + " AND (" + - "admin:e" + context.getCurrentUser().getID() + groupQuery + ")"; - } discoverQuery.setQuery(query); if (offset != null) { discoverQuery.setStart(offset); @@ -919,23 +976,12 @@ private DiscoverResult getDiscoverResult(Context context, String query, Integer if (sortField != null && sortOrder != null) { discoverQuery.setSortField(sortField, sortOrder); } + discoverQuery.addRequiredAuthorization(action); + discoverQuery.setInheritAuthorizations(inheritAuthorizations); return searchService.search(context, discoverQuery); } - private String getGroupToQuery(List groups) { - StringBuilder groupQuery = new StringBuilder(); - - if (groups != null) { - for (Group group: groups) { - groupQuery.append(" OR admin:g"); - groupQuery.append(group.getID()); - } - } - - return groupQuery.toString(); - } - private String formatCustomQuery(String query) { if (StringUtils.isBlank(query)) { return ""; diff --git a/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java b/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java index e0a94833d76c..12fae93c3e50 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java +++ b/dspace-api/src/main/java/org/dspace/authorize/service/AuthorizeService.java @@ -546,6 +546,20 @@ void switchPoliciesAction(Context context, DSpaceObject dso, int fromAction, int List findAdminAuthorizedCommunity(Context context, String query, int offset, int limit) throws SearchServiceException, SQLException; + /** + * Finds communities for which the logged in user has the rights specified by the action parameter. + * + * @param context the context whose user is checked against + * @param query the optional extra query + * @param action the action to check for + * @param offset the offset for pagination + * @param limit the amount of dso's to return + * @return a list of communities for which the logged in user has the rights specified by the action + * @throws SearchServiceException + */ + List findAuthorizedCommunityByAction(Context context, String query, int action, int offset, int limit) + throws SearchServiceException, SQLException; + /** * Counts communities for which the current user is admin, AND which match the query. * @@ -558,6 +572,18 @@ List findAdminAuthorizedCommunity(Context context, String query, int long countAdminAuthorizedCommunity(Context context, String query) throws SearchServiceException, SQLException; + /** + * Counts communities for which the current user has the rights specified by the action parameter. + * + * @param context context with the current user + * @param query the query for which to filter the results more + * @param action the action to check for + * @return the matching communities + * @throws SearchServiceException + */ + long countAuthorizedCommunityByAction(Context context, String query, int action) + throws SearchServiceException; + /** * Finds collections for which the current user is admin, AND which match the query. * @@ -567,10 +593,24 @@ long countAdminAuthorizedCommunity(Context context, String query) * @param limit used for pagination of the results * @return the matching collections * @throws SearchServiceException - * @throws SQLException */ List findAdminAuthorizedCollection(Context context, String query, int offset, int limit) - throws SearchServiceException, SQLException; + throws SearchServiceException; + + /** + * Finds collections for which the current user has the rights specified by the action parameter. + * + * @param context context with the current user + * @param query the query for which to filter the results more + * @param action the action to check for + * @param offset used for pagination of the results + * @param limit used for pagination of the results + * @return the matching collections + * @throws SearchServiceException + */ + List findAuthorizedCollectionByAction(Context context, String query, int action, int offset, + int limit) + throws SearchServiceException; /** * Counts collections for which the current user is admin, AND which match the query. @@ -582,7 +622,19 @@ List findAdminAuthorizedCollection(Context context, String query, in * @throws SQLException */ long countAdminAuthorizedCollection(Context context, String query) - throws SearchServiceException, SQLException; + throws SearchServiceException; + + /** + * Counts collections for which the current user has the rights specified by the action parameter. + * + * @param context context with the current user + * @param query the query for which to filter the results more + * @param action the action to check for + * @return the number of matching collections + * @throws SearchServiceException + */ + long countAuthorizedCollectionByAction(Context context, String query, int action) + throws SearchServiceException; /** * Returns true if the current user can manage accounts. diff --git a/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java index beef87582ea2..a22f2accceae 100644 --- a/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java @@ -1033,7 +1033,7 @@ public String getDefaultReadGroupName(Collection collection, String typeOfGroupS @Override public List findCollectionsWithSubmit(String q, Context context, Community community, - int offset, int limit) throws SQLException, SearchServiceException { + int offset, int limit) throws SearchServiceException { List collections = new ArrayList<>(); DiscoverQuery discoverQuery = new DiscoverQuery(); @@ -1050,8 +1050,8 @@ public List findCollectionsWithSubmit(String q, Context context, Com } @Override - public int countCollectionsWithSubmit(String q, Context context, Community community) - throws SQLException, SearchServiceException { + public int countCollectionsWithSubmit(Context context, String q, Community community) + throws SearchServiceException { DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setMaxResults(0); @@ -1073,29 +1073,12 @@ public int countCollectionsWithSubmit(String q, Context context, Community commu * terms. The terms are used to make also a prefix query on SOLR * so it can be used to implement an autosuggest feature over the collection name * @return discovery search result objects - * @throws SQLException if something goes wrong * @throws SearchServiceException if search error */ private DiscoverResult retrieveCollectionsWithSubmit(Context context, DiscoverQuery discoverQuery, String entityType, Community community, String q) - throws SQLException, SearchServiceException { - - StringBuilder query = new StringBuilder(); - EPerson currentUser = context.getCurrentUser(); - if (!authorizeService.isAdmin(context)) { - String userId = ""; - if (currentUser != null) { - userId = currentUser.getID().toString(); - } - query.append("submit:(e").append(userId); + throws SearchServiceException { - Set groups = groupService.allMemberGroupsSet(context, currentUser); - for (Group group : groups) { - query.append(" OR g").append(group.getID()); - } - query.append(")"); - discoverQuery.addFilterQueries(query.toString()); - } if (Objects.nonNull(community)) { discoverQuery.addFilterQueries("location.comm:" + community.getID().toString()); } @@ -1109,13 +1092,14 @@ private DiscoverResult retrieveCollectionsWithSubmit(Context context, DiscoverQu .append(escapedQuery).append("*").append(")"); discoverQuery.setQuery(buildQuery.toString()); } + discoverQuery.addRequiredAuthorization(Constants.ADD); DiscoverResult resp = searchService.search(context, discoverQuery); return resp; } @Override - public List findCollectionsWithSubmit(String q, Context context, Community community, String entityType, - int offset, int limit) throws SQLException, SearchServiceException { + public List findCollectionsWithSubmit(Context context, String q, Community community, String entityType, + int offset, int limit) throws SearchServiceException { List collections = new ArrayList<>(); DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE); @@ -1132,8 +1116,8 @@ public List findCollectionsWithSubmit(String q, Context context, Com } @Override - public int countCollectionsWithSubmit(String q, Context context, Community community, String entityType) - throws SQLException, SearchServiceException { + public int countCollectionsWithSubmit(Context context, String q, Community community, String entityType) + throws SearchServiceException { DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setMaxResults(0); discoverQuery.setDSpaceObjectFilter(IndexableCollection.TYPE); diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java index 744666baff91..825b452d425a 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java @@ -22,7 +22,6 @@ import java.util.UUID; import java.util.function.Supplier; import java.util.stream.Collectors; -import java.util.stream.Stream; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -1254,43 +1253,38 @@ public boolean canEdit(Context context, Item item) throws SQLException { * * @param context DSpace context * @param discoverQuery + * @param q query string * @return discovery search result objects - * @throws SQLException if something goes wrong * @throws SearchServiceException if search error */ - private DiscoverResult retrieveItemsWithEdit(Context context, DiscoverQuery discoverQuery) - throws SQLException, SearchServiceException { - EPerson currentUser = context.getCurrentUser(); - if (!authorizeService.isAdmin(context)) { - String userId = currentUser != null ? "e" + currentUser.getID().toString() : "e"; - Stream groupIds = groupService.allMemberGroupsSet(context, currentUser).stream() - .map(group -> "g" + group.getID()); - String query = Stream.concat(Stream.of(userId), groupIds) - .collect(Collectors.joining(" OR ", "edit:(", ")")); - discoverQuery.addFilterQueries(query); + private DiscoverResult retrieveItemsWithEdit(Context context, DiscoverQuery discoverQuery, String q) + throws SearchServiceException { + if (StringUtils.isNotBlank(q)) { + discoverQuery.setQuery(q); } + discoverQuery.addRequiredAuthorization(Constants.WRITE); return searchService.search(context, discoverQuery); } @Override - public List findItemsWithEdit(Context context, int offset, int limit) - throws SQLException, SearchServiceException { + public List findItemsWithEdit(Context context, String q, int offset, int limit) + throws SearchServiceException { DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setDSpaceObjectFilter(IndexableItem.TYPE); discoverQuery.setStart(offset); discoverQuery.setMaxResults(limit); - DiscoverResult resp = retrieveItemsWithEdit(context, discoverQuery); + DiscoverResult resp = retrieveItemsWithEdit(context, discoverQuery, q); return resp.getIndexableObjects().stream() .map(solrItems -> ((IndexableItem) solrItems).getIndexedObject()) .collect(Collectors.toList()); } @Override - public int countItemsWithEdit(Context context) throws SQLException, SearchServiceException { + public int countItemsWithEdit(Context context, String q) throws SearchServiceException { DiscoverQuery discoverQuery = new DiscoverQuery(); discoverQuery.setMaxResults(0); discoverQuery.setDSpaceObjectFilter(IndexableItem.TYPE); - DiscoverResult resp = retrieveItemsWithEdit(context, discoverQuery); + DiscoverResult resp = retrieveItemsWithEdit(context, discoverQuery, q); return (int) resp.getTotalSearchResults(); } diff --git a/dspace-api/src/main/java/org/dspace/content/service/CollectionService.java b/dspace-api/src/main/java/org/dspace/content/service/CollectionService.java index 5e55c725691d..80ca415ef22d 100644 --- a/dspace-api/src/main/java/org/dspace/content/service/CollectionService.java +++ b/dspace-api/src/main/java/org/dspace/content/service/CollectionService.java @@ -391,11 +391,11 @@ Group createDefaultReadGroup(Context context, Collection collection, String type * NOTE: for better performance, this method retrieves its results from an * index (cache) and does not query the database directly. * This means that results may be stale or outdated until https://github.com/DSpace/DSpace/issues/2853 is resolved" - * + * + * @param context DSpace Context * @param q limit the returned collection to those with metadata values matching the query terms. * The terms are used to make also a prefix query on SOLR so it can be used to implement * an autosuggest feature over the collection name - * @param context DSpace Context * @param community parent community * @param entityType limit the returned collection to those related to given entity type * @param offset the position of the first result to return @@ -404,7 +404,7 @@ Group createDefaultReadGroup(Context context, Collection collection, String type * @throws SQLException if something goes wrong * @throws SearchServiceException if search error */ - public List findCollectionsWithSubmit(String q, Context context, Community community, + public List findCollectionsWithSubmit(Context context, String q, Community community, String entityType, int offset, int limit) throws SQLException, SearchServiceException; /** @@ -422,11 +422,10 @@ public List findCollectionsWithSubmit(String q, Context context, Com * @param offset the position of the first result to return * @param limit paging limit * @return discovery search result objects - * @throws SQLException if something goes wrong * @throws SearchServiceException if search error */ public List findCollectionsWithSubmit(String q, Context context, Community community, - int offset, int limit) throws SQLException, SearchServiceException; + int offset, int limit) throws SearchServiceException; /** * Counts the number of Collection for which the current user has 'submit' privileges. @@ -434,17 +433,17 @@ public List findCollectionsWithSubmit(String q, Context context, Com * and does not query the database directly. * This means that results may be stale or outdated until * https://github.com/DSpace/DSpace/issues/2853 is resolved." - * + * + * @param context DSpace Context * @param q limit the returned collection to those with metadata values matching the query terms. * The terms are used to make also a prefix query on SOLR so it can be used to implement * an autosuggest feature over the collection name - * @param context DSpace Context * @param community parent community * @return total collections found * @throws SQLException if something goes wrong * @throws SearchServiceException if search error */ - public int countCollectionsWithSubmit(String q, Context context, Community community) + public int countCollectionsWithSubmit(Context context, String q, Community community) throws SQLException, SearchServiceException; /** @@ -453,18 +452,18 @@ public int countCollectionsWithSubmit(String q, Context context, Community commu * and does not query the database directly. * This means that results may be stale or outdated until * https://github.com/DSpace/DSpace/issues/2853 is resolved." - * + * + * @param context DSpace Context * @param q limit the returned collection to those with metadata values matching the query terms. * The terms are used to make also a prefix query on SOLR so it can be used to implement * an autosuggest feature over the collection name - * @param context DSpace Context * @param community parent community * @param entityType limit the returned collection to those related to given entity type * @return total collections found * @throws SQLException if something goes wrong * @throws SearchServiceException if search error */ - public int countCollectionsWithSubmit(String q, Context context, Community community, String entityType) + public int countCollectionsWithSubmit(Context context, String q, Community community, String entityType) throws SQLException, SearchServiceException; /** diff --git a/dspace-api/src/main/java/org/dspace/content/service/ItemService.java b/dspace-api/src/main/java/org/dspace/content/service/ItemService.java index a307e7ceffad..35c01e74ade9 100644 --- a/dspace-api/src/main/java/org/dspace/content/service/ItemService.java +++ b/dspace-api/src/main/java/org/dspace/content/service/ItemService.java @@ -889,23 +889,23 @@ public Iterator findByLastModifiedSince(Context context, Date last) /** * finds all items for which the current user has editing rights * @param context DSpace context object + * @param q search query * @param offset page offset * @param limit page size limit * @return list of items for which the current user has editing rights - * @throws SQLException * @throws SearchServiceException */ - public List findItemsWithEdit(Context context, int offset, int limit) - throws SQLException, SearchServiceException; + List findItemsWithEdit(Context context, String q, int offset, int limit) + throws SearchServiceException; /** * counts all items for which the current user has editing rights * @param context DSpace context object + * @param q search query * @return list of items for which the current user has editing rights - * @throws SQLException * @throws SearchServiceException */ - public int countItemsWithEdit(Context context) throws SQLException, SearchServiceException; + int countItemsWithEdit(Context context, String q) throws SearchServiceException; /** * Check if the supplied item is an inprogress submission diff --git a/dspace-api/src/main/java/org/dspace/discovery/DiscoverQuery.java b/dspace-api/src/main/java/org/dspace/discovery/DiscoverQuery.java index e133ad0ed170..185c768a057b 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/DiscoverQuery.java +++ b/dspace-api/src/main/java/org/dspace/discovery/DiscoverQuery.java @@ -72,6 +72,14 @@ public enum SORT_ORDER { private String discoveryConfigurationName; + /** + * The required authorizations user should have for the objects returned by the query. + * The READ authorization (Constants.READ) is always required and does not need to be added here. + */ + private List requiredAuthorization; + + private boolean inheritAuthorizations = true; + public DiscoverQuery() { //Initialize all our lists this.filterQueries = new ArrayList<>(); @@ -83,6 +91,7 @@ public DiscoverQuery() { this.hitHighlighting = new HashMap<>(); //Use a linked hashmap since sometimes insertion order might matter this.properties = new LinkedHashMap<>(); + this.requiredAuthorization = new ArrayList<>(); } @@ -411,4 +420,54 @@ public String getDiscoveryConfigurationName() { public void setDiscoveryConfigurationName(String discoveryConfigurationName) { this.discoveryConfigurationName = discoveryConfigurationName; } + + /** + * Return the required authorization user should have for the objects returned by this query + * + * @return the required authorizations + */ + public List getRequiredAuthorizations() { + return requiredAuthorization; + } + + /** + * Add a required authorization user should have for the objects returned by this query. + * The READ authorization (Constants.READ) is always required and does not need to be added here. + * + * @param action + * the required action + */ + public void addRequiredAuthorization(int action) { + this.requiredAuthorization.add(action); + } + + /** + * Remove a required authorization user should have for the objects returned by this query + * + * @param authorizationAction + * the required action + */ + public void removeRequiredAuthorization(int authorizationAction) { + this.requiredAuthorization.removeIf(action -> action == authorizationAction); + } + + /** + * Return whether authorizations should be inherited from parent objects + * + * @return true if authorizations should be inherited, false otherwise + */ + public boolean isInheritAuthorizationsEnabled() { + return inheritAuthorizations; + } + + /** + * Set whether authorizations should be inherited from parent objects + * + * @param inheritAuthorizations + * true if authorizations should be inherited, false otherwise + */ + public void setInheritAuthorizations(boolean inheritAuthorizations) { + this.inheritAuthorizations = inheritAuthorizations; + } + } diff --git a/dspace-api/src/main/java/org/dspace/discovery/SearchService.java b/dspace-api/src/main/java/org/dspace/discovery/SearchService.java index cb945648e7cd..7f4c85c3a864 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SearchService.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SearchService.java @@ -90,6 +90,8 @@ DiscoverFilterQuery toFilterQuery(Context context, String field, String operator List getRelatedItems(Context context, Item item, DiscoveryMoreLikeThisConfiguration moreLikeThisConfiguration); + String createLocationQueryForAdministrableDSOs(String epersonAndGroupClause); + /** * Method to create a Query that includes all * communities and collections a user may administrate. diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java index b832921ad87e..acfd37ef5e62 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java @@ -597,6 +597,58 @@ protected boolean requiresIndexing(String uniqueId, Date lastModified) return reindexItem || !inIndex; } + /** + * Retrieves from Solr the list of administrable communities and collections for the + * current user based on a clause containing the e-person and group IDs. + * Builds and returns the "location" query part for these DSO's. + * + * @param epersonAndGroupClause A Solr filter clause containing one or more IDs combined with OR, + * e.g. {@code "eUUIDe1 OR gUUIDg2 OR gUUIDg3 OR ..."}. + * + * @return An empty string if no administrable DSO exists, or a string in the form + * {@code "location:(mUUID1 OR lUUID2 ... )"} when there are administrable DSO's. + */ + @Override + public String createLocationQueryForAdministrableDSOs(String epersonAndGroupClause) { + StringBuilder locationQuery = new StringBuilder(); + try { + + SolrQuery solrQuery = new SolrQuery(); + + String query = "*:*"; + solrQuery.setQuery(query); + solrQuery.addField(SearchUtils.RESOURCE_ID_FIELD); + solrQuery.addField(SearchUtils.RESOURCE_TYPE_FIELD); + solrQuery.addFilterQuery("(" + SearchUtils.RESOURCE_TYPE_FIELD + ":" + IndexableCommunity.TYPE + " OR " + + SearchUtils.RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE + ")"); + solrQuery.addFilterQuery("admin:(" + epersonAndGroupClause + ")"); + solrQuery.setRows(Integer.MAX_VALUE); + + QueryResponse solrQueryResponse = solrSearchCore.getSolr().query(solrQuery, + solrSearchCore.REQUEST_METHOD); + if (solrQueryResponse != null) { + List containerUUIDs = new ArrayList<>(); + for (SolrDocument doc : solrQueryResponse.getResults()) { + String type = (String) doc.getFieldValue(SearchUtils.RESOURCE_TYPE_FIELD); + String uniqueID = (String) doc.getFieldValue(SearchUtils.RESOURCE_ID_FIELD); + if (IndexableCommunity.TYPE.equals(type)) { + containerUUIDs.add("m" + uniqueID); + } else if (IndexableCollection.TYPE.equals(type)) { + containerUUIDs.add("l" + uniqueID); + } + } + if (!containerUUIDs.isEmpty()) { + locationQuery.append("location:("); + locationQuery.append(String.join(" OR ", containerUUIDs)); + return locationQuery.append(")").toString(); + } + } + } catch (Exception e) { + log.error("Failed to retrieve administrable communities and collections from Solr:", e); + } + return ""; + } + @Override public String createLocationQueryForAdministrableItems(Context context) throws SQLException { diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceResourceRestrictionPlugin.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceResourceRestrictionPlugin.java index d19616a85e10..db5b03e24a36 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceResourceRestrictionPlugin.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceResourceRestrictionPlugin.java @@ -18,12 +18,8 @@ import org.dspace.authorize.ResourcePolicy; import org.dspace.authorize.service.AuthorizeService; import org.dspace.authorize.service.ResourcePolicyService; -import org.dspace.content.Collection; -import org.dspace.content.Community; import org.dspace.content.DSpaceObject; import org.dspace.content.InProgressSubmission; -import org.dspace.content.Item; -import org.dspace.content.factory.ContentServiceFactory; import org.dspace.content.service.CollectionService; import org.dspace.content.service.CommunityService; import org.dspace.core.Constants; @@ -36,14 +32,14 @@ import org.dspace.eperson.EPerson; import org.dspace.eperson.Group; import org.dspace.eperson.service.GroupService; -import org.dspace.services.factory.DSpaceServicesFactory; import org.dspace.xmlworkflow.storedcomponents.ClaimedTask; import org.dspace.xmlworkflow.storedcomponents.PoolTask; import org.springframework.beans.factory.annotation.Autowired; /** * Restriction plugin that ensures that indexes all the resource policies. - * When a search is performed extra filter queries are added to retrieve only results to which the user has READ access + * When a search is performed extra filter queries are added to retrieve only results to which the user has the + * required authorization. * * @author Kevin Van de Velde (kevin at atmire dot com) * @author Mark Diggory (markd at atmire dot com) @@ -64,6 +60,8 @@ public class SolrServiceResourceRestrictionPlugin implements SolrServiceIndexPlu protected GroupService groupService; @Autowired(required = true) protected ResourcePolicyService resourcePolicyService; + @Autowired + protected SearchService searchService; @Override public void additionalIndex(Context context, IndexableObject idxObj, SolrInputDocument document) { @@ -83,50 +81,32 @@ public void additionalIndex(Context context, IndexableObject idxObj, SolrInputDo } if (dso != null) { try { - List policies = authorizeService.getPoliciesActionFilter(context, dso, Constants.READ); - for (ResourcePolicy resourcePolicy : policies) { - if (resourcePolicyService.isDateValid(resourcePolicy)) { - String fieldValue; - if (resourcePolicy.getGroup() != null) { - //We have a group add it to the value - fieldValue = "g" + resourcePolicy.getGroup().getID(); - } else { - //We have an eperson add it to the value - fieldValue = "e" + resourcePolicy.getEPerson().getID(); - - } - - document.addField("read", fieldValue); - } - - //remove the policy from the cache to save memory - context.uncacheEntity(resourcePolicy); - } - // also index ADMIN policies as ADMIN permissions provides READ access - // going up through the hierarchy for communities, collections and items - while (dso != null) { - if (dso instanceof Community || dso instanceof Collection || dso instanceof Item) { - List policiesAdmin = authorizeService - .getPoliciesActionFilter(context, dso, Constants.ADMIN); - for (ResourcePolicy resourcePolicy : policiesAdmin) { - if (resourcePolicyService.isDateValid(resourcePolicy)) { - String fieldValue; - if (resourcePolicy.getGroup() != null) { - // We have a group add it to the value - fieldValue = "g" + resourcePolicy.getGroup().getID(); - } else { - // We have an eperson add it to the value - fieldValue = "e" + resourcePolicy.getEPerson().getID(); - } - document.addField("read", fieldValue); - document.addField("admin", fieldValue); + // Index read, submit, edit and admin permissions + int[] actionsToIndex = new int[] { Constants.READ, Constants.WRITE, Constants.ADD, Constants.ADMIN }; + + for (int action : actionsToIndex) { + String indexedActionName = getIndexedActionName(action); + List policies = authorizeService.getPoliciesActionFilter(context, dso, action); + for (ResourcePolicy resourcePolicy : policies) { + if (resourcePolicyService.isDateValid(resourcePolicy)) { + String fieldValue; + // Avoid NPE in cases where the policy does not have group or eperson + if (resourcePolicy.getGroup() == null && resourcePolicy.getEPerson() == null) { + continue; } - - // remove the policy from the cache to save memory - context.uncacheEntity(resourcePolicy); + if (resourcePolicy.getGroup() != null) { + //We have a group add it to the value + fieldValue = "g" + resourcePolicy.getGroup().getID(); + } else { + //We have an eperson add it to the value + fieldValue = "e" + resourcePolicy.getEPerson().getID(); + } + document.addField(indexedActionName, fieldValue); } + + //remove the policy from the cache to save memory + context.uncacheEntity(resourcePolicy); } - dso = ContentServiceFactory.getInstance().getDSpaceObjectService(dso).getParentObject(context, dso); } } catch (SQLException e) { log.error(LogHelper.getHeader(context, "Error while indexing resource policies", @@ -140,36 +120,66 @@ public void additionalIndex(Context context, IndexableObject idxObj, SolrInputDo public void additionalSearchParameters(Context context, DiscoverQuery discoveryQuery, SolrQuery solrQuery) { try { if (!authorizeService.isAdmin(context)) { - StringBuilder resourceQuery = new StringBuilder(); - //Always add the anonymous group id to the query - Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS); - String anonGroupId = ""; - if (anonymousGroup != null) { - anonGroupId = anonymousGroup.getID().toString(); - } - resourceQuery.append("read:(g" + anonGroupId); + EPerson currentUser = context.getCurrentUser(); + StringBuilder epersonAndGroupClause = new StringBuilder(); if (currentUser != null) { - resourceQuery.append(" OR e").append(currentUser.getID()); + epersonAndGroupClause.append("e").append(currentUser.getID()); } - //Retrieve all the groups the current user is a member of ! Set groups = groupService.allMemberGroupsSet(context, currentUser); for (Group group : groups) { - resourceQuery.append(" OR g").append(group.getID()); + if (epersonAndGroupClause.length() > 0) { + epersonAndGroupClause.append(" OR g").append(group.getID()); + } else { + epersonAndGroupClause.append("g").append(group.getID()); + } } - resourceQuery.append(")"); + StringBuilder resourceQuery = new StringBuilder(); - String locations = DSpaceServicesFactory.getInstance() - .getServiceManager() - .getServiceByName(SearchService.class.getName(), - SearchService.class) - .createLocationQueryForAdministrableItems(context); + List actions = discoveryQuery.getRequiredAuthorizations(); + /* + * The `actions` list specifies the permissions required beyond the default "read" permission. + * It should not include "read" because checking for "read" is always implicit. + * + * The query is constructed as follows: + * - If no actions are provided, it checks only for "read" or "admin" permissions. + * - If "admin" is in the `actions` list, it checks only for admin permissions. + * - Otherwise, it checks for both "read" and the other specified actions. + * + * The resulting query follows this structure: (read AND action) OR admin. + */ + if (actions.isEmpty()) { + // If no actions are included, we only check for read permissions + resourceQuery.append("(read:(").append(epersonAndGroupClause).append("))").append( " OR ") + .append("admin:(").append(epersonAndGroupClause).append(")"); + } else if (actions.contains(Constants.ADMIN)) { + // If the actions array contains the admin action, we only check for admin permissions + resourceQuery.append("admin:(").append(epersonAndGroupClause).append(")"); + } else { + // If the actions array contains other actions, we check for read permissions and the actions passed + resourceQuery.append("(read:(").append(epersonAndGroupClause).append(")"); + for (int action : actions) { + String actionName = getIndexedActionName(action); + resourceQuery.append(" AND ").append(actionName).append(":(").append(epersonAndGroupClause) + .append(")"); + } + resourceQuery.append(")"); + resourceQuery.append(" OR ").append("admin:(") + .append(epersonAndGroupClause).append(")"); + } - if (StringUtils.isNotBlank(locations)) { - resourceQuery.append(" OR "); - resourceQuery.append(locations); + // Add to the query the locations the user has administrative rights on to cover the cases of + // inherited permissions only if the inherit authorizations flag is enabled + if (discoveryQuery.isInheritAuthorizationsEnabled()) { + String locations = searchService + .createLocationQueryForAdministrableDSOs(epersonAndGroupClause.toString()); + + if (StringUtils.isNotBlank(locations)) { + resourceQuery.append(" OR "); + resourceQuery.append(locations); + } } solrQuery.addFilterQuery(resourceQuery.toString()); @@ -178,4 +188,26 @@ public void additionalSearchParameters(Context context, DiscoverQuery discoveryQ log.error(LogHelper.getHeader(context, "Error while adding resource policy information to query", ""), e); } } + + /** + * Get the action name used for solr indexing for the given action id + * + * @param action action id + * @return solr action name used for indexing + */ + private String getIndexedActionName(int action) { + + switch (action) { + case Constants.READ: + return "read"; + case Constants.WRITE: + return "edit"; + case Constants.ADD: + return "submit"; + case Constants.ADMIN: + return "admin"; + default: + return Constants.actionText[action].toLowerCase(); + } + } } diff --git a/dspace-api/src/test/java/org/dspace/content/service/ItemServiceIT.java b/dspace-api/src/test/java/org/dspace/content/service/ItemServiceIT.java index d31acd854513..bc4e4359dfd6 100644 --- a/dspace-api/src/test/java/org/dspace/content/service/ItemServiceIT.java +++ b/dspace-api/src/test/java/org/dspace/content/service/ItemServiceIT.java @@ -669,8 +669,8 @@ public void testDeleteItemWithMultipleVersions() throws Exception { @Test public void testFindItemsWithEditNoRights() throws Exception { context.setCurrentUser(eperson); - List result = itemService.findItemsWithEdit(context, 0, 10); - int count = itemService.countItemsWithEdit(context); + List result = itemService.findItemsWithEdit(context, "", 0, 10); + int count = itemService.countItemsWithEdit(context, ""); assertThat(result.size(), equalTo(0)); assertThat(count, equalTo(0)); } @@ -682,8 +682,8 @@ public void testFindAndCountItemsWithEditEPerson() throws Exception { .withAction(Constants.WRITE) .build(); context.setCurrentUser(eperson); - List result = itemService.findItemsWithEdit(context, 0, 10); - int count = itemService.countItemsWithEdit(context); + List result = itemService.findItemsWithEdit(context, "", 0, 10); + int count = itemService.countItemsWithEdit(context, ""); assertThat(result.size(), equalTo(1)); assertThat(count, equalTo(1)); } @@ -695,8 +695,8 @@ public void testFindAndCountItemsWithAdminEPerson() throws Exception { .withAction(Constants.ADMIN) .build(); context.setCurrentUser(eperson); - List result = itemService.findItemsWithEdit(context, 0, 10); - int count = itemService.countItemsWithEdit(context); + List result = itemService.findItemsWithEdit(context, "", 0, 10); + int count = itemService.countItemsWithEdit(context, ""); assertThat(result.size(), equalTo(1)); assertThat(count, equalTo(1)); } @@ -714,8 +714,8 @@ public void testFindAndCountItemsWithEditGroup() throws Exception { .withAction(Constants.WRITE) .build(); context.setCurrentUser(eperson); - List result = itemService.findItemsWithEdit(context, 0, 10); - int count = itemService.countItemsWithEdit(context); + List result = itemService.findItemsWithEdit(context, "", 0, 10); + int count = itemService.countItemsWithEdit(context, ""); assertThat(result.size(), equalTo(1)); assertThat(count, equalTo(1)); } @@ -733,8 +733,8 @@ public void testFindAndCountItemsWithAdminGroup() throws Exception { .withAction(Constants.ADMIN) .build(); context.setCurrentUser(eperson); - List result = itemService.findItemsWithEdit(context, 0, 10); - int count = itemService.countItemsWithEdit(context); + List result = itemService.findItemsWithEdit(context, "", 0, 10); + int count = itemService.countItemsWithEdit(context, ""); assertThat(result.size(), equalTo(1)); assertThat(count, equalTo(1)); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/EditItemFeature.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/EditItemFeature.java index 5c605daaf407..d938cd5a335e 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/EditItemFeature.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/EditItemFeature.java @@ -40,7 +40,7 @@ public class EditItemFeature implements AuthorizationFeature { @Override public boolean isAuthorized(Context context, BaseObjectRest object) throws SQLException, SearchServiceException { if (object instanceof SiteRest) { - return itemService.countItemsWithEdit(context) > 0; + return itemService.countItemsWithEdit(context, "") > 0; } else if (object instanceof ItemRest) { Item item = (Item) utils.getDSpaceAPIObjectFromRest(context, object); return authService.authorizeActionBoolean(context, item, Constants.WRITE); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/SubmitFeature.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/SubmitFeature.java index 3793928fb0fe..599bdb64117f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/SubmitFeature.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/authorization/impl/SubmitFeature.java @@ -43,7 +43,7 @@ public class SubmitFeature implements AuthorizationFeature { public boolean isAuthorized(Context context, BaseObjectRest object) throws SQLException, SearchServiceException { if (object instanceof SiteRest) { // Check whether the user has permission to add to any collection - return collectionService.countCollectionsWithSubmit("", context, null) > 0; + return collectionService.countCollectionsWithSubmit(context, "", null) > 0; } else if (object instanceof CollectionRest) { // Check whether the user has permission to add to the given collection Collection collection = (Collection) utils.getDSpaceAPIObjectFromRest(context, object); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java index ba3163a4447c..ebfbbdb31327 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CollectionRestRepository.java @@ -185,7 +185,7 @@ public Page findSubmitAuthorizedByCommunity( List collections = cs.findCollectionsWithSubmit(q, context, com, Math.toIntExact(pageable.getOffset()), Math.toIntExact(pageable.getPageSize())); - int tot = cs.countCollectionsWithSubmit(q, context, com); + int tot = cs.countCollectionsWithSubmit(context, q, com); return converter.toRestPage(collections, pageable, tot , utils.obtainProjection()); } catch (SQLException | SearchServiceException e) { throw new RuntimeException(e.getMessage(), e); @@ -200,7 +200,7 @@ public Page findSubmitAuthorized(@Parameter(value = "query") Str List collections = cs.findCollectionsWithSubmit(q, context, null, Math.toIntExact(pageable.getOffset()), Math.toIntExact(pageable.getPageSize())); - int tot = cs.countCollectionsWithSubmit(q, context, null); + int tot = cs.countCollectionsWithSubmit(context, q, null); return converter.toRestPage(collections, pageable, tot, utils.obtainProjection()); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); @@ -211,14 +211,33 @@ public Page findSubmitAuthorized(@Parameter(value = "query") Str @SearchRestMethod(name = "findAdminAuthorized") public Page findAdminAuthorized ( Pageable pageable, @Parameter(value = "query") String query) { + return findAuthorized(pageable, Constants.ADMIN, query); + } + + /** + * Returns Collections for which the current user has 'edit' privileges. + * + * @param pageable The pagination information + * @param query The query used in the lookup + * @return + */ + @PreAuthorize("hasAuthority('AUTHENTICATED')") + @SearchRestMethod(name = "findEditAuthorized") + public Page findEditAuthorized ( + Pageable pageable, @Parameter(value = "query") String query) { + return findAuthorized(pageable, Constants.WRITE, query); + } + + private Page findAuthorized(Pageable pageable, int action, String query) { try { Context context = obtainContext(); - List collections = authorizeService.findAdminAuthorizedCollection(context, query, + List collections = authorizeService.findAuthorizedCollectionByAction(context, query, + action, Math.toIntExact(pageable.getOffset()), Math.toIntExact(pageable.getPageSize())); - long tot = authorizeService.countAdminAuthorizedCollection(context, query); - return converter.toRestPage(collections, pageable, tot , utils.obtainProjection()); - } catch (SearchServiceException | SQLException e) { + long tot = authorizeService.countAuthorizedCollectionByAction(context, query, action); + return converter.toRestPage(collections, pageable, tot, utils.obtainProjection()); + } catch (SearchServiceException e) { throw new RuntimeException(e.getMessage(), e); } } @@ -245,10 +264,10 @@ public Page findSubmitAuthorizedByEntityType( if (entityType == null) { throw new ResourceNotFoundException("There was no entityType found with label: " + entityTypeLabel); } - List collections = cs.findCollectionsWithSubmit(query, context, null, entityTypeLabel, + List collections = cs.findCollectionsWithSubmit(context, query,null, entityTypeLabel, Math.toIntExact(pageable.getOffset()), Math.toIntExact(pageable.getPageSize())); - int tot = cs.countCollectionsWithSubmit(query, context, null, entityTypeLabel); + int tot = cs.countCollectionsWithSubmit(context, query,null, entityTypeLabel); return converter.toRestPage(collections, pageable, tot, utils.obtainProjection()); } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); @@ -282,10 +301,10 @@ public Page findSubmitAuthorizedByCommunityAndEntityType( throw new ResourceNotFoundException( CommunityRest.CATEGORY + "." + CommunityRest.NAME + " with id: " + communityUuid + " not found"); } - List collections = cs.findCollectionsWithSubmit(query, context, community, entityTypeLabel, + List collections = cs.findCollectionsWithSubmit(context, query, community, entityTypeLabel, Math.toIntExact(pageable.getOffset()), Math.toIntExact(pageable.getPageSize())); - int total = cs.countCollectionsWithSubmit(query, context, community, entityTypeLabel); + int total = cs.countCollectionsWithSubmit(context, query, community, entityTypeLabel); return converter.toRestPage(collections, pageable, total, utils.obtainProjection()); } catch (SQLException | SearchServiceException e) { throw new RuntimeException(e.getMessage(), e); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java index 927b6a0b98f5..cacda5ade7b0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/CommunityRestRepository.java @@ -38,6 +38,7 @@ import org.dspace.content.Community; import org.dspace.content.service.BitstreamService; import org.dspace.content.service.CommunityService; +import org.dspace.core.Constants; import org.dspace.core.Context; import org.dspace.discovery.DiscoverQuery; import org.dspace.discovery.DiscoverResult; @@ -220,12 +221,31 @@ public Page findAllTop(Pageable pageable) { @SearchRestMethod(name = "findAdminAuthorized") public Page findAdminAuthorized ( Pageable pageable, @Parameter(value = "query") String query) { + return findAuthorized(pageable, Constants.ADMIN, query); + } + + @PreAuthorize("hasAuthority('AUTHENTICATED')") + @SearchRestMethod(name = "findEditAuthorized") + public Page findEditAuthorized ( + Pageable pageable, @Parameter(value = "query") String query) { + return findAuthorized(pageable, Constants.WRITE, query); + } + + @PreAuthorize("hasAuthority('AUTHENTICATED')") + @SearchRestMethod(name = "findAddAuthorized") + public Page findAddAuthorized ( + Pageable pageable, @Parameter(value = "query") String query) { + return findAuthorized(pageable, Constants.ADD, query); + } + + private Page findAuthorized(Pageable pageable, int action, String query) { try { Context context = obtainContext(); - List communities = authorizeService.findAdminAuthorizedCommunity(context, query, + List communities = authorizeService.findAuthorizedCommunityByAction(context, query, + action, Math.toIntExact(pageable.getOffset()), Math.toIntExact(pageable.getPageSize())); - long tot = authorizeService.countAdminAuthorizedCommunity(context, query); + long tot = authorizeService.countAuthorizedCommunityByAction(context, query, action); return converter.toRestPage(communities, pageable, tot , utils.obtainProjection()); } catch (SearchServiceException | SQLException e) { throw new RuntimeException(e.getMessage(), e); diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java index 16ce8629d17d..55ce0ccde010 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ItemRestRepository.java @@ -22,6 +22,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.dspace.app.rest.Parameter; +import org.dspace.app.rest.SearchRestMethod; import org.dspace.app.rest.converter.MetadataConverter; import org.dspace.app.rest.exception.DSpaceBadRequestException; import org.dspace.app.rest.exception.RepositoryMethodNotImplementedException; @@ -45,6 +47,7 @@ import org.dspace.content.service.RelationshipTypeService; import org.dspace.content.service.WorkspaceItemService; import org.dspace.core.Context; +import org.dspace.discovery.SearchServiceException; import org.dspace.util.UUIDUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; @@ -357,6 +360,27 @@ public Bundle addBundleToItem(Context context, Item item, BundleRest bundleRest) return bundle; } + /** + * Method to find the items for which the current user has editing rights. + * + * @param query Query string + * @param pageable Pagination information + * @return Page of Items (REST representation) for which the current user has editing rights + * @throws SearchServiceException + */ + @PreAuthorize("hasAuthority('AUTHENTICATED')") + @SearchRestMethod(name = "findEditAuthorized") + public Page findEditAuthorized(@Parameter(value = "query") String query, + Pageable pageable) + throws SearchServiceException { + Context context = obtainContext(); + List items = itemService.findItemsWithEdit(context, query, + Math.toIntExact(pageable.getOffset()), + Math.toIntExact(pageable.getPageSize())); + int tot = itemService.countItemsWithEdit(context, query); + return converter.toRestPage(items, pageable, tot, utils.obtainProjection()); + } + @Override protected ItemRest createAndReturn(Context context, List stringList) throws AuthorizeException, SQLException, RepositoryMethodNotImplementedException { diff --git a/dspace/config/spring/api/discovery.xml b/dspace/config/spring/api/discovery.xml index c5486ad84e63..d84da23a8d6d 100644 --- a/dspace/config/spring/api/discovery.xml +++ b/dspace/config/spring/api/discovery.xml @@ -30,8 +30,6 @@ - - From c8b88884b60bca781e2ba0f8663e1d9ab4e1d0c2 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Sat, 29 Nov 2025 22:29:51 +0100 Subject: [PATCH 038/283] Introduce integration tests for the new authorization-based endpoints for Item, Collection, and Community --- .../app/rest/CollectionRestRepositoryIT.java | 362 +++++++++++++ .../app/rest/CommunityRestRepositoryIT.java | 481 ++++++++++++++++++ .../dspace/app/rest/ItemRestRepositoryIT.java | 408 +++++++++++++++ 3 files changed, 1251 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java index 1e18723ca90c..26eda3b06c91 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java @@ -56,6 +56,7 @@ import org.dspace.app.rest.projection.Projection; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.app.rest.test.MetadataPatchSuite; +import org.dspace.authorize.ResourcePolicy; import org.dspace.authorize.service.AuthorizeService; import org.dspace.authorize.service.ResourcePolicyService; import org.dspace.builder.CollectionBuilder; @@ -3314,6 +3315,109 @@ public void addColAdminGroupToCheckReindexingTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(1))); } + @Test + public void addParentComAdminGroupToCheckAdminPropagationTest() throws Exception { + addParentComAdminGroupToCheckGenericPropagationTest("findAdminAuthorized"); + } + + @Test + public void addParentComAdminGroupToCheckEditPropagationTest() throws Exception { + addParentComAdminGroupToCheckGenericPropagationTest("findEditAuthorized"); + } + + public void addParentComAdminGroupToCheckGenericPropagationTest(String method) throws Exception { + context.turnOffAuthorisationSystem(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) + .withName("MyTest") + .build(); + + context.restoreAuthSystemState(); + + String epersonToken = getAuthToken(eperson.getEmail(), password); + getClient(epersonToken).perform(get("/api/core/collections/search/" + method) + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded").doesNotExist()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + AtomicReference idRef = new AtomicReference<>(); + ObjectMapper mapper = new ObjectMapper(); + GroupRest groupRest = new GroupRest(); + String token = getAuthToken(admin.getEmail(), password); + getClient(token).perform(post("/api/core/communities/" + parentCommunity.getID() + "/adminGroup") + .content(mapper.writeValueAsBytes(groupRest)) + .contentType(contentType)) + .andExpect(status().isCreated()) + .andDo(result -> idRef.set( + UUID.fromString(read(result.getResponse().getContentAsString(), "$.id"))) + ); + + String adminToken = getAuthToken(admin.getEmail(), password); + getClient(adminToken).perform(post("/api/eperson/groups/" + idRef.get() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + eperson.getID() + )); + + getClient(epersonToken).perform(get("/api/core/collections/search/" + method) + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.contains(CollectionMatcher + .matchProperties(col1.getName(), col1.getID(), col1.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void removeParentComAdminPolicyToCheckAdminPropagationTest() throws Exception { + removeParentComAdminPolicyToCheckGenericPropagationTest("findAdminAuthorized"); + } + + @Test + public void removeParentComAdminPolicyToCheckEditPropagationTest() throws Exception { + removeParentComAdminPolicyToCheckGenericPropagationTest("findEditAuthorized"); + } + + public void removeParentComAdminPolicyToCheckGenericPropagationTest(String method) throws Exception { + context.turnOffAuthorisationSystem(); + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, eperson, null) + .withDspaceObject(parentCommunity).withAction(Constants.ADMIN) + .build(); + + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) + .withName("MyTest") + .build(); + + context.restoreAuthSystemState(); + + String epersonToken = getAuthToken(eperson.getEmail(), password); + getClient(epersonToken).perform(get("/api/core/collections/search/" + method) + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.contains(CollectionMatcher + .matchProperties(col1.getName(), col1.getID(), col1.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + String token = getAuthToken(admin.getEmail(), password); + getClient(token).perform(delete("/api/authz/resourcepolicies/" + policy.getID())) + .andExpect(status().is(204)); + + getClient(epersonToken).perform(get("/api/core/collections/search/" + method) + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded").doesNotExist()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + } + @Test public void findAuthorizedCollectionsByEntityType() throws Exception { context.turnOffAuthorisationSystem(); @@ -3652,4 +3756,262 @@ public void findSubmitAuthorizedByCommunityAndEntityTypeNotFoundTest() throws Ex .andExpect(status().isNotFound()); } + @Test + public void findEditAuthorizedUnauthorizedTest() throws Exception { + getClient().perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isUnauthorized()); + } + + @Test + public void findEditAuthorizedResourcePolicyTest() throws Exception { + context.turnOffAuthorisationSystem(); + Community comm1 = CommunityBuilder.createCommunity(context).withName("Community 1").build(); + + EPerson hasDirectEditRights = EPersonBuilder.createEPerson(context) + .withEmail("has@editrights.com").withPassword(password) + .build(); + EPerson hasDirectAdminRights = EPersonBuilder.createEPerson(context) + .withEmail("has@adminrights.com").withPassword(password) + .build(); + Collection byResourcePolicy = CollectionBuilder.createCollection(context, comm1) + .withName("direct edit rights for eperson") + .build(); + Collection uneditable = CollectionBuilder.createCollection(context, comm1) + .withName("uneditable collection") + .build(); + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectEditRights, null) + .withDspaceObject(byResourcePolicy).withAction(WRITE) + .build(); + policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectAdminRights, null) + .withDspaceObject(byResourcePolicy).withAction(Constants.ADMIN) + .build(); + context.restoreAuthSystemState(); + + String tokenHasDirectEditRightsToken = getAuthToken(hasDirectEditRights.getEmail(), password); + String tokenHasDirectAdminRightsToken = getAuthToken(hasDirectAdminRights.getEmail(), password); + + getClient(tokenHasDirectEditRightsToken).perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.collections", + Matchers.contains(CollectionMatcher.matchCollection(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + getClient(tokenHasDirectAdminRightsToken).perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.collections", + Matchers.contains(CollectionMatcher.matchCollection(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void findEditAuthorizedAdminPropagationTest() throws Exception { + + context.turnOffAuthorisationSystem(); + + /* + DSO structure: + root + ├── subcomm1 + ├── subcomm1collA (collection) + └── subcomm2subcomm3 (community) + ├── subcomm2subcomm3collB (collection) + └── subcomm2 + └── subcomm2coll + */ + EPerson rootAdmin = EPersonBuilder.createEPerson(context) + .withEmail("root@admin.com").withPassword(password).build(); + EPerson subcomm1Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1@admin.com").withPassword(password).build(); + EPerson subcomm2Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm2@admin.com").withPassword(password).build(); + EPerson subcomm1collA_Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1collA@admin.com").withPassword(password).build(); + EPerson subcomm1collB_Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1collB@admin.com").withPassword(password).build(); + EPerson subcomm2collAdmin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm2coll@admin.com").withPassword(password).build(); + + Community root = CommunityBuilder.createCommunity(context) + .withAdminGroup(rootAdmin) + .withName("root") + .build(); + Community subcomm1 = CommunityBuilder.createSubCommunity(context, root) + .withAdminGroup(subcomm1Admin) + .withName("subcomm1") + .build(); + Community subcomm1subcom3 = CommunityBuilder.createSubCommunity(context, subcomm1) + .withName("subcomm1subcom3") + .build(); + Community subcomm2 = CommunityBuilder.createSubCommunity(context, root) + .withAdminGroup(subcomm2Admin) + .withName("subcomm2") + .build(); + Collection subcomm1collA = CollectionBuilder.createCollection(context, subcomm1) + .withAdminGroup(subcomm1collA_Admin) + .withName("subcomm1collA") + .build(); + Collection subcomm2subcomm3collB = CollectionBuilder.createCollection(context, subcomm1subcom3) + .withAdminGroup(subcomm1collB_Admin) + .withName("subcomm2subcomm3collB") + .build(); + Collection subcomm2coll = CollectionBuilder.createCollection(context, subcomm2) + .withAdminGroup(subcomm2collAdmin) + .withName("subcomm2coll") + .build(); + context.restoreAuthSystemState(); + + String siteAdminToken = getAuthToken(admin.getEmail(), password); + String rootAdminToken = getAuthToken(rootAdmin.getEmail(), password); + String subcomm1AdminToken = getAuthToken(subcomm1Admin.getEmail(), password); + String subcomm2AdminToken = getAuthToken(subcomm2Admin.getEmail(), password); + + getClient(siteAdminToken).perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.collections", + Matchers.containsInAnyOrder( + CollectionMatcher.matchCollection(subcomm1collA), + CollectionMatcher.matchCollection(subcomm2subcomm3collB), + CollectionMatcher.matchCollection(subcomm2coll) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(rootAdminToken).perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.collections", + Matchers.containsInAnyOrder( + CollectionMatcher.matchCollection(subcomm1collA), + CollectionMatcher.matchCollection(subcomm2subcomm3collB), + CollectionMatcher.matchCollection(subcomm2coll) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(subcomm1AdminToken).perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.collections", + Matchers.containsInAnyOrder( + CollectionMatcher.matchCollection(subcomm1collA), + CollectionMatcher.matchCollection(subcomm2subcomm3collB) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + getClient(subcomm2AdminToken).perform(get("/api/core/collections/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.collections", + Matchers.containsInAnyOrder( + CollectionMatcher.matchCollection(subcomm2coll) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void findEditAuthorizedCollectionsWithQueryTest() throws Exception { + findGenericAuthorizedCollectionsWithQueryTest("findEditAuthorized"); + } + + @Test + public void findReadAuthorizedCollectionsWithQueryTest() throws Exception { + findGenericAuthorizedCollectionsWithQueryTest("findAdminAuthorized"); + } + + public void findGenericAuthorizedCollectionsWithQueryTest(String method) throws Exception { + + context.turnOffAuthorisationSystem(); + + EPerson eperson2 = EPersonBuilder.createEPerson(context) + .withEmail("eperson2@mail.com") + .withPassword(password) + .build(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community") + .build(); + Community child2 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community Two") + .build(); + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) + .withName("Sample collection") + .withAdminGroup(eperson) + .build(); + Collection col2 = CollectionBuilder.createCollection(context, child1) + .withName("Test collection") + .build(); + Collection col3 = CollectionBuilder.createCollection(context, child2) + .withName("Collection of sample items") + .withAdminGroup(eperson) + .build(); + context.restoreAuthSystemState(); + + String tokenEPerson = getAuthToken(eperson.getEmail(), password); + // Test simple query matches + getClient(tokenEPerson).perform(get("/api/core/collections/search/" + method) + .param("query", "collection")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.containsInAnyOrder( + CollectionMatcher.matchProperties(col1.getName(), col1.getID(), col1.getHandle()), + CollectionMatcher.matchProperties(col3.getName(), col3.getID(), col3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test insensitive matches + getClient(tokenEPerson).perform(get("/api/core/collections/search/" + method) + .param("query", "COLLECTION")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.containsInAnyOrder( + CollectionMatcher.matchProperties(col1.getName(), col1.getID(), col1.getHandle()), + CollectionMatcher.matchProperties(col3.getName(), col3.getID(), col3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test collection unathorized for eperson is not returned + getClient(tokenEPerson).perform(get("/api/core/collections/search/" + method) + .param("query", "test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + // Test eperson with no authorized collections + String tokenEPerson2 = getAuthToken(eperson2.getEmail(), password); + getClient(tokenEPerson2).perform(get("/api/core/collections/search/" + method) + .param("query", "collection")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + // Test admin gets all authorized collections + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/core/collections/search/" + method) + .param("query", "sample")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.containsInAnyOrder( + CollectionMatcher.matchProperties(col1.getName(), col1.getID(), col1.getHandle()), + CollectionMatcher.matchProperties(col3.getName(), col3.getID(), col3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test query with unsorted query words + getClient(tokenAdmin).perform(get("/api/core/collections/search/" + method) + .param("query", "items sample")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.contains( + CollectionMatcher.matchProperties(col3.getName(), col3.getID(), col3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + // Test collection not authorized for eperson is returned for admin + getClient(tokenAdmin).perform(get("/api/core/collections/search/" + method) + .param("query", "test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.containsInAnyOrder( + CollectionMatcher.matchProperties(col2.getName(), col2.getID(), col2.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + } + } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java index c2b005a2ea6c..6cc25f22ce93 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java @@ -50,6 +50,7 @@ import org.dspace.app.rest.projection.Projection; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.app.rest.test.MetadataPatchSuite; +import org.dspace.authorize.ResourcePolicy; import org.dspace.authorize.service.AuthorizeService; import org.dspace.authorize.service.ResourcePolicyService; import org.dspace.builder.CollectionBuilder; @@ -2757,4 +2758,484 @@ public void addComAdminGroupToCheckReindexingTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", is(1))); } + @Test + public void addParentComAdminGroupToCheckAdminPropagationTest() throws Exception { + addParentComAdminGroupToCheckGenericPropagationTest("findAdminAuthorized"); + } + + @Test + public void addParentComAdminGroupToCheckEditPropagationTest() throws Exception { + addParentComAdminGroupToCheckGenericPropagationTest("findEditAuthorized"); + } + + @Test + public void addParentComAdminGroupToCheckAddPropagationTest() throws Exception { + addParentComAdminGroupToCheckGenericPropagationTest("findAddAuthorized"); + } + + public void addParentComAdminGroupToCheckGenericPropagationTest(String method) throws Exception { + context.turnOffAuthorisationSystem(); + + Community rootCommunity = CommunityBuilder.createCommunity(context) + .withName("Root Community") + .build(); + + Community subCommunity = CommunityBuilder.createSubCommunity(context, rootCommunity) + .withName("MyTestCom") + .build(); + + context.restoreAuthSystemState(); + + String epersonToken = getAuthToken(eperson.getEmail(), password); + getClient(epersonToken).perform(get("/api/core/communities/search/" + method) + .param("query", "MyTestCom")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded").doesNotExist()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + AtomicReference idRef = new AtomicReference<>(); + ObjectMapper mapper = new ObjectMapper(); + GroupRest groupRest = new GroupRest(); + String token = getAuthToken(admin.getEmail(), password); + getClient(token).perform(post("/api/core/communities/" + rootCommunity.getID() + "/adminGroup") + .content(mapper.writeValueAsBytes(groupRest)) + .contentType(contentType)) + .andExpect(status().isCreated()) + .andDo(result -> idRef.set( + UUID.fromString(read(result.getResponse().getContentAsString(), "$.id"))) + ); + + String adminToken = getAuthToken(admin.getEmail(), password); + getClient(adminToken).perform(post("/api/eperson/groups/" + idRef.get() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + eperson.getID() + )); + + getClient(epersonToken).perform(get("/api/core/communities/search/" + method) + .param("query", "MyTestCom")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.contains(CommunityMatcher + .matchProperties(subCommunity.getName(), + subCommunity.getID(), + subCommunity.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void removeParentComAdminPolicyToCheckAdminPropagationTest() throws Exception { + removeParentComAdminPolicyToCheckGenericPropagationTest("findAdminAuthorized"); + } + + @Test + public void removeParentComAdminPolicyToCheckEditPropagationTest() throws Exception { + removeParentComAdminPolicyToCheckGenericPropagationTest("findEditAuthorized"); + } + + @Test + public void removeParentComAdminPolicyToCheckAddPropagationTest() throws Exception { + removeParentComAdminPolicyToCheckGenericPropagationTest("findAddAuthorized"); + } + + public void removeParentComAdminPolicyToCheckGenericPropagationTest(String method) throws Exception { + context.turnOffAuthorisationSystem(); + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Root Community") + .build(); + + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, eperson, null) + .withDspaceObject(parentCommunity).withAction(Constants.ADMIN) + .build(); + + Community subCommunity = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("MyTestCom") + .build(); + context.restoreAuthSystemState(); + + String epersonToken = getAuthToken(eperson.getEmail(), password); + getClient(epersonToken).perform(get("/api/core/communities/search/" + method) + .param("query", "MyTestCom")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.contains(CommunityMatcher + .matchProperties(subCommunity.getName(), + subCommunity.getID(), + subCommunity.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + String token = getAuthToken(admin.getEmail(), password); + getClient(token).perform(delete("/api/authz/resourcepolicies/" + policy.getID())) + .andExpect(status().is(204)); + + getClient(epersonToken).perform(get("/api/core/communities/search/" + method) + .param("query", "MyTestCom")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded").doesNotExist()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + } + + @Test + public void findEditAuthorizedUnauthorizedTest() throws Exception { + getClient().perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isUnauthorized()); + } + + @Test + public void findEditAuthorizedResourcePolicyTest() throws Exception { + context.turnOffAuthorisationSystem(); + Community comm1 = CommunityBuilder.createCommunity(context).withName("Community 1").build(); + + EPerson hasDirectEditRights = EPersonBuilder.createEPerson(context) + .withEmail("has@editrights.com").withPassword(password) + .build(); + EPerson hasDirectAdminRights = EPersonBuilder.createEPerson(context) + .withEmail("has@adminrights.com").withPassword(password) + .build(); + Community byResourcePolicy = CommunityBuilder.createCommunity(context) + .withName("direct edit rights for eperson").build(); + Community uneditable = CommunityBuilder.createCommunity(context) + .withName("uneditable community") + .build(); + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectEditRights, null) + .withDspaceObject(byResourcePolicy).withAction(Constants.WRITE) + .build(); + policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectAdminRights, null) + .withDspaceObject(byResourcePolicy).withAction(Constants.ADMIN) + .build(); + context.restoreAuthSystemState(); + + String tokenHasDirectEditRightsToken = getAuthToken(hasDirectEditRights.getEmail(), password); + String tokenHasDirectAdminRightsToken = getAuthToken(hasDirectAdminRights.getEmail(), password); + + getClient(tokenHasDirectEditRightsToken).perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.contains(CommunityMatcher.matchCommunity(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + getClient(tokenHasDirectAdminRightsToken).perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.contains(CommunityMatcher.matchCommunity(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void findEditAuthorizedAdminPropagationTest() throws Exception { + + context.turnOffAuthorisationSystem(); + + /* + DSO structure: + root + └── subcomm1 + └── subcomm1subcomm2 + */ + EPerson rootAdmin = EPersonBuilder.createEPerson(context) + .withEmail("root@admin.com").withPassword(password).build(); + EPerson subcomm1Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1@admin.com").withPassword(password).build(); + EPerson subcomm2Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm2@admin.com").withPassword(password).build(); + + Community root = CommunityBuilder.createCommunity(context) + .withAdminGroup(rootAdmin) + .withName("root") + .build(); + Community subcomm1 = CommunityBuilder.createSubCommunity(context, root) + .withAdminGroup(subcomm1Admin) + .withName("subcomm1") + .build(); + Community subcomm1subcomm2 = CommunityBuilder.createSubCommunity(context, subcomm1) + .withAdminGroup(subcomm2Admin) + .withName("subcomm1subcomm2") + .build(); + context.restoreAuthSystemState(); + + String siteAdminToken = getAuthToken(admin.getEmail(), password); + String rootAdminToken = getAuthToken(rootAdmin.getEmail(), password); + String subcomm1AdminToken = getAuthToken(subcomm1Admin.getEmail(), password); + String subcomm2AdminToken = getAuthToken(subcomm2Admin.getEmail(), password); + + getClient(siteAdminToken).perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(root), + CommunityMatcher.matchCommunity(subcomm1), + CommunityMatcher.matchCommunity(subcomm1subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(rootAdminToken).perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(root), + CommunityMatcher.matchCommunity(subcomm1), + CommunityMatcher.matchCommunity(subcomm1subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(subcomm1AdminToken).perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(subcomm1), + CommunityMatcher.matchCommunity(subcomm1subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + getClient(subcomm2AdminToken).perform(get("/api/core/communities/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(subcomm1subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + } + + @Test + public void findAddAuthorizedUnauthorizedTest() throws Exception { + getClient().perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isUnauthorized()); + } + + @Test + public void findAddAuthorizedResourcePolicyTest() throws Exception { + context.turnOffAuthorisationSystem(); + Community comm1 = CommunityBuilder.createCommunity(context).withName("Community 1").build(); + + EPerson hasDirectEditRights = EPersonBuilder.createEPerson(context) + .withEmail("has@editrights.com").withPassword(password) + .build(); + EPerson hasDirectAdminRights = EPersonBuilder.createEPerson(context) + .withEmail("has@adminrights.com").withPassword(password) + .build(); + Community byResourcePolicy = CommunityBuilder.createCommunity(context) + .withName("direct add rights for eperson").build(); + Community uneditable = CommunityBuilder.createCommunity(context) + .withName("no add community") + .build(); + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectEditRights, null) + .withDspaceObject(byResourcePolicy).withAction(Constants.ADD) + .build(); + policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectAdminRights, null) + .withDspaceObject(byResourcePolicy).withAction(Constants.ADMIN) + .build(); + context.restoreAuthSystemState(); + + String tokenHasDirectAddRightsToken = getAuthToken(hasDirectEditRights.getEmail(), password); + String tokenHasDirectAdminRightsToken = getAuthToken(hasDirectAdminRights.getEmail(), password); + + getClient(tokenHasDirectAddRightsToken).perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.contains(CommunityMatcher.matchCommunity(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + getClient(tokenHasDirectAdminRightsToken).perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.contains(CommunityMatcher.matchCommunity(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void findAddAuthorizedAdminPropagationTest() throws Exception { + + context.turnOffAuthorisationSystem(); + + /* + DSO structure: + root + └── subcomm1 + └── subcomm2 + */ + EPerson rootAdmin = EPersonBuilder.createEPerson(context) + .withEmail("root@admin.com").withPassword(password).build(); + EPerson subcomm1Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1@admin.com").withPassword(password).build(); + EPerson subcomm2Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm2@admin.com").withPassword(password).build(); + + Community root = CommunityBuilder.createCommunity(context) + .withAdminGroup(rootAdmin) + .withName("root") + .build(); + Community subcomm1 = CommunityBuilder.createSubCommunity(context, root) + .withAdminGroup(subcomm1Admin) + .withName("subcomm1") + .build(); + Community subcomm2 = CommunityBuilder.createSubCommunity(context, subcomm1) + .withAdminGroup(subcomm2Admin) + .withName("subcomm2") + .build(); + context.restoreAuthSystemState(); + + String siteAdminToken = getAuthToken(admin.getEmail(), password); + String rootAdminToken = getAuthToken(rootAdmin.getEmail(), password); + String subcomm1AdminToken = getAuthToken(subcomm1Admin.getEmail(), password); + String subcomm2AdminToken = getAuthToken(subcomm2Admin.getEmail(), password); + + getClient(siteAdminToken).perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(root), + CommunityMatcher.matchCommunity(subcomm1), + CommunityMatcher.matchCommunity(subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(rootAdminToken).perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(root), + CommunityMatcher.matchCommunity(subcomm1), + CommunityMatcher.matchCommunity(subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(subcomm1AdminToken).perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(subcomm1), + CommunityMatcher.matchCommunity(subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + getClient(subcomm2AdminToken).perform(get("/api/core/communities/search/findAddAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.communities", + Matchers.containsInAnyOrder( + CommunityMatcher.matchCommunity(subcomm2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void findEditAuthorizedCommunitiesWithQueryTest() throws Exception { + findGenericAuthorizedCommunitiesWithQueryTest("findEditAuthorized"); + } + + @Test + public void findAddAuthorizedCommunitiesWithQueryTest() throws Exception { + findGenericAuthorizedCommunitiesWithQueryTest("findAddAuthorized"); + } + + @Test + public void findReadAuthorizedCommunitiesWithQueryTest() throws Exception { + findGenericAuthorizedCommunitiesWithQueryTest("findAdminAuthorized"); + } + + public void findGenericAuthorizedCommunitiesWithQueryTest(String method) throws Exception { + + context.turnOffAuthorisationSystem(); + + EPerson eperson2 = EPersonBuilder.createEPerson(context) + .withEmail("eperson2@mail.com") + .withPassword(password) + .build(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community") + .build(); + Community child2 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community Two") + .build(); + Community com1 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sample community") + .withAdminGroup(eperson) + .build(); + Community com2 = CommunityBuilder.createSubCommunity(context, child1) + .withName("Test community") + .build(); + Community com3 = CommunityBuilder.createSubCommunity(context, child2) + .withName("community of sample items") + .withAdminGroup(eperson) + .build(); + context.restoreAuthSystemState(); + + // Test simple query + String tokenEPerson = getAuthToken(eperson.getEmail(), password); + getClient(tokenEPerson).perform(get("/api/core/communities/search/" + method) + .param("query", "community")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder( + CommunityMatcher.matchProperties(com1.getName(), com1.getID(), com1.getHandle()), + CommunityMatcher.matchProperties(com3.getName(), com3.getID(), com3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test case insensitive query + getClient(tokenEPerson).perform(get("/api/core/communities/search/" + method) + .param("query", "COMMUNITY")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder( + CommunityMatcher.matchProperties(com1.getName(), com1.getID(), com1.getHandle()), + CommunityMatcher.matchProperties(com3.getName(), com3.getID(), com3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test word for unauthorized community + getClient(tokenEPerson).perform(get("/api/core/communities/search/" + method) + .param("query", "test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + // Test eperson with no authorized communities + String tokenEPerson2 = getAuthToken(eperson2.getEmail(), password); + getClient(tokenEPerson2).perform(get("/api/core/communities/search/" + method) + .param("query", "community")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + // Test as admin + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/core/communities/search/" + method) + .param("query", "sample")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder( + CommunityMatcher.matchProperties(com1.getName(), com1.getID(), com1.getHandle()), + CommunityMatcher.matchProperties(com3.getName(), com3.getID(), com3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test more specific unsorted query words + getClient(tokenAdmin).perform(get("/api/core/communities/search/" + method) + .param("query", "items sample")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.contains( + CommunityMatcher.matchProperties(com3.getName(), com3.getID(), com3.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + // Test add retrieve the col not authorized to community admin user + getClient(tokenAdmin).perform(get("/api/core/communities/search/" + method) + .param("query", "test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder( + CommunityMatcher.matchProperties(com2.getName(), com2.getID(), com2.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + } + } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java index 48e70a8d5f1f..a77938eeb32b 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java @@ -26,6 +26,8 @@ import static org.hamcrest.Matchers.hasSize; import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.nullValue; +import static org.springframework.data.rest.webmvc.RestMediaTypes.TEXT_URI_LIST_VALUE; +import static org.springframework.http.MediaType.parseMediaType; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; @@ -54,6 +56,7 @@ import org.dspace.app.rest.matcher.CollectionMatcher; import org.dspace.app.rest.matcher.HalMatcher; import org.dspace.app.rest.matcher.ItemMatcher; +import org.dspace.app.rest.model.GroupRest; import org.dspace.app.rest.model.ItemRest; import org.dspace.app.rest.model.MetadataRest; import org.dspace.app.rest.model.MetadataValueRest; @@ -63,6 +66,7 @@ import org.dspace.app.rest.repository.ItemRestRepository; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.app.rest.test.MetadataPatchSuite; +import org.dspace.authorize.ResourcePolicy; import org.dspace.builder.BitstreamBuilder; import org.dspace.builder.BundleBuilder; import org.dspace.builder.CollectionBuilder; @@ -4758,4 +4762,408 @@ public void findAccessStatusForItemTest() throws Exception { .andExpect(jsonPath("$.status", notNullValue())); } + @Test + public void findEditAuthorizedUnauthorizedTest() throws Exception { + getClient().perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isUnauthorized()); + } + + @Test + public void findEditAuthorizedResourcePolicyTest() throws Exception { + context.turnOffAuthorisationSystem(); + Community comm1 = CommunityBuilder.createCommunity(context).withName("Community 1").build(); + Collection col1 = CollectionBuilder.createCollection(context, comm1).withName("Collection 1").build(); + + EPerson hasDirectEditRights = EPersonBuilder.createEPerson(context) + .withEmail("has@editrights.com").withPassword(password) + .build(); + EPerson hasDirectAdminRights = EPersonBuilder.createEPerson(context) + .withEmail("has@adminrights.com").withPassword(password) + .build(); + Item byResourcePolicy = ItemBuilder.createItem(context, col1) + .withTitle("direct edit rights for eperson") + .build(); + Item uneditable = ItemBuilder.createItem(context, col1) + .withTitle("uneditable item") + .build(); + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectEditRights, null) + .withDspaceObject(byResourcePolicy).withAction(WRITE) + .build(); + policy = ResourcePolicyBuilder.createResourcePolicy(context, hasDirectAdminRights, null) + .withDspaceObject(byResourcePolicy).withAction(Constants.ADMIN) + .build(); + context.restoreAuthSystemState(); + + String tokenHasDirectEditRightsToken = getAuthToken(hasDirectEditRights.getEmail(), password); + String tokenHasDirectAdminRightsToken = getAuthToken(hasDirectAdminRights.getEmail(), password); + + getClient(tokenHasDirectEditRightsToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.contains(ItemMatcher.matchItemProperties(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + getClient(tokenHasDirectAdminRightsToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.contains(ItemMatcher.matchItemProperties(byResourcePolicy)))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void findEditAuthorizedAdminPropagationTest() throws Exception { + /* + Cases: + - items in collection with admin rights + - items in collection in community with admin rights + */ + + context.turnOffAuthorisationSystem(); + + /* + DSO structure: + root + ├── subcomm1 + ├── subcomm1collA + ├── subcomm1collAitemX + ├── subcomm1collAitemY + ├── subcomm1collB + └── subcomm1collBitem + └── subcomm2 + └── subcomm2coll + └── subcomm2collitem + */ + EPerson rootAdmin = EPersonBuilder.createEPerson(context) + .withEmail("root@admin.com").withPassword(password).build(); + EPerson subcomm1Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1@admin.com").withPassword(password).build(); + EPerson subcomm2Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm2@admin.com").withPassword(password).build(); + EPerson subcomm1collA_Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1collA@admin.com").withPassword(password).build(); + EPerson subcomm1collB_Admin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm1collB@admin.com").withPassword(password).build(); + EPerson subcomm2collAdmin = EPersonBuilder.createEPerson(context) + .withEmail("subcomm2coll@admin.com").withPassword(password).build(); + + Community root = CommunityBuilder.createCommunity(context) + .withAdminGroup(rootAdmin) + .withName("root") + .build(); + Community subcomm1 = CommunityBuilder.createSubCommunity(context, root) + .withAdminGroup(subcomm1Admin) + .withName("subcomm1") + .build(); + Community subcomm2 = CommunityBuilder.createSubCommunity(context, root) + .withAdminGroup(subcomm2Admin) + .withName("subcomm2") + .build(); + Collection subcomm1collA = CollectionBuilder.createCollection(context, subcomm1) + .withAdminGroup(subcomm1collA_Admin) + .withName("subcomm1collA") + .build(); + Collection subcomm1collB = CollectionBuilder.createCollection(context, subcomm1) + .withAdminGroup(subcomm1collB_Admin) + .withName("subcomm1collB") + .build(); + Collection subcomm2coll = CollectionBuilder.createCollection(context, subcomm2) + .withAdminGroup(subcomm2collAdmin) + .withName("subcomm2coll") + .build(); + Item subcomm1collAitemX = ItemBuilder.createItem(context, subcomm1collA).withTitle("subcomm1collAitemX") + .build(); + Item subcomm1collAitemY = ItemBuilder.createItem(context, subcomm1collA).withTitle("subcomm1collAitemY") + .build(); + Item subcomm1collBitem = ItemBuilder.createItem(context, subcomm1collB).withTitle("subcomm1collBitem") + .build(); + Item subcomm2collitem = ItemBuilder.createItem(context, subcomm2coll).withTitle("subcomm2collitem") + .build(); + context.restoreAuthSystemState(); + + String siteAdminToken = getAuthToken(admin.getEmail(), password); + String rootAdminToken = getAuthToken(rootAdmin.getEmail(), password); + String subcomm1AdminToken = getAuthToken(subcomm1Admin.getEmail(), password); + String subcomm2AdminToken = getAuthToken(subcomm2Admin.getEmail(), password); + String subcomm1collA_AdminToken = getAuthToken(subcomm1collA_Admin.getEmail(), password); + String subcomm1collB_AdminToken = getAuthToken(subcomm1collB_Admin.getEmail(), password); + String subcomm2collAdminToken = getAuthToken(subcomm2collAdmin.getEmail(), password); + + getClient(siteAdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm1collAitemX), + ItemMatcher.matchItemProperties(subcomm1collAitemY), + ItemMatcher.matchItemProperties(subcomm1collBitem), + ItemMatcher.matchItemProperties(subcomm2collitem) + ))) + .andExpect(jsonPath("$.page.totalElements", is(4))); + + getClient(rootAdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm1collAitemX), + ItemMatcher.matchItemProperties(subcomm1collAitemY), + ItemMatcher.matchItemProperties(subcomm1collBitem), + ItemMatcher.matchItemProperties(subcomm2collitem) + ))) + .andExpect(jsonPath("$.page.totalElements", is(4))); + + getClient(subcomm1AdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm1collAitemX), + ItemMatcher.matchItemProperties(subcomm1collAitemY), + ItemMatcher.matchItemProperties(subcomm1collBitem) + ))) + .andExpect(jsonPath("$.page.totalElements", is(3))); + + getClient(subcomm2AdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm2collitem) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + getClient(subcomm1collA_AdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm1collAitemX), + ItemMatcher.matchItemProperties(subcomm1collAitemY) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + getClient(subcomm1collB_AdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm1collBitem) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + getClient(subcomm2collAdminToken).perform(get("/api/core/items/search/findEditAuthorized")) + .andExpect(status().isOk()) + .andExpect(content().contentType(contentType)) + .andExpect(jsonPath("$._embedded.items", + Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(subcomm2collitem) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void addParentComAdminGroupToCheckReindexingTest() throws Exception { + context.turnOffAuthorisationSystem(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) + .withName("col1") + .build(); + + Item item = ItemBuilder.createItem(context, col1) + .withTitle("MyTest") + .build(); + + context.restoreAuthSystemState(); + + String epersonToken = getAuthToken(eperson.getEmail(), password); + getClient(epersonToken).perform(get("/api/core/items/search/findEditAuthorized") + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded").doesNotExist()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + AtomicReference idRef = new AtomicReference<>(); + ObjectMapper mapper = new ObjectMapper(); + GroupRest groupRest = new GroupRest(); + String token = getAuthToken(admin.getEmail(), password); + getClient(token).perform(post("/api/core/communities/" + parentCommunity.getID() + "/adminGroup") + .content(mapper.writeValueAsBytes(groupRest)) + .contentType(contentType)) + .andExpect(status().isCreated()) + .andDo(result -> idRef.set( + UUID.fromString(read(result.getResponse().getContentAsString(), "$.id"))) + ); + + String adminToken = getAuthToken(admin.getEmail(), password); + getClient(adminToken).perform(post("/api/eperson/groups/" + idRef.get() + "/epersons") + .contentType(parseMediaType(TEXT_URI_LIST_VALUE)) + .content(REST_SERVER_URL + "eperson/groups/" + eperson.getID() + )); + + getClient(epersonToken).perform(get("/api/core/items/search/findEditAuthorized") + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.contains(ItemMatcher + .matchItemProperties(item) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + } + + @Test + public void removeParentComAdminPolicyToCheckEditPropagationTest() throws Exception { + context.turnOffAuthorisationSystem(); + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + + ResourcePolicy policy = ResourcePolicyBuilder.createResourcePolicy(context, eperson, null) + .withDspaceObject(parentCommunity).withAction(Constants.ADMIN) + .build(); + + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) + .withName("col1") + .build(); + + Item item = ItemBuilder.createItem(context, col1) + .withTitle("MyTest") + .build(); + + context.restoreAuthSystemState(); + + String epersonToken = getAuthToken(eperson.getEmail(), password); + getClient(epersonToken).perform(get("/api/core/items/search/findEditAuthorized") + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.contains(ItemMatcher + .matchItemProperties(item) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + String token = getAuthToken(admin.getEmail(), password); + getClient(token).perform(delete("/api/authz/resourcepolicies/" + policy.getID())) + .andExpect(status().is(204)); + + getClient(epersonToken).perform(get("/api/core/items/search/findEditAuthorized") + .param("query", "MyTest")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded").doesNotExist()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + } + + @Test + public void findEditAuthorizedItemsWithQueryTest() throws Exception { + findGenericAuthorizedItemsWithQueryTest("findEditAuthorized"); + } + + public void findGenericAuthorizedItemsWithQueryTest(String method) throws Exception { + + context.turnOffAuthorisationSystem(); + + EPerson eperson2 = EPersonBuilder.createEPerson(context) + .withEmail("eperson2@mail.com") + .withPassword(password) + .build(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community") + .build(); + Community child2 = CommunityBuilder.createSubCommunity(context, parentCommunity) + .withName("Sub Community Two") + .build(); + Collection col1 = CollectionBuilder.createCollection(context, parentCommunity) + .withName("Sample collection") + .withAdminGroup(eperson) + .build(); + Collection col2 = CollectionBuilder.createCollection(context, child1) + .withName("col2") + .build(); + Collection col3 = CollectionBuilder.createCollection(context, child2) + .withName("col3") + .withAdminGroup(eperson) + .build(); + Item item1 = ItemBuilder.createItem(context, col1) + .withTitle("Sample item") + .build(); + Item item2 = ItemBuilder.createItem(context, col2) + .withTitle("Test item") + .build(); + Item item3 = ItemBuilder.createItem(context, col3) + .withTitle("Item of sample bitstreams") + .build(); + + context.restoreAuthSystemState(); + + // Test simple query + String tokenEPerson = getAuthToken(eperson.getEmail(), password); + getClient(tokenEPerson).perform(get("/api/core/items/search/" + method) + .param("query", "item")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(item1), + ItemMatcher.matchItemProperties(item3) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test case insensitive + getClient(tokenEPerson).perform(get("/api/core/items/search/" + method) + .param("query", "ITEM")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(item1), + ItemMatcher.matchItemProperties(item3) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test word for unauthorized item + getClient(tokenEPerson).perform(get("/api/core/items/search/" + method) + .param("query", "test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + // Test eperson with no authorized items + String tokenEPerson2 = getAuthToken(eperson2.getEmail(), password); + getClient(tokenEPerson2).perform(get("/api/core/items/search/" + method) + .param("query", "community")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + + // Test query as admin + String tokenAdmin = getAuthToken(admin.getEmail(), password); + getClient(tokenAdmin).perform(get("/api/core/items/search/" + method) + .param("query", "sample")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(item1), + ItemMatcher.matchItemProperties(item3) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test unsorted query words + getClient(tokenAdmin).perform(get("/api/core/items/search/" + method) + .param("query", "bitstreams sample")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.contains( + ItemMatcher.matchItemProperties(item3) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + // Test item not authorized for eperson is returned for admin + getClient(tokenAdmin).perform(get("/api/core/items/search/" + method) + .param("query", "test")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(item2) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + } + } From edfe917fae64eebe9d942a32fe6119ea2c421643 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Thu, 4 Dec 2025 15:02:44 +0100 Subject: [PATCH 039/283] Adapt getSubmitAuthorizedTypes to use inherited permissions --- .../dspace/content/EntityTypeServiceImpl.java | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/EntityTypeServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/EntityTypeServiceImpl.java index 7df892cd56f5..92a7b62e7203 100644 --- a/dspace-api/src/main/java/org/dspace/content/EntityTypeServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/EntityTypeServiceImpl.java @@ -16,6 +16,7 @@ import java.util.Set; import org.apache.commons.collections.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.response.FacetField; @@ -28,6 +29,7 @@ import org.dspace.content.service.EntityTypeService; import org.dspace.core.Constants; import org.dspace.core.Context; +import org.dspace.discovery.SearchService; import org.dspace.discovery.SolrSearchCore; import org.dspace.discovery.indexobject.IndexableCollection; import org.dspace.eperson.EPerson; @@ -49,6 +51,9 @@ public class EntityTypeServiceImpl implements EntityTypeService { @Autowired protected SolrSearchCore solrSearchCore; + @Autowired + protected SearchService searchService; + @Override public EntityType findByEntityType(Context context, String entityType) throws SQLException { return entityTypeDAO.findByEntityType(context, entityType); @@ -126,26 +131,34 @@ public List getSubmitAuthorizedTypes(Context context) throws SQLException, SolrServerException, IOException { List types = new ArrayList<>(); StringBuilder query = null; - EPerson currentUser = context.getCurrentUser(); if (!authorizeService.isAdmin(context)) { - String userId = ""; + EPerson currentUser = context.getCurrentUser(); + StringBuilder epersonAndGroupClause = new StringBuilder(); if (currentUser != null) { - userId = currentUser.getID().toString(); - query = new StringBuilder(); - query.append("submit:(e").append(userId); + epersonAndGroupClause.append("e").append(currentUser.getID()); } - + //Retrieve all the groups the current user is a member of Set groups = groupService.allMemberGroupsSet(context, currentUser); for (Group group : groups) { - if (query == null) { - query = new StringBuilder(); - query.append("submit:(g"); + if (epersonAndGroupClause.length() > 0) { + epersonAndGroupClause.append(" OR g").append(group.getID()); } else { - query.append(" OR g"); + epersonAndGroupClause.append("g").append(group.getID()); } - query.append(group.getID()); } - query.append(")"); + + if (epersonAndGroupClause.length() == 0) { + // No user or groups, no authorized types + return new ArrayList<>(); + } + query = new StringBuilder(); + query.append("submit:(").append(epersonAndGroupClause).append(")"); + query.append(" OR ").append("admin:(").append(epersonAndGroupClause).append(")"); + String locations = searchService.createLocationQueryForAdministrableDSOs(epersonAndGroupClause.toString()); + if (StringUtils.isNotBlank(locations)) { + query.append(" OR "); + query.append(locations); + } } SolrQuery sQuery = new SolrQuery("*:*"); From 14d64e88a74d51d8410169a44766b798d2c91d92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:52:26 +0000 Subject: [PATCH 040/283] build(deps): bump the test-tools group with 6 updates Bumps the test-tools group with 6 updates: | Package | From | To | | --- | --- | --- | | [io.netty:netty-buffer](https://github.com/netty/netty) | `4.2.9.Final` | `4.2.10.Final` | | [io.netty:netty-transport](https://github.com/netty/netty) | `4.2.9.Final` | `4.2.10.Final` | | [io.netty:netty-transport-native-unix-common](https://github.com/netty/netty) | `4.2.9.Final` | `4.2.10.Final` | | [io.netty:netty-common](https://github.com/netty/netty) | `4.2.9.Final` | `4.2.10.Final` | | [io.netty:netty-handler](https://github.com/netty/netty) | `4.2.9.Final` | `4.2.10.Final` | | [io.netty:netty-codec](https://github.com/netty/netty) | `4.2.9.Final` | `4.2.10.Final` | Updates `io.netty:netty-buffer` from 4.2.9.Final to 4.2.10.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.9.Final...netty-4.2.10.Final) Updates `io.netty:netty-transport` from 4.2.9.Final to 4.2.10.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.9.Final...netty-4.2.10.Final) Updates `io.netty:netty-transport-native-unix-common` from 4.2.9.Final to 4.2.10.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.9.Final...netty-4.2.10.Final) Updates `io.netty:netty-common` from 4.2.9.Final to 4.2.10.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.9.Final...netty-4.2.10.Final) Updates `io.netty:netty-handler` from 4.2.9.Final to 4.2.10.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.9.Final...netty-4.2.10.Final) Updates `io.netty:netty-codec` from 4.2.9.Final to 4.2.10.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.9.Final...netty-4.2.10.Final) --- updated-dependencies: - dependency-name: io.netty:netty-buffer dependency-version: 4.2.10.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport dependency-version: 4.2.10.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport-native-unix-common dependency-version: 4.2.10.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-common dependency-version: 4.2.10.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-handler dependency-version: 4.2.10.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-codec dependency-version: 4.2.10.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 5375686f1949..9f8f236a05a3 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -877,32 +877,32 @@ io.netty netty-buffer - 4.2.9.Final + 4.2.10.Final io.netty netty-transport - 4.2.9.Final + 4.2.10.Final io.netty netty-transport-native-unix-common - 4.2.9.Final + 4.2.10.Final io.netty netty-common - 4.2.9.Final + 4.2.10.Final io.netty netty-handler - 4.2.9.Final + 4.2.10.Final io.netty netty-codec - 4.2.9.Final + 4.2.10.Final org.apache.velocity From 7da4b55a7a09b1e776b270a6b8ad250d5c69bf29 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:56:50 +0000 Subject: [PATCH 041/283] build(deps): bump io.grpc:grpc-context from 1.78.0 to 1.79.0 Bumps [io.grpc:grpc-context](https://github.com/grpc/grpc-java) from 1.78.0 to 1.79.0. - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.78.0...v1.79.0) --- updated-dependencies: - dependency-name: io.grpc:grpc-context dependency-version: 1.79.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d659bbccdc0..d6e9e88a4dc1 100644 --- a/pom.xml +++ b/pom.xml @@ -1719,7 +1719,7 @@ io.grpc grpc-context - 1.78.0 + 1.79.0 com.google.http-client From 3faf993f73523f1c753b4d893ea993f9f913454d Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 18 Feb 2026 16:56:21 -0600 Subject: [PATCH 042/283] Install Apache Ant via apt-get instead of manual download. Manual download has a tendency to fail randomly in automated Docker builds. (cherry picked from commit d2abf0f7a0ab28af8d2f8c46782f637db2cf641a) --- Dockerfile | 15 +++++---------- Dockerfile.cli | 15 +++++---------- Dockerfile.test | 15 +++++---------- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/Dockerfile b/Dockerfile index 102f00abe1f7..1651c43a5a3f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,16 +38,11 @@ ARG TARGET_DIR=dspace-installer # COPY the /install directory from 'build' container to /dspace-src in this container COPY --from=build /install /dspace-src WORKDIR /dspace-src -# Create the initial install deployment using ANT -ENV ANT_VERSION=1.10.13 -ENV ANT_HOME=/tmp/ant-$ANT_VERSION -ENV PATH=$ANT_HOME/bin:$PATH -# Download and install 'ant' -RUN mkdir $ANT_HOME && \ - curl --silent --show-error --location --fail --retry 5 --output /tmp/apache-ant.tar.gz \ - https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \ - tar -zx --strip-components=1 -f /tmp/apache-ant.tar.gz -C $ANT_HOME && \ - rm /tmp/apache-ant.tar.gz +# Install Apache Ant +RUN apt-get update \ + && apt-get install -y --no-install-recommends ant \ + && apt-get purge -y --auto-remove \ + && rm -rf /var/lib/apt/lists/* # Run necessary 'ant' deploy scripts RUN ant init_installation update_configs update_code update_webapps diff --git a/Dockerfile.cli b/Dockerfile.cli index e208e3d92145..e0d6a18d951d 100644 --- a/Dockerfile.cli +++ b/Dockerfile.cli @@ -34,16 +34,11 @@ ARG TARGET_DIR=dspace-installer # COPY the /install directory from 'build' container to /dspace-src in this container COPY --from=build /install /dspace-src WORKDIR /dspace-src -# Create the initial install deployment using ANT -ENV ANT_VERSION=1.10.13 -ENV ANT_HOME=/tmp/ant-$ANT_VERSION -ENV PATH=$ANT_HOME/bin:$PATH -# Download and install 'ant' -RUN mkdir $ANT_HOME && \ - curl --silent --show-error --location --fail --retry 5 --output /tmp/apache-ant.tar.gz \ - https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \ - tar -zx --strip-components=1 -f /tmp/apache-ant.tar.gz -C $ANT_HOME && \ - rm /tmp/apache-ant.tar.gz +# Install Apache Ant +RUN apt-get update \ + && apt-get install -y --no-install-recommends ant \ + && apt-get purge -y --auto-remove \ + && rm -rf /var/lib/apt/lists/* # Run necessary 'ant' deploy scripts RUN ant init_installation update_configs update_code diff --git a/Dockerfile.test b/Dockerfile.test index cc73c655b637..9779761ec897 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -37,16 +37,11 @@ ARG TARGET_DIR=dspace-installer # COPY the /install directory from 'build' container to /dspace-src in this container COPY --from=build /install /dspace-src WORKDIR /dspace-src -# Create the initial install deployment using ANT -ENV ANT_VERSION=1.10.12 -ENV ANT_HOME=/tmp/ant-$ANT_VERSION -ENV PATH=$ANT_HOME/bin:$PATH -# Download and install 'ant' -RUN mkdir $ANT_HOME && \ - curl --silent --show-error --location --fail --retry 5 --output /tmp/apache-ant.tar.gz \ - https://archive.apache.org/dist/ant/binaries/apache-ant-${ANT_VERSION}-bin.tar.gz && \ - tar -zx --strip-components=1 -f /tmp/apache-ant.tar.gz -C $ANT_HOME && \ - rm /tmp/apache-ant.tar.gz +# Install Apache Ant +RUN apt-get update \ + && apt-get install -y --no-install-recommends ant \ + && apt-get purge -y --auto-remove \ + && rm -rf /var/lib/apt/lists/* # Run necessary 'ant' deploy scripts RUN ant init_installation update_configs update_code update_webapps From 2cf99fd89c82f375c684be824fa0baa4ea6a9001 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 17:24:42 +0000 Subject: [PATCH 043/283] build(deps): bump org.postgresql:postgresql from 42.7.9 to 42.7.10 Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.9 to 42.7.10. - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.7.9...REL42.7.10) --- updated-dependencies: - dependency-name: org.postgresql:postgresql dependency-version: 42.7.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d659bbccdc0..cea1e14371ef 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 5.7.14 5.6.15.Final 6.2.5.Final - 42.7.9 + 42.7.10 8.11.4 3.11.1 From 2c496c3c843e7c3be2a4022264cdc77b40d7b5f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 17:27:25 +0000 Subject: [PATCH 044/283] build(deps): bump the build-tools group with 2 updates Bumps the build-tools group with 2 updates: [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) and [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin). Updates `org.apache.maven.plugins:maven-compiler-plugin` from 3.14.1 to 3.15.0 - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.14.1...maven-compiler-plugin-3.15.0) Updates `org.apache.maven.plugins:maven-dependency-plugin` from 3.9.0 to 3.10.0 - [Release notes](https://github.com/apache/maven-dependency-plugin/releases) - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.9.0...maven-dependency-plugin-3.10.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-version: 3.15.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-version: 3.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0d659bbccdc0..8685acbd857f 100644 --- a/pom.xml +++ b/pom.xml @@ -141,7 +141,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.1 + 3.15.0 11 @@ -341,7 +341,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.9.0 + 3.10.0 org.apache.maven.plugins From 865b9084d308582d2aa0b11f7ea4e3e799d51ad4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 17:48:10 +0000 Subject: [PATCH 045/283] build(deps): bump the amazon-s3 group with 2 updates Bumps the amazon-s3 group with 2 updates: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.41.14 to 2.41.24 Updates `software.amazon.awssdk.crt:aws-crt` from 0.42.2 to 0.43.1 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.42.2...v0.43.1) --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.41.24 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.43.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 9f8f236a05a3..244e26fe1616 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -739,7 +739,7 @@ software.amazon.awssdk s3 - 2.41.14 + 2.41.28 software.amazon.awssdk @@ -755,7 +755,7 @@ software.amazon.awssdk.crt aws-crt - 0.42.2 + 0.43.1 From 278b857633c0e2b6f233b822da06890ff5a17c9e Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Fri, 20 Feb 2026 21:32:54 +0300 Subject: [PATCH 046/283] Pin jboss-logging version jboss-logging is a transitive dependency and it causes dependency convergence errors because various hibernate components pull in different versions. We should be pinning this to the same version used by the hibernate parent and disabling dependabot updates for it. See: https://github.com/hibernate/hibernate-orm/blob/5.6/gradle/libraries.gradle#L93 See: https://github.com/DSpace/DSpace/blob/main/.github/dependabot.yml --- pom.xml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0d659bbccdc0..507defcf4767 100644 --- a/pom.xml +++ b/pom.xml @@ -1143,11 +1143,21 @@ ${hibernate-validator.version} - + org.jboss.logging jboss-logging - 3.6.1.Final + 3.4.3.Final From 00d72a1de9c21a79812685692d416b1014f0a41b Mon Sep 17 00:00:00 2001 From: Abhinav S <42234845+AbhinavS96@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:41:48 +0000 Subject: [PATCH 047/283] Merge pull request #11995 from atmire/w2p-138764_fix-11880-openaire-xsl-crosswalk-contribute-7_x [Port dspace-7_x] Fix OAI-PMH: OpenAIRE XSL crosswalk: bogus resourcetype exposed if the repository uses dc.type.* fields with a qualifier --- dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl b/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl index 470a7c7211f4..b387ead35c9d 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl @@ -796,7 +796,7 @@ - + @@ -1429,7 +1429,7 @@ literature - + dataset From 0a52d1535607a4735876be8a5423fce85bcb5f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Gra=C3=A7a?= Date: Wed, 25 Feb 2026 12:44:27 +0000 Subject: [PATCH 048/283] remove unsed collection definition --- .../SubmissionDefinitionConverter.java | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java index a84545520463..65f43096df44 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/converter/SubmissionDefinitionConverter.java @@ -7,24 +7,16 @@ */ package org.dspace.app.rest.converter; -import java.sql.SQLException; import java.util.LinkedList; import java.util.List; -import java.util.stream.Collectors; -import javax.servlet.http.HttpServletRequest; import org.apache.logging.log4j.Logger; -import org.dspace.app.rest.model.CollectionRest; import org.dspace.app.rest.model.SubmissionDefinitionRest; import org.dspace.app.rest.model.SubmissionSectionRest; import org.dspace.app.rest.projection.Projection; import org.dspace.app.rest.submit.DataProcessingStep; -import org.dspace.app.rest.utils.ContextUtil; import org.dspace.app.util.SubmissionConfig; -import org.dspace.app.util.SubmissionConfigReaderException; import org.dspace.app.util.SubmissionStepConfig; -import org.dspace.content.Collection; -import org.dspace.core.Context; import org.dspace.services.RequestService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -76,20 +68,6 @@ public SubmissionDefinitionRest convert(SubmissionConfig obj, Projection project } } - HttpServletRequest request = requestService.getCurrentRequest().getHttpServletRequest(); - Context context = null; - try { - context = ContextUtil.obtainContext(request); - List collections = panelConverter.getSubmissionConfigService() - .getCollectionsBySubmissionConfig(context, - obj.getSubmissionName()); - DSpaceConverter cc = converter.getConverter(Collection.class); - List collectionsRest = collections.stream().map((collection) -> - cc.convert(collection, projection)).collect(Collectors.toList()); - sd.setCollections(collectionsRest); - } catch (SQLException | IllegalStateException | SubmissionConfigReaderException e) { - log.error(e.getMessage(), e); - } sd.setPanels(panels); return sd; } From 6b2e1f938ba15f31a9b973700403128f714d9a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Gra=C3=A7a?= Date: Wed, 25 Feb 2026 12:46:52 +0000 Subject: [PATCH 049/283] empty submission definition collections --- .../dspace/app/rest/matcher/SubmissionDefinitionsMatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionDefinitionsMatcher.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionDefinitionsMatcher.java index 398097db6fba..14d8e5143815 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionDefinitionsMatcher.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/matcher/SubmissionDefinitionsMatcher.java @@ -34,7 +34,7 @@ public static Matcher matchSubmissionDefinition(boolean isDefault, Strin */ public static Matcher matchFullEmbeds() { return matchEmbeds( - "collections[]", + "collections", "sections" ); } From 3b000d7c864bb8e183176afe2cfb285e592efdb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paulo=20Gra=C3=A7a?= Date: Wed, 25 Feb 2026 12:49:26 +0000 Subject: [PATCH 050/283] adjust test for fixing issue - 10750 --- .../org/dspace/app/rest/SubmissionDefinitionsControllerIT.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionDefinitionsControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionDefinitionsControllerIT.java index a4ef63afa6ef..b2064cf21f7d 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionDefinitionsControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SubmissionDefinitionsControllerIT.java @@ -190,8 +190,7 @@ public void findCollections() throws Exception { //Match only that a section exists with a submission configuration behind getClient(token).perform(get("/api/config/submissiondefinitions/traditional/collections") .param("projection", "full")) - .andExpect(status().isOk()) - .andExpect(jsonPath("$.page.totalElements", is(0))); + .andExpect(status().isNoContent()); } @Test From cdd5ca062709b37de1c2df20546b174ddacb8567 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 21:12:04 +0000 Subject: [PATCH 051/283] build(deps): bump docker/build-push-action from 5 to 6 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/reusable-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 86da7b9788ff..94193a73e9c6 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -148,7 +148,7 @@ jobs: - name: Build and push image to ${{ env.DOCKER_BUILD_REGISTRY }} if: ${{ ! matrix.isPr }} id: docker_build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: build-contexts: | ${{ inputs.dockerfile_additional_contexts }} @@ -202,7 +202,7 @@ jobs: # NOTE: This step cannot be combined with the build above as it's a different type of output. - name: Build and push image to local TAR file if: ${{ matrix.arch == 'linux/amd64'}} - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: build-contexts: | ${{ inputs.dockerfile_additional_contexts }} From 7734a57e523d5698ecdf16b6151275074d3b8d4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 14:33:23 +0100 Subject: [PATCH 052/283] build(deps): bump actions/checkout from 4 to 6 (#12021) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- .github/workflows/codescan.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/port_merged_pull_request.yml | 2 +- .github/workflows/reusable-docker-build.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8b3cb1d017a1..2c0141ac2095 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout codebase - uses: actions/checkout@v4 + uses: actions/checkout@v6 # https://github.com/actions/setup-java - name: Install JDK ${{ matrix.java }} @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 # Download artifacts from previous 'tests' job - name: Download coverage artifacts diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index 88931d478e6f..e041233a7e36 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -35,7 +35,7 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 # https://github.com/actions/setup-java - name: Install JDK diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 079900745210..ac226a4582c9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -182,7 +182,7 @@ jobs: steps: # Checkout our codebase (to get access to Docker Compose scripts) - name: Checkout codebase - uses: actions/checkout@v4 + uses: actions/checkout@v6 # Download Docker image artifacts (which were just built by reusable-docker-build.yml) - name: Download Docker image artifacts uses: actions/download-artifact@v4 diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml index 857f22755e49..6c63ffa83129 100644 --- a/.github/workflows/port_merged_pull_request.yml +++ b/.github/workflows/port_merged_pull_request.yml @@ -23,7 +23,7 @@ jobs: if: github.event.pull_request.merged steps: # Checkout code - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 # Port PR to other branch (ONLY if labeled with "port to") # See https://github.com/korthout/backport-action - name: Create backport pull requests diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 86da7b9788ff..ecd667ec9fdb 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -110,7 +110,7 @@ jobs: # https://github.com/actions/checkout - name: Checkout codebase - uses: actions/checkout@v4 + uses: actions/checkout@v6 # https://github.com/docker/login-action # NOTE: This login occurs for BOTH non-PRs or PRs. PRs *must* also login to access private images from GHCR From 327dd3ef9f016f3d72ebc64f168515d2e0aef5bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 14:33:49 +0100 Subject: [PATCH 053/283] build(deps): bump toshimaru/auto-author-assign from 2.1.0 to 3.0.1 (#12023) Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 2.1.0 to 3.0.1. - [Release notes](https://github.com/toshimaru/auto-author-assign/releases) - [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md) - [Commits](https://github.com/toshimaru/auto-author-assign/compare/v2.1.0...v3.0.1) --- updated-dependencies: - dependency-name: toshimaru/auto-author-assign dependency-version: 3.0.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pull_request_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml index bbac52af2438..e2b6e8ba9c2c 100644 --- a/.github/workflows/pull_request_opened.yml +++ b/.github/workflows/pull_request_opened.yml @@ -21,4 +21,4 @@ jobs: # Assign the PR to whomever created it. This is useful for visualizing assignments on project boards # See https://github.com/toshimaru/auto-author-assign - name: Assign PR to creator - uses: toshimaru/auto-author-assign@v2.1.0 + uses: toshimaru/auto-author-assign@v3.0.1 From 4a0f71210855173370f3e86a3b405b97e1b4f938 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 14:34:09 +0100 Subject: [PATCH 054/283] build(deps): bump the amazon-s3 group with 2 updates (#12025) Bumps the amazon-s3 group with 2 updates: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.41.28 to 2.41.33 Updates `software.amazon.awssdk.crt:aws-crt` from 0.43.1 to 0.43.4 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.43.1...v0.43.4) --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.41.33 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.43.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 244e26fe1616..27951088f9a6 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -739,7 +739,7 @@ software.amazon.awssdk s3 - 2.41.28 + 2.41.33 software.amazon.awssdk @@ -755,7 +755,7 @@ software.amazon.awssdk.crt aws-crt - 0.43.1 + 0.43.4 From c416fb092e6a5be02a809810de189e10189904bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 13:57:27 +0000 Subject: [PATCH 055/283] build(deps): bump actions/setup-java from 4 to 5 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/codescan.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c0141ac2095..fbe21fa89f27 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: # https://github.com/actions/setup-java - name: Install JDK ${{ matrix.java }} - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: ${{ matrix.java }} distribution: 'temurin' diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index e041233a7e36..ba56b683a27d 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -39,7 +39,7 @@ jobs: # https://github.com/actions/setup-java - name: Install JDK - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: 11 distribution: 'temurin' From 33498332362b8b5238349940eca81cc61d365135 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 1 Mar 2026 13:58:49 +0000 Subject: [PATCH 056/283] build(deps): bump korthout/backport-action from 2 to 4 Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 2 to 4. - [Release notes](https://github.com/korthout/backport-action/releases) - [Commits](https://github.com/korthout/backport-action/compare/v2...v4) --- updated-dependencies: - dependency-name: korthout/backport-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/port_merged_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml index 6c63ffa83129..676ad45ba263 100644 --- a/.github/workflows/port_merged_pull_request.yml +++ b/.github/workflows/port_merged_pull_request.yml @@ -27,7 +27,7 @@ jobs: # Port PR to other branch (ONLY if labeled with "port to") # See https://github.com/korthout/backport-action - name: Create backport pull requests - uses: korthout/backport-action@v2 + uses: korthout/backport-action@v4 with: # Trigger based on a "port to [branch]" label on PR # (This label must specify the branch name to port to) From c872c7c0378ba700c05129675b3385b99889df8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:47:21 +0000 Subject: [PATCH 057/283] build(deps): bump the fasterxml group with 2 updates Bumps the fasterxml group with 2 updates: [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core) and [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson). Updates `com.fasterxml.jackson.core:jackson-core` from 2.21.0 to 2.21.1 - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.21.0...jackson-core-2.21.1) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.0 to 2.21.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.0 to 2.21.1 - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-version: 2.21.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9bd75b2618ea..24c818e28797 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.11.1 2.31.0 - 2.21.0 + 2.21.1 2.21 1.3.2 2.3.1 From c280dac0ba17abf92eb1f388e6caedcc9d73fe3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:10:05 +0000 Subject: [PATCH 058/283] build(deps): bump Wandalen/wretry.action from 1.3.0 to 3.8.0 Bumps [Wandalen/wretry.action](https://github.com/wandalen/wretry.action) from 1.3.0 to 3.8.0. - [Release notes](https://github.com/wandalen/wretry.action/releases) - [Commits](https://github.com/wandalen/wretry.action/compare/v1.3.0...v3.8.0) --- updated-dependencies: - dependency-name: Wandalen/wretry.action dependency-version: 3.8.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c0141ac2095..11b155602f89 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,7 +99,7 @@ jobs: # Retry action: https://github.com/marketplace/actions/retry-action # Codecov action: https://github.com/codecov/codecov-action - name: Upload coverage to Codecov.io - uses: Wandalen/wretry.action@v1.3.0 + uses: Wandalen/wretry.action@v3.8.0 with: action: codecov/codecov-action@v4 # Ensure codecov-action throws an error when it fails to upload From 99e8e21aaf3cc772c48d78f2371c511dd52d115b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:11:29 +0000 Subject: [PATCH 059/283] build(deps): bump actions/add-to-project from 1.0.0 to 1.0.2 Bumps [actions/add-to-project](https://github.com/actions/add-to-project) from 1.0.0 to 1.0.2. - [Release notes](https://github.com/actions/add-to-project/releases) - [Commits](https://github.com/actions/add-to-project/compare/v1.0.0...v1.0.2) --- updated-dependencies: - dependency-name: actions/add-to-project dependency-version: 1.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/issue_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_opened.yml b/.github/workflows/issue_opened.yml index 0a35a6a95044..c8c421d98f47 100644 --- a/.github/workflows/issue_opened.yml +++ b/.github/workflows/issue_opened.yml @@ -16,7 +16,7 @@ jobs: # Only add to project board if issue is flagged as "needs triage" or has no labels # NOTE: By default we flag new issues as "needs triage" in our issue template if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') - uses: actions/add-to-project@v1.0.0 + uses: actions/add-to-project@v1.0.2 # Note, the authentication token below is an ORG level Secret. # It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token From 726079a3249db45a94e29ca2eecc97194187b671 Mon Sep 17 00:00:00 2001 From: MMilosz Date: Mon, 2 Mar 2026 16:23:21 +0100 Subject: [PATCH 060/283] chore(submission): set repeatable=false for dc.description in bitstream-metadata #12039 (cherry picked from commit c301804561a6cedb4256a661fed262566856c638) --- dspace/config/submission-forms.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace/config/submission-forms.xml b/dspace/config/submission-forms.xml index ff4af24fb3e7..e7df395f1652 100644 --- a/dspace/config/submission-forms.xml +++ b/dspace/config/submission-forms.xml @@ -39,7 +39,7 @@ dc description - true + false textarea Enter a description for the file From 7221e16e8d466c9746e23f959b0773062dee9ac1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 22:42:15 +0000 Subject: [PATCH 061/283] build(deps): bump actions/download-artifact from 4 to 8 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v4...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/reusable-docker-build.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 062f2c7c2f70..6b0f086e7894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -91,7 +91,7 @@ jobs: # Download artifacts from previous 'tests' job - name: Download coverage artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 # Now attempt upload to Codecov using its action. # NOTE: We use a retry action to retry the Codecov upload if it fails the first time. diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ac226a4582c9..96a577bf3e3c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -185,7 +185,7 @@ jobs: uses: actions/checkout@v6 # Download Docker image artifacts (which were just built by reusable-docker-build.yml) - name: Download Docker image artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: # Download all amd64 Docker images (TAR files) into the /tmp/docker directory pattern: docker-image-*-linux-amd64 diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 57d0f5dbb823..46c7ceb1cd91 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -246,7 +246,7 @@ jobs: - docker-build steps: - name: Download Docker build digests - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: /tmp/digests # Download digests for both AMD64 and ARM64 into same directory From 4b7465751cb1370c862c02119ac7302dfe43e899 Mon Sep 17 00:00:00 2001 From: abhinav Date: Tue, 3 Mar 2026 10:45:29 +0100 Subject: [PATCH 062/283] fix multiple empty datasite:sizes tags (cherry picked from commit 1a93f9a60b07acf5e58a24b0f3a9a320616d91db) --- .../crosswalks/oai/metadataFormats/oai_openaire.xsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl b/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl index bc8a3ae20006..dd1ff556c63c 100644 --- a/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl +++ b/dspace/config/crosswalks/oai/metadataFormats/oai_openaire.xsl @@ -851,13 +851,13 @@ - - + + - - + + From ecd76cffddec40f8f0d552e2dac9948cdde4bdf0 Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Fri, 20 Feb 2026 10:31:25 +0100 Subject: [PATCH 063/283] Update authorized Solr searches to escape queries and include dc.title_sort for queries with spaces (cherry picked from commit c1bcd0e7845b223b3ee136359a275880bf8d8004) --- .../authorize/AuthorizeServiceImpl.java | 4 ++ .../dspace/content/CollectionServiceImpl.java | 8 +--- .../org/dspace/content/ItemServiceImpl.java | 3 ++ .../org/dspace/discovery/SearchService.java | 9 ++++ .../org/dspace/discovery/SolrServiceImpl.java | 21 +++++++++ .../app/rest/CollectionRestRepositoryIT.java | 42 ++++++++++++++++-- .../app/rest/CommunityRestRepositoryIT.java | 41 +++++++++++++++-- .../dspace/app/rest/ItemRestRepositoryIT.java | 44 +++++++++++++++++-- 8 files changed, 156 insertions(+), 16 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java index 202d5d42aa07..4a1e2f86d1a8 100644 --- a/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/authorize/AuthorizeServiceImpl.java @@ -812,6 +812,7 @@ public List findAuthorizedCommunityByAction(Context context, String q int limit) throws SearchServiceException { List communities = new ArrayList<>(); + query = searchService.formatAutoCompleteQuery(query, "dc.title_sort"); query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + IndexableCommunity.TYPE, action, true, @@ -849,6 +850,7 @@ public long countAdminAuthorizedCommunity(Context context, String query) @Override public long countAuthorizedCommunityByAction(Context context, String query, int action) throws SearchServiceException { + query = searchService.formatAutoCompleteQuery(query, "dc.title_sort"); query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + IndexableCommunity.TYPE, action, true, @@ -892,6 +894,7 @@ public List findAuthorizedCollectionByAction(Context context, String return collections; } + query = searchService.formatAutoCompleteQuery(query, "dc.title_sort"); query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE, action, true, @@ -929,6 +932,7 @@ public long countAdminAuthorizedCollection(Context context, String query) @Override public long countAuthorizedCollectionByAction(Context context, String query, int action) throws SearchServiceException { + query = searchService.formatAutoCompleteQuery(query, "dc.title_sort"); query = formatCustomQuery(query); DiscoverResult discoverResult = getDiscoverResult(context, query + RESOURCE_TYPE_FIELD + ":" + IndexableCollection.TYPE, action, diff --git a/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java index a22f2accceae..d0ec8ccc0cc4 100644 --- a/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/CollectionServiceImpl.java @@ -28,7 +28,6 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; -import org.apache.solr.client.solrj.util.ClientUtils; import org.dspace.app.util.AuthorizeUtil; import org.dspace.authorize.AuthorizeConfiguration; import org.dspace.authorize.AuthorizeException; @@ -1086,11 +1085,8 @@ private DiscoverResult retrieveCollectionsWithSubmit(Context context, DiscoverQu discoverQuery.addFilterQueries("search.entitytype:" + entityType); } if (StringUtils.isNotBlank(q)) { - StringBuilder buildQuery = new StringBuilder(); - String escapedQuery = ClientUtils.escapeQueryChars(q); - buildQuery.append("(").append(escapedQuery).append(" OR dc.title_sort:*") - .append(escapedQuery).append("*").append(")"); - discoverQuery.setQuery(buildQuery.toString()); + q = searchService.formatAutoCompleteQuery(q, "dc.title_sort"); + discoverQuery.setQuery(q); } discoverQuery.addRequiredAuthorization(Constants.ADD); DiscoverResult resp = searchService.search(context, discoverQuery); diff --git a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java index 825b452d425a..c40b412eacb9 100644 --- a/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java @@ -1260,6 +1260,9 @@ public boolean canEdit(Context context, Item item) throws SQLException { private DiscoverResult retrieveItemsWithEdit(Context context, DiscoverQuery discoverQuery, String q) throws SearchServiceException { if (StringUtils.isNotBlank(q)) { + // Although not all items will have a metadata dc.title, we use it for autocomplete because it is the + // most common. Ideally, we should use a field that all indexed items have + q = searchService.formatAutoCompleteQuery(q, "dc.title_sort"); discoverQuery.setQuery(q); } discoverQuery.addRequiredAuthorization(Constants.WRITE); diff --git a/dspace-api/src/main/java/org/dspace/discovery/SearchService.java b/dspace-api/src/main/java/org/dspace/discovery/SearchService.java index 7f4c85c3a864..986b2d23de2a 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SearchService.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SearchService.java @@ -126,6 +126,15 @@ List getRelatedItems(Context context, Item item, */ String escapeQueryChars(String query); + /** + * Utility method to format an autocomplete query over a specific field. + * + * @param query to search for + * @param autocompleteField the field to use to autocomplete search, if null or empty no field is used + * @return the constructed solr query + */ + String formatAutoCompleteQuery(String query, String autocompleteField); + FacetYearRange getFacetYearRange(Context context, IndexableObject scope, DiscoverySearchFilterFacet facet, List filterQueries, DiscoverQuery parentQuery) throws SearchServiceException; diff --git a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java index acfd37ef5e62..09514504fed4 100644 --- a/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/discovery/SolrServiceImpl.java @@ -1676,6 +1676,27 @@ public String escapeQueryChars(String query) { return ClientUtils.escapeQueryChars(query); } + /** + * Utility method to format an autocomplete query over a specific field. Combines the escaped query with a + * wildcard search over the specified {@code autocompleteField}. This field is typically non-tokenized and + * allows recovering searches containing spaces as a single value. + * + * @param query the user input to search for + * @param autocompleteField non-tokenized field used for wildcard autocomplete + * @return the constructed Solr query, or the original query if blank + */ + @Override + public String formatAutoCompleteQuery(String query, String autocompleteField) { + if (StringUtils.isNotBlank(query)) { + StringBuilder buildQuery = new StringBuilder(); + String escapedQuery = escapeQueryChars(query); + buildQuery.append("(").append(escapedQuery).append(" OR ").append(autocompleteField).append(":*") + .append(escapedQuery).append("*").append(")"); + return buildQuery.toString(); + } + return query; + } + @Override public FacetYearRange getFacetYearRange(Context context, IndexableObject scope, DiscoverySearchFilterFacet facet, List filterQueries, diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java index 26eda3b06c91..0fa71dd06756 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CollectionRestRepositoryIT.java @@ -3947,6 +3947,13 @@ public void findGenericAuthorizedCollectionsWithQueryTest(String method) throws .withName("Collection of sample items") .withAdminGroup(eperson) .build(); + Collection col4 = CollectionBuilder.createCollection(context, child2) + .withName("Testing autocomplete in collection") + .withAdminGroup(eperson2) + .build(); + Collection col5 = CollectionBuilder.createCollection(context, child2) + .withName("Title: subtitle (special characters)") + .build(); context.restoreAuthSystemState(); String tokenEPerson = getAuthToken(eperson.getEmail(), password); @@ -3977,11 +3984,29 @@ public void findGenericAuthorizedCollectionsWithQueryTest(String method) throws .andExpect(jsonPath("$.page.totalElements", is(0))); // Test eperson with no authorized collections + getClient(tokenEPerson).perform(get("/api/core/collections/search/" + method) + .param("query", "auto")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + String tokenEPerson2 = getAuthToken(eperson2.getEmail(), password); + // Test eperson2 gets only their authorized collection getClient(tokenEPerson2).perform(get("/api/core/collections/search/" + method) - .param("query", "collection")) + .param("query", "auto")) .andExpect(status().isOk()) - .andExpect(jsonPath("$.page.totalElements", is(0))); + .andExpect(jsonPath("$._embedded.collections", Matchers.contains( + CollectionMatcher.matchProperties(col4.getName(), col4.getID(), col4.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + // Test query with multiple words + getClient(tokenEPerson2).perform(get("/api/core/collections/search/" + method) + .param("query", "testing auto")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.containsInAnyOrder( + CollectionMatcher.matchProperties(col4.getName(), col4.getID(), col4.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); // Test admin gets all authorized collections String tokenAdmin = getAuthToken(admin.getEmail(), password); @@ -4008,10 +4033,19 @@ public void findGenericAuthorizedCollectionsWithQueryTest(String method) throws .param("query", "test")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.collections", Matchers.containsInAnyOrder( - CollectionMatcher.matchProperties(col2.getName(), col2.getID(), col2.getHandle()) + CollectionMatcher.matchProperties(col2.getName(), col2.getID(), col2.getHandle()), + CollectionMatcher.matchProperties(col4.getName(), col4.getID(), col4.getHandle()) ))) - .andExpect(jsonPath("$.page.totalElements", is(1))); + .andExpect(jsonPath("$.page.totalElements", is(2))); + // Test query with special characters + getClient(tokenAdmin).perform(get("/api/core/collections/search/" + method) + .param("query", "title: subtitle (special")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.collections", Matchers.contains( + CollectionMatcher.matchProperties(col5.getName(), col5.getID(), col5.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); } } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java index 6cc25f22ce93..9440bb0edccc 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/CommunityRestRepositoryIT.java @@ -3171,6 +3171,13 @@ public void findGenericAuthorizedCommunitiesWithQueryTest(String method) throws .withName("community of sample items") .withAdminGroup(eperson) .build(); + Community com4 = CommunityBuilder.createSubCommunity(context, child2) + .withName("Testing autocomplete in community") + .withAdminGroup(eperson2) + .build(); + Community com5 = CommunityBuilder.createSubCommunity(context, child2) + .withName("Title: subtitle (special characters)") + .build(); context.restoreAuthSystemState(); // Test simple query @@ -3201,11 +3208,29 @@ public void findGenericAuthorizedCommunitiesWithQueryTest(String method) throws .andExpect(jsonPath("$.page.totalElements", is(0))); // Test eperson with no authorized communities + getClient(tokenEPerson).perform(get("/api/core/communities/search/" + method) + .param("query", "auto")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + String tokenEPerson2 = getAuthToken(eperson2.getEmail(), password); + // Test eperson2 gets only their authorized community getClient(tokenEPerson2).perform(get("/api/core/communities/search/" + method) - .param("query", "community")) + .param("query", "auto")) .andExpect(status().isOk()) - .andExpect(jsonPath("$.page.totalElements", is(0))); + .andExpect(jsonPath("$._embedded.communities", Matchers.contains( + CommunityMatcher.matchProperties(com4.getName(), com4.getID(), com4.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + // Test query with multiple words + getClient(tokenEPerson2).perform(get("/api/core/communities/search/" + method) + .param("query", "testing auto")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder( + CommunityMatcher.matchProperties(com4.getName(), com4.getID(), com4.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); // Test as admin String tokenAdmin = getAuthToken(admin.getEmail(), password); @@ -3232,7 +3257,17 @@ public void findGenericAuthorizedCommunitiesWithQueryTest(String method) throws .param("query", "test")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.communities", Matchers.containsInAnyOrder( - CommunityMatcher.matchProperties(com2.getName(), com2.getID(), com2.getHandle()) + CommunityMatcher.matchProperties(com2.getName(), com2.getID(), com2.getHandle()), + CommunityMatcher.matchProperties(com4.getName(), com4.getID(), com4.getHandle()) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test query with special characters + getClient(tokenAdmin).perform(get("/api/core/communities/search/" + method) + .param("query", "title: subtitle")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.communities", Matchers.contains( + CommunityMatcher.matchProperties(com5.getName(), com5.getID(), com5.getHandle()) ))) .andExpect(jsonPath("$.page.totalElements", is(1))); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java index a77938eeb32b..76470920a9fa 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemRestRepositoryIT.java @@ -5089,6 +5089,10 @@ public void findGenericAuthorizedItemsWithQueryTest(String method) throws Except .withName("col3") .withAdminGroup(eperson) .build(); + Collection col4 = CollectionBuilder.createCollection(context, child2) + .withName("col4") + .withAdminGroup(eperson2) + .build(); Item item1 = ItemBuilder.createItem(context, col1) .withTitle("Sample item") .build(); @@ -5098,6 +5102,12 @@ public void findGenericAuthorizedItemsWithQueryTest(String method) throws Except Item item3 = ItemBuilder.createItem(context, col3) .withTitle("Item of sample bitstreams") .build(); + Item item4 = ItemBuilder.createItem(context, col4) + .withTitle("Testing autocomplete in items") + .build(); + Item item5 = ItemBuilder.createItem(context, col4) + .withTitle("Title: subtitle (special characters)") + .build(); context.restoreAuthSystemState(); @@ -5129,11 +5139,29 @@ public void findGenericAuthorizedItemsWithQueryTest(String method) throws Except .andExpect(jsonPath("$.page.totalElements", is(0))); // Test eperson with no authorized items + getClient(tokenEPerson).perform(get("/api/core/items/search/" + method) + .param("query", "auto")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.page.totalElements", is(0))); + String tokenEPerson2 = getAuthToken(eperson2.getEmail(), password); + // Test eperson2 with one authorized item getClient(tokenEPerson2).perform(get("/api/core/items/search/" + method) - .param("query", "community")) + .param("query", "auto")) .andExpect(status().isOk()) - .andExpect(jsonPath("$.page.totalElements", is(0))); + .andExpect(jsonPath("$._embedded.items", Matchers.contains( + ItemMatcher.matchItemProperties(item4) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); + + // Test query with multiple words + getClient(tokenEPerson2).perform(get("/api/core/items/search/" + method) + .param("query", "testing auto")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.containsInAnyOrder( + ItemMatcher.matchItemProperties(item4) + ))) + .andExpect(jsonPath("$.page.totalElements", is(1))); // Test query as admin String tokenAdmin = getAuthToken(admin.getEmail(), password); @@ -5160,7 +5188,17 @@ public void findGenericAuthorizedItemsWithQueryTest(String method) throws Except .param("query", "test")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.items", Matchers.containsInAnyOrder( - ItemMatcher.matchItemProperties(item2) + ItemMatcher.matchItemProperties(item2), + ItemMatcher.matchItemProperties(item4) + ))) + .andExpect(jsonPath("$.page.totalElements", is(2))); + + // Test special characters in query + getClient(tokenAdmin).perform(get("/api/core/items/search/" + method) + .param("query", "title: subtitle (special")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.items", Matchers.contains( + ItemMatcher.matchItemProperties(item5) ))) .andExpect(jsonPath("$.page.totalElements", is(1))); From 218d0360a87c29b5e7d2c553e40a9b28268ec34c Mon Sep 17 00:00:00 2001 From: Piaget Bouaka Donfack Date: Tue, 23 Sep 2025 12:45:50 +0200 Subject: [PATCH 064/283] [DURACOM-389] Import from external sources creates invalid metadata (cherry picked from commit 255b1dd15ef926b88361ab6c1ad3ec3ed7f6f30f) --- .../external/crossref/CrossRefAbstractProcessor.java | 8 ++++++++ .../contributor/SimpleJsonPathMetadataContributor.java | 3 +++ 2 files changed, 11 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAbstractProcessor.java b/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAbstractProcessor.java index 99f1ee37a54e..d54c70c31984 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAbstractProcessor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/crossref/CrossRefAbstractProcessor.java @@ -95,6 +95,14 @@ private String prettifyAbstract(String abstractValue) { sb.append("\n"); } sb.append("\n"); + } else if (StringUtils.equals(nodeName, "jats:p")) { + NodeList secElements = childElement.getChildNodes(); + for (int j = 0; j < secElements.getLength(); j++) { + Node secChildElement = secElements.item(j); + sb.append(secChildElement.getTextContent()); + sb.append("\n"); + } + sb.append("\n"); } } diff --git a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java index 590fc63283b9..db3ba16dc42c 100644 --- a/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java +++ b/dspace-api/src/main/java/org/dspace/importer/external/metadatamapping/contributor/SimpleJsonPathMetadataContributor.java @@ -146,6 +146,9 @@ public Collection contributeMetadata(String fullJson) { } } for (String value : metadataValue) { + if (StringUtils.isBlank(value)) { + continue; + } MetadatumDTO metadatumDto = new MetadatumDTO(); metadatumDto.setValue(value); metadatumDto.setElement(field.getElement()); From 92cf7e694a673b65a2cffa2f36d11430bf96616b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 21:13:34 +0100 Subject: [PATCH 065/283] build(deps): bump software.amazon.awssdk:s3 in the amazon-s3 group (#12066) Bumps the amazon-s3 group with 1 update: software.amazon.awssdk:s3. Updates `software.amazon.awssdk:s3` from 2.41.33 to 2.41.34 --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.41.34 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dspace-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 27951088f9a6..f1744feb4cba 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -739,7 +739,7 @@ software.amazon.awssdk s3 - 2.41.33 + 2.42.1 software.amazon.awssdk From 9644e9c3430eb9e34317c17fa59301979f86d15c Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Wed, 29 Oct 2025 13:52:57 +0100 Subject: [PATCH 066/283] Optimize SQL query in findByEPerson to enhance performance when retrieving associated groups (cherry picked from commit 548c5e18bda6c876d8c313e9b3779de2b1085eb7) --- .../src/main/java/org/dspace/eperson/dao/impl/GroupDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/eperson/dao/impl/GroupDAOImpl.java b/dspace-api/src/main/java/org/dspace/eperson/dao/impl/GroupDAOImpl.java index 6aea9ecd8d67..40323d23e16a 100644 --- a/dspace-api/src/main/java/org/dspace/eperson/dao/impl/GroupDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/eperson/dao/impl/GroupDAOImpl.java @@ -92,7 +92,7 @@ public List findAll(Context context, int pageSize, int offset) throws SQL @Override public List findByEPerson(Context context, EPerson ePerson) throws SQLException { Query query = createQuery(context, - "from Group where (from EPerson e where e.id = :eperson_id) in elements(epeople)"); + "select distinct g from Group g join g.epeople ep where ep.id = :eperson_id"); query.setParameter("eperson_id", ePerson.getID()); query.setHint("org.hibernate.cacheable", Boolean.TRUE); From 955a6d03f16661fb6e48afa6d82f6c5a535b1847 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 17 Feb 2026 16:42:50 -0600 Subject: [PATCH 067/283] Replace webui.content_disposition_format with webui.content_disposition_inline. The latter is an allowlist instead of a blocklist. --- .../app/rest/BitstreamRestController.java | 65 ++++++++++--------- .../app/rest/BitstreamRestControllerIT.java | 60 ++++++++++------- dspace/config/dspace.cfg | 25 ++++--- 3 files changed, 82 insertions(+), 68 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java index 57fc73dfc6fa..819a2b69e8fb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/BitstreamRestController.java @@ -20,7 +20,6 @@ import javax.ws.rs.core.Response; import org.apache.catalina.connector.ClientAbortException; -import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; import org.dspace.app.rest.converter.ConverterService; @@ -153,15 +152,17 @@ public ResponseEntity retrieve(@PathVariable UUID uuid, HttpServletResponse resp httpHeadersInitializer.withLastModified(lastModified); } - //Determine if we need to send the file as a download or if the browser can open it inline - //The file will be downloaded if its size is larger than the configured threshold, - //or if its mimetype/extension appears in the "webui.content_disposition_format" config - long dispositionThreshold = configurationService.getLongProperty("webui.content_disposition_threshold"); - if ((dispositionThreshold >= 0 && filesize > dispositionThreshold) - || checkFormatForContentDisposition(format)) { - httpHeadersInitializer.withDisposition(HttpHeadersInitializer.CONTENT_DISPOSITION_ATTACHMENT); - } else { + // Determine if we need to send the file as a download or if the browser can open it inline. + // By default, all files will be downloaded as that is more secure. File formats will only be opened inline + // if they are listed in the "webui.content_disposition_inline" config and size is less than the + // configured "webui.content_disposition_threshold" (default = 8MB) + long dispositionThreshold = configurationService.getLongProperty("webui.content_disposition_threshold", + 8388608); + if (checkFormatForContentDispositionInline(format) && + filesize <= dispositionThreshold) { httpHeadersInitializer.withDisposition(HttpHeadersInitializer.CONTENT_DISPOSITION_INLINE); + } else { + httpHeadersInitializer.withDisposition(HttpHeadersInitializer.CONTENT_DISPOSITION_ATTACHMENT); } //We have all the data we need, close the connection to the database so that it doesn't stay open during @@ -208,48 +209,48 @@ private boolean isNotAnErrorResponse(HttpServletResponse response) { } /** - * Check if a Bitstream of the specified format should always be downloaded (i.e. "content-disposition: attachment") - * or can be opened inline (i.e. "content-disposition: inline"). + * Check if a Bitstream of the specified format should be opened inline (i.e. "content-disposition: inline") + * instead of the default behavior of always downloading (i.e. "content-disposition: attachment"). *

* NOTE that downloading via "attachment" is more secure, as the user's browser will not attempt to process or * display the file. But, downloading via "inline" may be seen as more user-friendly for common formats. * @param format BitstreamFormat - * @return true if always download ("attachment"). false if can be opened inline ("inline") + * @return true if format is configured to be opened inline ("inline"). false if always download ("attachment") */ - private boolean checkFormatForContentDisposition(BitstreamFormat format) { + private boolean checkFormatForContentDispositionInline(BitstreamFormat format) { // Undefined or Unknown formats should ALWAYS be downloaded for additional security. if (format == null || format.getSupportLevel() == BitstreamFormat.UNKNOWN) { - return true; + return false; } - // Load additional formats configured to require download - List configuredFormats = List.of(configurationService. - getArrayProperty("webui.content_disposition_format")); - - // If configuration includes "*", then all formats will always be downloaded. - if (configuredFormats.contains("*")) { - return true; + // Return false for BANNED inline formats. Some formats, especially XML / HTML / Javascript based formats, + // when loaded inline may be susceptible to XSS attacks. Therefore, we will refuse to allow those formats to be + // displayed inline for security purposes. + // NOTE: "+xml" in this list will match any MIME Type that ends in "+xml", as those are XML-based formats. + List bannedInlineFormats = List.of("text/html", "text/javascript", "text/xml", "application/xml", + "+xml"); + for (String bannedInlineFormat : bannedInlineFormats) { + // If our format MIME Type contains one of the banned inline formats, we refuse to display it inline + if (format.getMIMEType().contains(bannedInlineFormat)) { + return false; + } } - // Define a download list of formats which DSpace forces to ALWAYS be downloaded. - // These formats can embed JavaScript which may be run in the user's browser if the file is opened inline. - // Therefore, DSpace blocks opening these formats inline as it could be used for an XSS attack. - List downloadOnlyFormats = List.of("text/html", "text/javascript", "text/xml", "rdf"); - - // Combine our two lists - List formats = ListUtils.union(downloadOnlyFormats, configuredFormats); + // Load formats configured to allow inline display + List formats = List.of(configurationService. + getArrayProperty("webui.content_disposition_inline")); // See if the passed in format's MIME type or file extension is listed. - boolean download = formats.contains(format.getMIMEType()); - if (!download) { + boolean inline = formats.contains(format.getMIMEType()); + if (!inline) { for (String ext : format.getExtensions()) { if (formats.contains(ext)) { - download = true; + inline = true; break; } } } - return download; + return inline; } /** diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestControllerIT.java index b4649ce4c5b6..f48b48b341f0 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/BitstreamRestControllerIT.java @@ -1261,12 +1261,8 @@ public void closeInputStreamsDownloadWithCoverPage() throws Exception { @Test public void checkContentDispositionOfFormats() throws Exception { - configurationService.setProperty("webui.content_disposition_format", new String[] { - "text/richtext", - "text/xml", - "txt" - }); - + // This test verifies that, by default, common text formats will be downloaded instead of being served inline. + // The next two tests will verify behavior of non-default settings of "webui.content_disposition_inline" context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context).build(); Collection collection = CollectionBuilder.createCollection(context, community).build(); @@ -1288,18 +1284,26 @@ public void checkContentDispositionOfFormats() throws Exception { } context.restoreAuthSystemState(); - // these formats are configured and files should be downloaded + // Based on default configuration all files should be downloaded verifyBitstreamDownload(rtf, "text/richtext;charset=UTF-8", true); verifyBitstreamDownload(xml, "text/xml;charset=UTF-8", true); verifyBitstreamDownload(txt, "text/plain;charset=UTF-8", true); - // this format is not configured and should open inline - verifyBitstreamDownload(csv, "text/csv;charset=UTF-8", false); + verifyBitstreamDownload(csv, "text/csv;charset=UTF-8", true); } @Test - public void checkHardcodedContentDispositionFormats() throws Exception { - // This test is similar to the above test, but it verifies that our *hardcoded settings* for - // webui.content_disposition_format are protecting us from loading specific formats *inline*. + public void checkBannedContentDispositionInlineFormats() throws Exception { + configurationService.setProperty("webui.content_disposition_inline", new String[] { + "text/html", + "text/javascript", + "rdf", + "text/xml", + "image/svg+xml" + }); + + // This test is similar to the above test, but it verifies that if a site specifies + // a banned format (e.g. HTML, XML, etc) in their "webui.content_disposition_inline" setting + // DSpace will still protect them by refusing to load the format *inline*. context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context).build(); Collection collection = CollectionBuilder.createCollection(context, community).build(); @@ -1329,8 +1333,9 @@ public void checkHardcodedContentDispositionFormats() throws Exception { } context.restoreAuthSystemState(); - // By default, HTML, JS & XML should all download. This protects us from possible XSS attacks, as - // each of these formats can embed JavaScript which may execute when the file is loaded *inline*. + // By default, HTML, JS & XML should all download regardless of inline configuration. + // This protects us from possible XSS attacks, as each of these formats can embed JavaScript + // which may execute when the file is loaded *inline*. verifyBitstreamDownload(html, "text/html;charset=UTF-8", true); verifyBitstreamDownload(js, "text/javascript;charset=UTF-8", true); verifyBitstreamDownload(rdf, "application/rdf+xml;charset=UTF-8", true); @@ -1343,22 +1348,29 @@ public void checkHardcodedContentDispositionFormats() throws Exception { } @Test - public void checkWildcardContentDispositionFormats() throws Exception { - // Setting "*" should result in all formats being downloaded (nothing will be opened inline) - configurationService.setProperty("webui.content_disposition_format", "*"); - + public void checkContentDispositionInlineFormats() throws Exception { + // Set PDF and a few image formats to verify they will display inline. But leave off "text/plain" + configurationService.setProperty("webui.content_disposition_inline", new String[] { + "text/csv", + "application/pdf", + "image/jpeg", + "video/mpeg" + }); context.turnOffAuthorisationSystem(); Community community = CommunityBuilder.createCommunity(context).build(); Collection collection = CollectionBuilder.createCollection(context, community).build(); Item item = ItemBuilder.createItem(context, collection).build(); String content = "Test Content"; Bitstream csv; + Bitstream txt; Bitstream jpg; Bitstream mpg; Bitstream pdf; try (InputStream is = IOUtils.toInputStream(content, CharEncoding.UTF_8)) { csv = BitstreamBuilder.createBitstream(context, item, is) .withMimeType("text/csv").build(); + txt = BitstreamBuilder.createBitstream(context, item, is) + .withMimeType("text/plain").build(); jpg = BitstreamBuilder.createBitstream(context, item, is) .withMimeType("image/jpeg").build(); mpg = BitstreamBuilder.createBitstream(context, item, is) @@ -1368,11 +1380,13 @@ public void checkWildcardContentDispositionFormats() throws Exception { } context.restoreAuthSystemState(); - // All formats should be download only - verifyBitstreamDownload(csv, "text/csv;charset=UTF-8", true); - verifyBitstreamDownload(jpg, "image/jpeg;charset=UTF-8", true); - verifyBitstreamDownload(mpg, "video/mpeg;charset=UTF-8", true); - verifyBitstreamDownload(pdf, "application/pdf;charset=UTF-8", true); + // Only text/plain should download, while other formats should be served inline based on the configuration + verifyBitstreamDownload(csv, "text/csv;charset=UTF-8", false); + verifyBitstreamDownload(jpg, "image/jpeg;charset=UTF-8", false); + verifyBitstreamDownload(mpg, "video/mpeg;charset=UTF-8", false); + verifyBitstreamDownload(pdf, "application/pdf;charset=UTF-8", false); + // This is the only format not listed in the inline configuration, so it will be downloaded + verifyBitstreamDownload(txt, "text/plain;charset=UTF-8", true); } diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 0fcf0022bd13..783015efe727 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -1376,21 +1376,20 @@ websvc.opensearch.max_num_of_items_per_request = 100 #### Content Inline Disposition Threshold #### # -# Set the max size of a bitstream that can be served inline -# Use -1 to force all bitstream to be served inline -webui.content_disposition_threshold = 8388608 - -#### Content Attachment Disposition Formats #### -# -# Set which mimetypes or file extensions will NOT be opened inline. -# Files with these mimetypes/extensions will always be downloaded, regardless of the threshold above. +# Set which mimetypes or file extensions are allowed to be opened inline in a user's browser. +# By default, all files will be downloaded, regardless of the threshold below, unless specified in this configuration. # NOTE: For security reasons, some file formats (e.g. HTML, XML, RDF, JS) will always be downloaded regardless -# of the settings here. This blocks these formats from executing embedded JavaScript when opened inline. -# For additional security, you may choose to set this to "*" to force all formats to always be downloaded -# (i.e. disables all formats from opening inline within the user's browser). +# of the settings here. This blocks these formats from executing embedded JavaScript when opened inline, protecting +# the site from potential XSS attacks. +# +# For example: enable PDF and common images formats to be opened in a user's browser. +#webui.content_disposition_inline = application/pdf, image/gif, image/jpeg, image/png + # -# By default, RTF is always downloaded because most browsers attempt to display it as plain text. -webui.content_disposition_format = text/richtext +# Set the max size (in bytes) of a bitstream that can be served inline. This setting only applies to formats +# specified in the "webui.content_disposition_inline" configuration above. +# Default = 8MB (8388608 bytes). Use -1 to ignore the size of file when serving it inline. +#webui.content_disposition_threshold = 8388608 #### Multi-file HTML document/site settings ##### # TODO: UNSUPPORTED in DSpace 7.0. May be re-added in a later release From abd7932e609bf8ce198a744c47a3f3c5aeccd59e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 13 Mar 2026 13:55:09 -0500 Subject: [PATCH 068/283] Enable inline display by default for common, generally safe formats --- dspace/config/dspace.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 783015efe727..beb985eb4729 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -1382,8 +1382,9 @@ websvc.opensearch.max_num_of_items_per_request = 100 # of the settings here. This blocks these formats from executing embedded JavaScript when opened inline, protecting # the site from potential XSS attacks. # -# For example: enable PDF and common images formats to be opened in a user's browser. -#webui.content_disposition_inline = application/pdf, image/gif, image/jpeg, image/png +# For example: this setting defaults to enabling PDF and common image / audio / video formats to be opened +# (or potentially streamed) in a user's browser. +webui.content_disposition_inline = application/pdf, image/gif, image/jpeg, image/png, audio/mpeg, video/mpeg, video/mp4 # # Set the max size (in bytes) of a bitstream that can be served inline. This setting only applies to formats From 6c393799a89557f2e41a68511dba75f1359e11ac Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 24 Mar 2026 11:55:27 -0500 Subject: [PATCH 069/283] Fix bug with starting up localstack for S3 testing by pinning to 4.14.0 release. --- .../java/org/dspace/storage/bitstore/S3BitStoreServiceIT.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/test/java/org/dspace/storage/bitstore/S3BitStoreServiceIT.java b/dspace-api/src/test/java/org/dspace/storage/bitstore/S3BitStoreServiceIT.java index e2f68baf3aec..4478684abdb1 100644 --- a/dspace-api/src/test/java/org/dspace/storage/bitstore/S3BitStoreServiceIT.java +++ b/dspace-api/src/test/java/org/dspace/storage/bitstore/S3BitStoreServiceIT.java @@ -71,7 +71,9 @@ * @author Luca Giamminonni (luca.giamminonni at 4science.com) */ public class S3BitStoreServiceIT extends AbstractIntegrationTestWithDatabase { - private static DockerImageName localstackName = DockerImageName.parse("localstack/localstack:stable"); + // Pin to version 4.1.4 of Docker image. Newer versions (starting with 2026-03-0) require an Auth Token. + // See https://blog.localstack.cloud/localstack-for-aws-release-2026-03-0 + private static DockerImageName localstackName = DockerImageName.parse("localstack/localstack:4.14.0"); @SuppressWarnings("resource") private static LocalStackContainer localstackContainer = new LocalStackContainer(localstackName).withServices("s3"); From 429df10fe7837d6c4155563adb4d59cdd2268d78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:38:37 +0000 Subject: [PATCH 070/283] build(deps): bump pdfbox-version from 3.0.6 to 3.0.7 Bumps `pdfbox-version` from 3.0.6 to 3.0.7. Updates `org.apache.pdfbox:pdfbox` from 3.0.6 to 3.0.7 Updates `org.apache.pdfbox:fontbox` from 3.0.6 to 3.0.7 --- updated-dependencies: - dependency-name: org.apache.pdfbox:pdfbox dependency-version: 3.0.7 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.pdfbox:fontbox dependency-version: 3.0.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 24c818e28797..47d7d064e76f 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ 9.4.58.v20250814 2.25.3 - 3.0.6 + 3.0.7 1.19.0 1.7.36 3.2.3 From 2149dd0454dcd3c205a74af62e1df0032b773475 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:39:33 +0000 Subject: [PATCH 071/283] build(deps): bump tika.version from 3.2.3 to 3.3.0 Bumps `tika.version` from 3.2.3 to 3.3.0. Updates `org.apache.tika:tika-core` from 3.2.3 to 3.3.0 - [Changelog](https://github.com/apache/tika/blob/main/CHANGES.txt) - [Commits](https://github.com/apache/tika/compare/3.2.3...3.3.0) Updates `org.apache.tika:tika-parsers-standard-package` from 3.2.3 to 3.3.0 --- updated-dependencies: - dependency-name: org.apache.tika:tika-core dependency-version: 3.3.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.apache.tika:tika-parsers-standard-package dependency-version: 3.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 24c818e28797..be658c6caa27 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ 3.0.6 1.19.0 1.7.36 - 3.2.3 + 3.3.0 From c234471aacb444909cae2ec5ad015a5f82587c2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:47:03 +0000 Subject: [PATCH 072/283] build(deps): bump docker/build-push-action from 6 to 7 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6 to 7. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v6...v7) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/reusable-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 46c7ceb1cd91..f35f1d80edd7 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -148,7 +148,7 @@ jobs: - name: Build and push image to ${{ env.DOCKER_BUILD_REGISTRY }} if: ${{ ! matrix.isPr }} id: docker_build - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 with: build-contexts: | ${{ inputs.dockerfile_additional_contexts }} @@ -202,7 +202,7 @@ jobs: # NOTE: This step cannot be combined with the build above as it's a different type of output. - name: Build and push image to local TAR file if: ${{ matrix.arch == 'linux/amd64'}} - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 with: build-contexts: | ${{ inputs.dockerfile_additional_contexts }} From ed8e76e4067163c587842764d6db9865051dcd11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:47:11 +0000 Subject: [PATCH 073/283] build(deps): bump docker/login-action from 3 to 4 Bumps [docker/login-action](https://github.com/docker/login-action) from 3 to 4. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/login-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/reusable-docker-build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 46c7ceb1cd91..4f68779260bf 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -116,7 +116,7 @@ jobs: # NOTE: This login occurs for BOTH non-PRs or PRs. PRs *must* also login to access private images from GHCR # during the build process - name: Login to ${{ env.DOCKER_BUILD_REGISTRY }} - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ${{ env.DOCKER_BUILD_REGISTRY }} username: ${{ github.repository_owner }} @@ -254,7 +254,7 @@ jobs: merge-multiple: true - name: Login to ${{ env.DOCKER_BUILD_REGISTRY }} - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ${{ env.DOCKER_BUILD_REGISTRY }} username: ${{ github.repository_owner }} @@ -317,7 +317,7 @@ jobs: # Login to source registry first, as this is where we are copying *from* - name: Login to ${{ env.DOCKER_BUILD_REGISTRY }} - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ${{ env.DOCKER_BUILD_REGISTRY }} username: ${{ github.repository_owner }} @@ -325,7 +325,7 @@ jobs: # Login to DockerHub, since this is where we are copying *to* - name: Login to DockerHub - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_ACCESS_TOKEN }} From ea7b5414fda84ab3b86a216d11630f6683093c49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:47:19 +0000 Subject: [PATCH 074/283] build(deps): bump docker/setup-buildx-action from 3 to 4 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 3 to 4. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v3...v4) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/reusable-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 46c7ceb1cd91..05659d2e5c87 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -124,7 +124,7 @@ jobs: # https://github.com/docker/setup-buildx-action - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 # https://github.com/docker/metadata-action # Extract metadata used for Docker images in all build steps below @@ -261,7 +261,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Add Docker metadata for image id: meta From 5a19f6c6cbcfe25e57fbef7c4c2632d48e385487 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 02:47:33 +0000 Subject: [PATCH 075/283] build(deps): bump docker/metadata-action from 5 to 6 Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5 to 6. - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](https://github.com/docker/metadata-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/metadata-action dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/reusable-docker-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 46c7ceb1cd91..2d89485b8ea3 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -130,7 +130,7 @@ jobs: # Extract metadata used for Docker images in all build steps below - name: Extract metadata (tags, labels) from GitHub for Docker image id: meta_build - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v6 with: images: ${{ env.DOCKER_BUILD_REGISTRY }}/${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_TAGS }} @@ -265,7 +265,7 @@ jobs: - name: Add Docker metadata for image id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v6 with: images: ${{ env.DOCKER_BUILD_REGISTRY }}/${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_TAGS }} @@ -309,7 +309,7 @@ jobs: # This recreates Docker tags for DockerHub - name: Add Docker metadata for image id: meta_dockerhub - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v6 with: images: ${{ env.IMAGE_NAME }} tags: ${{ env.IMAGE_TAGS }} From d59a67b7c317014fcded16a557043315952dbe0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:20:03 +0200 Subject: [PATCH 076/283] build(deps): bump actions/upload-artifact from 4 to 7 (#12214) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 4 ++-- .github/workflows/reusable-docker-build.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b0f086e7894..c2d8d1198a03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,14 +65,14 @@ jobs: # (This artifact is downloadable at the bottom of any job's summary page) - name: Upload Results of ${{ matrix.type }} to Artifact if: ${{ failure() }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.type }} results path: ${{ matrix.resultsdir }} # Upload code coverage report to artifact, so that it can be shared with the 'codecov' job (see below) - name: Upload code coverage report to Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.type }} coverage report path: 'dspace/target/site/jacoco-aggregate/jacoco.xml' diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 46c7ceb1cd91..e3e51c2e95a5 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -179,7 +179,7 @@ jobs: # (The purpose of the combined manifest is to list both amd64 and arm64 builds under same tag) - name: Upload Docker build digest to artifact if: ${{ ! matrix.isPr }} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: digests-${{ inputs.build_id }}-${{ env.ARCH_NAME }} path: /tmp/digests/* @@ -225,7 +225,7 @@ jobs: # This step is only done for AMD64, as that's the only image we use in our automated testing (at this time). - name: Upload local image TAR to artifact if: ${{ matrix.arch == 'linux/amd64'}} - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: docker-image-${{ inputs.build_id }}-${{ env.ARCH_NAME }} path: /tmp/${{ inputs.build_id }}.tar From 97353bcb77f3a48e6ca9203b106c628d7a77458e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:21:06 +0200 Subject: [PATCH 077/283] build(deps-dev): bump org.apache.maven.plugins:maven-resources-plugin (#12196) Bumps the build-tools group with 1 update: [org.apache.maven.plugins:maven-resources-plugin](https://github.com/apache/maven-resources-plugin). Updates `org.apache.maven.plugins:maven-resources-plugin` from 3.4.0 to 3.5.0 - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/v3.4.0...maven-resources-plugin-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-version: 3.5.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: build-tools ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 24c818e28797..5a7e5bb9028b 100644 --- a/pom.xml +++ b/pom.xml @@ -346,7 +346,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.4.0 + 3.5.0 From 6bfadb6b77c56004da9fbf8342d3784541f67232 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:21:23 +0200 Subject: [PATCH 078/283] build(deps): bump commons-logging:commons-logging (#12203) Bumps the apache-commons group with 1 update: [commons-logging:commons-logging](https://github.com/apache/commons-logging). Updates `commons-logging:commons-logging` from 1.3.5 to 1.3.6 - [Changelog](https://github.com/apache/commons-logging/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-logging/compare/rel/commons-logging-1.3.5...rel/commons-logging-1.3.6) --- updated-dependencies: - dependency-name: commons-logging:commons-logging dependency-version: 1.3.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: apache-commons ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5a7e5bb9028b..e3d3530ba5f8 100644 --- a/pom.xml +++ b/pom.xml @@ -1521,7 +1521,7 @@ commons-logging commons-logging - 1.3.5 + 1.3.6 org.apache.commons From d8ddc02fb8922bd43c5630468e7d0b8f101e6929 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:21:52 +0200 Subject: [PATCH 079/283] build(deps): bump the amazon-s3 group with 2 updates (#12202) Bumps the amazon-s3 group with 2 updates: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.42.1 to 2.42.20 Updates `software.amazon.awssdk.crt:aws-crt` from 0.43.4 to 0.43.9 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.43.4...v0.43.9) --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.42.20 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.43.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index f1744feb4cba..926923367884 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -739,7 +739,7 @@ software.amazon.awssdk s3 - 2.42.1 + 2.42.20 software.amazon.awssdk @@ -755,7 +755,7 @@ software.amazon.awssdk.crt aws-crt - 0.43.4 + 0.43.9 From ba46f4864fa51deef726e8cb94059b8203b6bc31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:22:10 +0200 Subject: [PATCH 080/283] build(deps): bump the fasterxml group with 2 updates (#12204) Bumps the fasterxml group with 2 updates: [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core) and [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson). Updates `com.fasterxml.jackson.core:jackson-core` from 2.21.1 to 2.21.2 - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.21.1...jackson-core-2.21.2) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.1 to 2.21.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.21.1 to 2.21.2 - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-version: 2.21.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.21.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3d3530ba5f8..34d339937a31 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.11.1 2.31.0 - 2.21.1 + 2.21.2 2.21 1.3.2 2.3.1 From 168c55c76a810b847da9ca34b4059c8be6607fb3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:22:31 +0200 Subject: [PATCH 081/283] build(deps): bump the test-tools group with 7 updates (#12199) Bumps the test-tools group with 7 updates: | Package | From | To | | --- | --- | --- | | [org.testcontainers:testcontainers-localstack](https://github.com/testcontainers/testcontainers-java) | `2.0.3` | `2.0.4` | | [io.netty:netty-buffer](https://github.com/netty/netty) | `4.2.10.Final` | `4.2.11.Final` | | [io.netty:netty-transport](https://github.com/netty/netty) | `4.2.10.Final` | `4.2.11.Final` | | [io.netty:netty-transport-native-unix-common](https://github.com/netty/netty) | `4.2.10.Final` | `4.2.11.Final` | | [io.netty:netty-common](https://github.com/netty/netty) | `4.2.10.Final` | `4.2.11.Final` | | [io.netty:netty-handler](https://github.com/netty/netty) | `4.2.10.Final` | `4.2.11.Final` | | [io.netty:netty-codec](https://github.com/netty/netty) | `4.2.10.Final` | `4.2.11.Final` | Updates `org.testcontainers:testcontainers-localstack` from 2.0.3 to 2.0.4 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/2.0.3...2.0.4) Updates `io.netty:netty-buffer` from 4.2.10.Final to 4.2.11.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.10.Final...netty-4.2.11.Final) Updates `io.netty:netty-transport` from 4.2.10.Final to 4.2.11.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.10.Final...netty-4.2.11.Final) Updates `io.netty:netty-transport-native-unix-common` from 4.2.10.Final to 4.2.11.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.10.Final...netty-4.2.11.Final) Updates `io.netty:netty-common` from 4.2.10.Final to 4.2.11.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.10.Final...netty-4.2.11.Final) Updates `io.netty:netty-handler` from 4.2.10.Final to 4.2.11.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.10.Final...netty-4.2.11.Final) Updates `io.netty:netty-codec` from 4.2.10.Final to 4.2.11.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.10.Final...netty-4.2.11.Final) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers-localstack dependency-version: 2.0.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-buffer dependency-version: 4.2.11.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport dependency-version: 4.2.11.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport-native-unix-common dependency-version: 4.2.11.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-common dependency-version: 4.2.11.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-handler dependency-version: 4.2.11.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-codec dependency-version: 4.2.11.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- dspace-api/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 926923367884..fbb51d6b7e32 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -857,7 +857,7 @@ org.testcontainers testcontainers-localstack - 2.0.3 + 2.0.4 test @@ -877,32 +877,32 @@ io.netty netty-buffer - 4.2.10.Final + 4.2.11.Final io.netty netty-transport - 4.2.10.Final + 4.2.11.Final io.netty netty-transport-native-unix-common - 4.2.10.Final + 4.2.11.Final io.netty netty-common - 4.2.10.Final + 4.2.11.Final io.netty netty-handler - 4.2.10.Final + 4.2.11.Final io.netty netty-codec - 4.2.10.Final + 4.2.11.Final org.apache.velocity From b1e7b4704a70ae6499903fc557ee713edf2b6125 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:22:39 +0200 Subject: [PATCH 082/283] build(deps): bump joda-time:joda-time from 2.14.0 to 2.14.1 (#12212) Bumps [joda-time:joda-time](https://github.com/JodaOrg/joda-time) from 2.14.0 to 2.14.1. - [Release notes](https://github.com/JodaOrg/joda-time/releases) - [Changelog](https://github.com/JodaOrg/joda-time/blob/main/RELEASE-NOTES.txt) - [Commits](https://github.com/JodaOrg/joda-time/compare/v2.14.0...v2.14.1) --- updated-dependencies: - dependency-name: joda-time:joda-time dependency-version: 2.14.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 34d339937a31..b585342152c1 100644 --- a/pom.xml +++ b/pom.xml @@ -1546,7 +1546,7 @@ joda-time joda-time - 2.14.0 + 2.14.1 com.sun.mail From 847711a28642eadcef951d88ba914fbd70cfed8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:22:43 +0200 Subject: [PATCH 083/283] build(deps): bump io.grpc:grpc-context from 1.79.0 to 1.80.0 (#12213) Bumps [io.grpc:grpc-context](https://github.com/grpc/grpc-java) from 1.79.0 to 1.80.0. - [Release notes](https://github.com/grpc/grpc-java/releases) - [Commits](https://github.com/grpc/grpc-java/compare/v1.79.0...v1.80.0) --- updated-dependencies: - dependency-name: io.grpc:grpc-context dependency-version: 1.80.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b585342152c1..8e0c6109d9ab 100644 --- a/pom.xml +++ b/pom.xml @@ -1729,7 +1729,7 @@ io.grpc grpc-context - 1.79.0 + 1.80.0 com.google.http-client From 9aac8da4f1bb9fa02aa57310719144ba06a98d9c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 10:22:47 +0200 Subject: [PATCH 084/283] build(deps): bump jersey.version from 2.47 to 2.48 (#12205) Bumps `jersey.version` from 2.47 to 2.48. Updates `org.glassfish.jersey.core:jersey-client` from 2.47 to 2.48 Updates `org.glassfish.jersey.inject:jersey-hk2` from 2.47 to 2.48 Updates `org.glassfish.jersey.core:jersey-server` from 2.47 to 2.48 Updates `org.glassfish.jersey.containers:jersey-container-servlet` from 2.47 to 2.48 Updates `org.glassfish.jersey.media:jersey-media-json-jackson` from 2.47 to 2.48 Updates `org.glassfish.jersey.media:jersey-media-jaxb` from 2.47 to 2.48 Updates `org.glassfish.jersey.ext:jersey-spring5` from 2.47 to 2.48 --- updated-dependencies: - dependency-name: org.glassfish.jersey.core:jersey-client dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.glassfish.jersey.inject:jersey-hk2 dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.glassfish.jersey.core:jersey-server dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.glassfish.jersey.containers:jersey-container-servlet dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.glassfish.jersey.media:jersey-media-json-jackson dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.glassfish.jersey.media:jersey-media-jaxb dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.glassfish.jersey.ext:jersey-spring5 dependency-version: '2.48' dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e0c6109d9ab..480b3ffc8e4b 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ https://jena.apache.org/documentation/migrate_jena2_jena3.html --> 2.13.0 - 2.47 + 2.48 UTF-8 From 51d4f8cb0353a94c732776e917737d78fa9529f3 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 13 Mar 2026 17:09:33 -0500 Subject: [PATCH 085/283] Update all Docker Compose scripts to allow for environment variable overrides from the shell. If override is not provided, the existing default value is still used. --- docker-compose-cli.yml | 4 ++-- docker-compose.yml | 12 ++++++------ .../main/docker-compose/cli.assetstore.yml | 2 +- dspace/src/main/docker-compose/cli.ingest.yml | 6 +++--- .../src/main/docker-compose/db.entities.yml | 2 +- dspace/src/main/docker-compose/db.restore.yml | 2 +- .../docker-compose/docker-compose-angular.yml | 19 ++++++++++--------- 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/docker-compose-cli.yml b/docker-compose-cli.yml index 77901c97618c..8b47a012646e 100644 --- a/docker-compose-cli.yml +++ b/docker-compose-cli.yml @@ -19,9 +19,9 @@ services: # dspace.dir: Must match with Dockerfile's DSPACE_INSTALL directory. dspace__P__dir: /dspace # db.url: Ensure we are using the 'dspacedb' image for our database - db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace' + db__P__url: ${db__P__url:-jdbc:postgresql://dspacedb:5432/dspace} # solr.server: Ensure we are using the 'dspacesolr' image for Solr - solr__P__server: http://dspacesolr:8983/solr + solr__P__server: ${solr__P__server:-http://dspacesolr:8983/solr} volumes: # Keep DSpace assetstore directory between reboots - assetstore:/dspace/assetstore diff --git a/docker-compose.yml b/docker-compose.yml index 83474bde86a7..ca56e369b6ac 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,16 +23,16 @@ services: # dspace__P__ui__P__url: http://localhost:4000 # Set SSR URL to the Docker container name so that UI can contact container directly in Production mode. # (This is necessary for docker-compose-angular.yml as it uses production mode by default) - dspace__P__server__P__ssr__P__url: http://dspace:8080/server - dspace__P__name: 'DSpace Started with Docker Compose' + dspace__P__server__P__ssr__P__url: ${dspace__P__server__P__ssr__P__url:-http://dspace:8080/server} + dspace__P__name: ${dspace__P__name:-DSpace Started with Docker Compose} # db.url: Ensure we are using the 'dspacedb' image for our database - db__P__url: 'jdbc:postgresql://dspacedb:5432/dspace' + db__P__url: ${db__P__url:-jdbc:postgresql://dspacedb:5432/dspace} # solr.server: Ensure we are using the 'dspacesolr' image for Solr - solr__P__server: http://dspacesolr:8983/solr + solr__P__server: ${solr__P__server:-http://dspacesolr:8983/solr} # proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests # from the host machine. This IP range MUST correspond to the 'dspacenet' subnet defined above. - proxies__P__trusted__P__ipranges: '172.23.0' - LOGGING_CONFIG: /dspace/config/log4j2-container.xml + proxies__P__trusted__P__ipranges: ${proxies__P__trusted__P__ipranges:-172.23.0} + LOGGING_CONFIG: ${LOGGING_CONFIG:-/dspace/config/log4j2-container.xml} image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace:${DSPACE_VER:-dspace-7_x-test}" build: context: . diff --git a/dspace/src/main/docker-compose/cli.assetstore.yml b/dspace/src/main/docker-compose/cli.assetstore.yml index 6563aa081eb1..ab9527f8e4af 100644 --- a/dspace/src/main/docker-compose/cli.assetstore.yml +++ b/dspace/src/main/docker-compose/cli.assetstore.yml @@ -10,7 +10,7 @@ services: dspace-cli: environment: # This assetstore zip is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data - - LOADASSETS=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/assetstore.tar.gz + - LOADASSETS=${LOADASSETS:-https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/assetstore.tar.gz} entrypoint: - /bin/bash - '-c' diff --git a/dspace/src/main/docker-compose/cli.ingest.yml b/dspace/src/main/docker-compose/cli.ingest.yml index 6172147f1955..b6b9886eb730 100644 --- a/dspace/src/main/docker-compose/cli.ingest.yml +++ b/dspace/src/main/docker-compose/cli.ingest.yml @@ -9,9 +9,9 @@ services: dspace-cli: environment: - - AIPZIP=https://github.com/DSpace-Labs/AIP-Files/raw/main/dogAndReport.zip - - ADMIN_EMAIL=test@test.edu - - AIPDIR=/tmp/aip-dir + - AIPZIP=${AIPZIP:-https://github.com/DSpace-Labs/AIP-Files/raw/main/dogAndReport.zip} + - ADMIN_EMAIL=${ADMIN_EMAIL:-test@test.edu} + - AIPDIR=${AIPDIR:-/tmp/aip-dir} entrypoint: - /bin/bash - '-c' diff --git a/dspace/src/main/docker-compose/db.entities.yml b/dspace/src/main/docker-compose/db.entities.yml index db28fef80b85..d1f17a4e04a9 100644 --- a/dspace/src/main/docker-compose/db.entities.yml +++ b/dspace/src/main/docker-compose/db.entities.yml @@ -11,7 +11,7 @@ services: image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-7_x}-loadsql" environment: # This SQL is available from https://github.com/DSpace-Labs/AIP-Files/releases/tag/demo-entities-data - - LOADSQL=https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql + - LOADSQL=${LOADSQL:-https://github.com/DSpace-Labs/AIP-Files/releases/download/demo-entities-data/dspace7-entities-data.sql} dspace: ### OVERRIDE default 'entrypoint' in 'docker-compose.yml #### # Ensure that the database is ready BEFORE starting tomcat diff --git a/dspace/src/main/docker-compose/db.restore.yml b/dspace/src/main/docker-compose/db.restore.yml index 8584eee8272f..9e8e1b5cda31 100644 --- a/dspace/src/main/docker-compose/db.restore.yml +++ b/dspace/src/main/docker-compose/db.restore.yml @@ -15,7 +15,7 @@ services: image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-postgres-pgcrypto:${DSPACE_VER:-dspace-7_x}-loadsql" environment: # Location where the dump SQL file will be available on the running container - - LOCALSQL=/tmp/pgdump.sql + - LOCALSQL=${LOCALSQL:-/tmp/pgdump.sql} volumes: # Volume which shares a local SQL file at "./pgdump.sql" to the running container # IF YOUR LOCAL FILE HAS A DIFFERENT NAME (or is in a different location), then change the "./pgdump.sql" diff --git a/dspace/src/main/docker-compose/docker-compose-angular.yml b/dspace/src/main/docker-compose/docker-compose-angular.yml index dcfc61905230..477d63096e1a 100644 --- a/dspace/src/main/docker-compose/docker-compose-angular.yml +++ b/dspace/src/main/docker-compose/docker-compose-angular.yml @@ -18,16 +18,17 @@ services: depends_on: - dspace environment: - DSPACE_UI_SSL: 'false' - DSPACE_UI_HOST: dspace-angular - DSPACE_UI_PORT: '4000' - DSPACE_UI_NAMESPACE: / - DSPACE_REST_SSL: 'false' - DSPACE_REST_HOST: localhost - DSPACE_REST_PORT: 8080 - DSPACE_REST_NAMESPACE: /server + DSPACE_UI_SSL: ${DSPACE_UI_SSL:-false} + DSPACE_UI_HOST: ${DSPACE_UI_HOST:-dspace-angular} + DSPACE_UI_PORT: ${DSPACE_UI_PORT:-4000} + DSPACE_UI_NAMESPACE: ${DSPACE_UI_NAMESPACE:-/} + DSPACE_UI_BASEURL: ${DSPACE_UI_BASEURL:-http://localhost:4000} + DSPACE_REST_SSL: ${DSPACE_REST_SSL:-false} + DSPACE_REST_HOST: ${DSPACE_REST_HOST:-localhost} + DSPACE_REST_PORT: ${DSPACE_REST_PORT:-8080} + DSPACE_REST_NAMESPACE: ${DSPACE_REST_NAMESPACE:-/server} # Ensure SSR can use the 'dspace' Docker image directly (see docker-compose-rest.yml) - DSPACE_REST_SSRBASEURL: http://dspace:8080/server + DSPACE_REST_SSRBASEURL: ${DSPACE_REST_SSRBASEURL:-http://dspace:8080/server} image: "${DOCKER_REGISTRY:-docker.io}/${DOCKER_OWNER:-dspace}/dspace-angular:${DSPACE_VER:-dspace-7_x-dist}" ports: - published: 4000 From 6bdac9da81740eb3d4c11786c59a6813709e5bfd Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Mon, 13 Apr 2026 08:58:33 +0200 Subject: [PATCH 086/283] Fix NPE in ORCID authentication when request is null (cherry picked from commit 4f3ae5f18201c30b2a2b257e144fed83019507b4) --- .../java/org/dspace/authenticate/OrcidAuthenticationBean.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java b/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java index a11bbfc867b4..b5c238f3344f 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/OrcidAuthenticationBean.java @@ -120,7 +120,7 @@ public String loginPageURL(Context context, HttpServletRequest request, HttpServ @Override public boolean isUsed(Context context, HttpServletRequest request) { - return request.getAttribute(ORCID_AUTH_ATTRIBUTE) != null; + return request != null && request.getAttribute(ORCID_AUTH_ATTRIBUTE) != null; } @Override From ea11820af8c614f68f08a8e268b4e5aa328f7b24 Mon Sep 17 00:00:00 2001 From: JohnnyMendesC <177888064+JohnnyMendesC@users.noreply.github.com> Date: Wed, 27 Aug 2025 09:47:13 -0300 Subject: [PATCH 087/283] fix(#9663): Add configurable limit to CSV metadata import (cherry picked from commit 557c133ff021851ce2515ce76af91860e5f9edeb) --- .../dspace/app/bulkedit/MetadataImport.java | 10 +++ .../dspace/app/bulkedit/MetadataImportIT.java | 74 ++++++++++++++++++- dspace/config/modules/bulkedit.cfg | 7 +- 3 files changed, 86 insertions(+), 5 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java index 7873f1b12ca8..d6d00dfa3c36 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java @@ -358,6 +358,16 @@ public List runImport(Context c, boolean change, // Process each change rowCount = 1; + + int maxItems = configurationService.getIntProperty("bulkedit.import.max-items", 1000); + int numItems = toImport.size(); + if (numItems > maxItems && maxItems > 0) { + throw new MetadataImportException( + "Import contains " + numItems + " items, which exceeds the configured " + + "maximum of " + maxItems + ". You can change this limit by setting " + + "'bulkedit.import.max-items' in your local configuration."); + } + for (DSpaceCSVLine line : toImport) { // Resolve target references to other items populateRefAndRowMap(line, line.getID()); diff --git a/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java b/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java index de1dcc91c9a1..158c3f23e6a8 100644 --- a/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java +++ b/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java @@ -10,6 +10,7 @@ import static junit.framework.TestCase.assertEquals; import static junit.framework.TestCase.assertTrue; import static junit.framework.TestCase.fail; +import static org.junit.Assert.assertNotNull; import java.io.BufferedWriter; import java.io.File; @@ -43,6 +44,8 @@ import org.dspace.scripts.configuration.ScriptConfiguration; import org.dspace.scripts.factory.ScriptServiceFactory; import org.dspace.scripts.service.ScriptService; +import org.dspace.services.ConfigurationService; +import org.dspace.services.factory.DSpaceServicesFactory; import org.junit.Before; import org.junit.Test; @@ -54,6 +57,8 @@ public class MetadataImportIT extends AbstractIntegrationTestWithDatabase { = EPersonServiceFactory.getInstance().getEPersonService(); private final RelationshipService relationshipService = ContentServiceFactory.getInstance().getRelationshipService(); + private final ConfigurationService configurationService + = DSpaceServicesFactory.getInstance().getConfigurationService(); private Collection collection; private Collection publicationCollection; @@ -305,4 +310,71 @@ public void performImportScript(String[] csv, boolean useTemplate) throws Except csvFile.delete(); } } -} + + @Test + public void metadataImportExceedsLimitTest() throws Exception { + configurationService.setProperty("bulkedit.import.max-items", 1); + String[] csv = {"id,collection,dc.title", + "+," + collection.getHandle() + ",\"Title 1\"", + "+," + collection.getHandle() + ",\"Title 2\""}; + File csvFile = File.createTempFile("dspace-test-import", "csv"); + try { + try (BufferedWriter out = new BufferedWriter( + new OutputStreamWriter(new FileOutputStream(csvFile), "UTF-8"))) { + for (String csvLine : csv) { + out.write(csvLine + "\n"); + } + } + String fileLocation = csvFile.getAbsolutePath(); + String[] args = new String[] {"metadata-import", "-f", fileLocation, "-e", eperson.getEmail(), "-s"}; + TestDSpaceRunnableHandler testDSpaceRunnableHandler = new TestDSpaceRunnableHandler(); + ScriptLauncher.handleScript( + args, ScriptLauncher.getConfig(kernelImpl), testDSpaceRunnableHandler, kernelImpl); + + assertNotNull("The handler should contain an exception", + testDSpaceRunnableHandler.getException()); + + assertTrue("The exception cause should be a MetadataImportException", + testDSpaceRunnableHandler.getException().getCause() instanceof MetadataImportException); + + String exceptionMessage = testDSpaceRunnableHandler.getException().getCause().getMessage(); + assertTrue("The error message does not contain the expected text.", + exceptionMessage.contains("exceeds the configured maximum of 1")); + } finally { + csvFile.delete(); + } + } + + @Test + public void metadataImportWithItemCountBelowLimitTest() throws Exception { + configurationService.setProperty("bulkedit.import.max-items", 2); + String[] csv = {"id,collection,dc.title", + "+," + collection.getHandle() + ",\"Title 1\"", + "+," + collection.getHandle() + ",\"Title 2\""}; + performImportScript(csv); + Item importedItem1 = findItemByName("Title 1"); + Item importedItem2 = findItemByName("Title 2"); + assertNotNull("Should have imported Title 1", importedItem1); + assertNotNull("Should have imported Title 2", importedItem2); + } + + @Test + public void metadataImportWithLimitDisabledTest() throws Exception { + configurationService.setProperty("bulkedit.import.max-items", 0); + String[] csv = {"id,collection,dc.title", + "+," + collection.getHandle() + ",\"Title 1\"", + "+," + collection.getHandle() + ",\"Title 2\""}; + performImportScript(csv); + Item importedItem1 = findItemByName("Title 1"); + Item importedItem2 = findItemByName("Title 2"); + assertNotNull("Should have imported Title 1 with limit disabled", importedItem1); + assertNotNull("Should have imported Title 2 with limit disabled", importedItem2); + } + + @Test + public void metadataImportWithEmptyCSVTest() throws Exception { + String[] csv = {"id,collection,dc.title"}; + performImportScript(csv); + assertEquals(0, IteratorUtils.toList(itemService.findAll(context)).size()); + } +} \ No newline at end of file diff --git a/dspace/config/modules/bulkedit.cfg b/dspace/config/modules/bulkedit.cfg index e326e007f884..84a12926bc42 100644 --- a/dspace/config/modules/bulkedit.cfg +++ b/dspace/config/modules/bulkedit.cfg @@ -14,10 +14,9 @@ # The delimiter used to serarate authority data (defaults to a double colon ::) # bulkedit.authorityseparator = :: -# A hard limit of the number of items allowed to be edited in one go in the UI -# (does not apply to the command line version) -# TODO: UNSUPPORTED in DSpace 7.0 -# bulkedit.gui-item-limit = 20 +# A hard limit on the number of items allowed to be imported via the UI. +# To disable this limit, set this value to 0. Defaults to 1000. +bulkedit.import.max-items = 1000 # Metadata elements to exclude when exporting via the user interfaces, or when using the # command line version and not using the -a (all) option. From f66781bb6c12e87bb8c9dae13dbd2af583dced46 Mon Sep 17 00:00:00 2001 From: JohnnyMendesC <177888064+JohnnyMendesC@users.noreply.github.com> Date: Wed, 27 Aug 2025 14:05:17 -0300 Subject: [PATCH 088/283] refactor: Rename configuration property per review feedback (cherry picked from commit 4da59460955b1045eb038aab8eb86af5c2987eff) --- .../main/java/org/dspace/app/bulkedit/MetadataImport.java | 4 ++-- .../test/java/org/dspace/app/bulkedit/MetadataImportIT.java | 6 +++--- dspace/config/modules/bulkedit.cfg | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java index d6d00dfa3c36..fb5657a9e3cb 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/MetadataImport.java @@ -359,13 +359,13 @@ public List runImport(Context c, boolean change, // Process each change rowCount = 1; - int maxItems = configurationService.getIntProperty("bulkedit.import.max-items", 1000); + int maxItems = configurationService.getIntProperty("bulkedit.import.max.items", 1000); int numItems = toImport.size(); if (numItems > maxItems && maxItems > 0) { throw new MetadataImportException( "Import contains " + numItems + " items, which exceeds the configured " + "maximum of " + maxItems + ". You can change this limit by setting " - + "'bulkedit.import.max-items' in your local configuration."); + + "'bulkedit.import.max.items' in your local configuration."); } for (DSpaceCSVLine line : toImport) { diff --git a/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java b/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java index 158c3f23e6a8..9f28834eff32 100644 --- a/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java +++ b/dspace-api/src/test/java/org/dspace/app/bulkedit/MetadataImportIT.java @@ -313,7 +313,7 @@ public void performImportScript(String[] csv, boolean useTemplate) throws Except @Test public void metadataImportExceedsLimitTest() throws Exception { - configurationService.setProperty("bulkedit.import.max-items", 1); + configurationService.setProperty("bulkedit.import.max.items", 1); String[] csv = {"id,collection,dc.title", "+," + collection.getHandle() + ",\"Title 1\"", "+," + collection.getHandle() + ",\"Title 2\""}; @@ -347,7 +347,7 @@ public void metadataImportExceedsLimitTest() throws Exception { @Test public void metadataImportWithItemCountBelowLimitTest() throws Exception { - configurationService.setProperty("bulkedit.import.max-items", 2); + configurationService.setProperty("bulkedit.import.max.items", 2); String[] csv = {"id,collection,dc.title", "+," + collection.getHandle() + ",\"Title 1\"", "+," + collection.getHandle() + ",\"Title 2\""}; @@ -360,7 +360,7 @@ public void metadataImportWithItemCountBelowLimitTest() throws Exception { @Test public void metadataImportWithLimitDisabledTest() throws Exception { - configurationService.setProperty("bulkedit.import.max-items", 0); + configurationService.setProperty("bulkedit.import.max.items", 0); String[] csv = {"id,collection,dc.title", "+," + collection.getHandle() + ",\"Title 1\"", "+," + collection.getHandle() + ",\"Title 2\""}; diff --git a/dspace/config/modules/bulkedit.cfg b/dspace/config/modules/bulkedit.cfg index 84a12926bc42..498d051bc6b2 100644 --- a/dspace/config/modules/bulkedit.cfg +++ b/dspace/config/modules/bulkedit.cfg @@ -16,7 +16,7 @@ # A hard limit on the number of items allowed to be imported via the UI. # To disable this limit, set this value to 0. Defaults to 1000. -bulkedit.import.max-items = 1000 +bulkedit.import.max.items = 1000 # Metadata elements to exclude when exporting via the user interfaces, or when using the # command line version and not using the -a (all) option. From df75357b54deb918f5871f84b6629de90b281afc Mon Sep 17 00:00:00 2001 From: Nathan Buckingham Date: Mon, 25 Aug 2025 21:21:36 -0400 Subject: [PATCH 089/283] 133543: DSpaceCSV respect metadata.hide properties (cherry picked from commit ff372aa0b97ddecdd927416169640e38b2e754e5) --- .../org/dspace/app/bulkedit/DSpaceCSV.java | 50 ++++++--- .../app/util/MetadataExposureServiceImpl.java | 2 +- .../{DSpaceCSVTest.java => DSpaceCSVIT.java} | 104 +++++++++++++++++- dspace/config/modules/bulkedit.cfg | 3 + 4 files changed, 141 insertions(+), 18 deletions(-) rename dspace-api/src/test/java/org/dspace/app/bulkedit/{DSpaceCSVTest.java => DSpaceCSVIT.java} (65%) diff --git a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java index 3533a2397b3d..89caa6c15286 100644 --- a/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java +++ b/dspace-api/src/main/java/org/dspace/app/bulkedit/DSpaceCSV.java @@ -25,6 +25,7 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; +import org.dspace.app.util.MetadataExposureServiceImpl; import org.dspace.authority.AuthorityValue; import org.dspace.authority.factory.AuthorityServiceFactory; import org.dspace.authority.service.AuthorityValueService; @@ -321,20 +322,7 @@ protected void init() { // Set the metadata fields to ignore ignore = new HashMap<>(); - // Specify default values - String[] defaultValues = - new String[] { - "dc.date.accessioned", "dc.date.available", "dc.date.updated", "dc.description.provenance" - }; - String[] toIgnoreArray = - DSpaceServicesFactory.getInstance() - .getConfigurationService() - .getArrayProperty("bulkedit.ignore-on-export", defaultValues); - for (String toIgnoreString : toIgnoreArray) { - if (!"".equals(toIgnoreString.trim())) { - ignore.put(toIgnoreString.trim(), toIgnoreString.trim()); - } - } + getConfiguredIgnoreFields(); } /** @@ -352,6 +340,40 @@ public boolean hasActions() { return false; } + /** + * Sets the ignored fields with 'bulkedit.ignore-on-export' + * + * Also adds 'metadata.hide.*' fields to ignored if 'bulkedit.ignore-on-export.include-metadata-hide' is true + */ + private void getConfiguredIgnoreFields() { + // Specify default values + String[] defaultValues = + new String[] { + "dc.date.accessioned", "dc.date.available", "dc.date.updated", "dc.description.provenance" + }; + String[] toIgnoreArray = + DSpaceServicesFactory.getInstance() + .getConfigurationService() + .getArrayProperty("bulkedit.ignore-on-export", defaultValues); + + boolean ignoreHiddenMetadata = DSpaceServicesFactory.getInstance().getConfigurationService() + .getBooleanProperty("bulkedit.ignore-on-export.include-metadata-hide", true); + if (ignoreHiddenMetadata) { + List hiddenMetadata = DSpaceServicesFactory.getInstance().getConfigurationService() + .getPropertyKeys(MetadataExposureServiceImpl.CONFIG_PREFIX); + for (String hiddenMetadataKey : hiddenMetadata) { + String key = hiddenMetadataKey.split(MetadataExposureServiceImpl.CONFIG_PREFIX)[1]; + ignore.put(key.trim(), key.trim()); + } + } + + for (String toIgnoreString : toIgnoreArray) { + if (!"".equals(toIgnoreString.trim())) { + ignore.put(toIgnoreString.trim(), toIgnoreString.trim()); + } + } + } + /** * Set the value separator for multiple values stored in one csv value. * diff --git a/dspace-api/src/main/java/org/dspace/app/util/MetadataExposureServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/util/MetadataExposureServiceImpl.java index 681867371a06..9a281d65775b 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/MetadataExposureServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/util/MetadataExposureServiceImpl.java @@ -63,7 +63,7 @@ public class MetadataExposureServiceImpl implements MetadataExposureService { protected Map> hiddenElementSets = null; protected Map>> hiddenElementMaps = null; - protected final String CONFIG_PREFIX = "metadata.hide."; + public static final String CONFIG_PREFIX = "metadata.hide."; @Autowired(required = true) protected AuthorizeService authorizeService; diff --git a/dspace-api/src/test/java/org/dspace/app/bulkedit/DSpaceCSVTest.java b/dspace-api/src/test/java/org/dspace/app/bulkedit/DSpaceCSVIT.java similarity index 65% rename from dspace-api/src/test/java/org/dspace/app/bulkedit/DSpaceCSVTest.java rename to dspace-api/src/test/java/org/dspace/app/bulkedit/DSpaceCSVIT.java index 21a1a67dde2b..f4e1e7f2892f 100644 --- a/dspace-api/src/test/java/org/dspace/app/bulkedit/DSpaceCSVTest.java +++ b/dspace-api/src/test/java/org/dspace/app/bulkedit/DSpaceCSVIT.java @@ -9,6 +9,9 @@ import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; import java.io.BufferedWriter; @@ -20,7 +23,15 @@ import org.apache.commons.io.FileUtils; import org.apache.logging.log4j.Logger; -import org.dspace.AbstractUnitTest; +import org.dspace.AbstractIntegrationTestWithDatabase; +import org.dspace.builder.CollectionBuilder; +import org.dspace.builder.CommunityBuilder; +import org.dspace.builder.ItemBuilder; +import org.dspace.content.Collection; +import org.dspace.content.Item; +import org.dspace.services.ConfigurationService; +import org.dspace.services.factory.DSpaceServicesFactory; +import org.junit.Before; import org.junit.Test; @@ -29,11 +40,39 @@ * * @author Stuart Lewis */ -public class DSpaceCSVTest extends AbstractUnitTest { +public class DSpaceCSVIT extends AbstractIntegrationTestWithDatabase { /** * log4j category */ - private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceCSVTest.class); + private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(DSpaceCSVIT.class); + + ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); + + Item testItem; + + + @Override + @Before + public void setUp() throws Exception { + super.setUp(); + context.turnOffAuthorisationSystem(); + + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + configurationService.addPropertyValue("metadata.hide.dc.subject", true); + + Collection parentCollection = CollectionBuilder.createCollection(context, parentCommunity) + .withName("Parent Collection") + .build(); + + testItem = ItemBuilder.createItem(context, parentCollection).withTitle("Test Item") + .withMetadata("dc", "description", "provenance", "provenance") + .withMetadata("dc", "subject", null, "hidden subject") + .build(); + + context.restoreAuthSystemState(); + } /** * Test the reading and parsing of CSV files @@ -147,4 +186,63 @@ public void testDSpaceCSV() { fail("IO Error while creating test CSV file"); } } + + /** + * Test the hidden metadata for csv is respected + * + */ + @Test + public void testHiddenDspaceCSV() throws Exception { + + DSpaceCSV dSpaceCSV = new DSpaceCSV(false); + + dSpaceCSV.addItem(testItem); + + List lines = dSpaceCSV.getCSVLines(); + + assertThat(lines.size(), equalTo(1)); + + DSpaceCSVLine line = lines.get(0); + + List subject = line.get("dc.subject"); + List provenance = line.get("dc.description.provenance"); + List title = line.get("dc.title"); + + assertNull(subject); + assertNull(provenance); + assertNotNull(title); + assertEquals("Test Item", title.get(0)); + + } + + /** + * Test the hidden metadata is still shown when force is applied. + * + */ + @Test + public void testHiddenDspaceForceCSV() throws Exception { + + DSpaceCSV dSpaceCSV = new DSpaceCSV(true); + + dSpaceCSV.addItem(testItem); + + List lines = dSpaceCSV.getCSVLines(); + + assertThat(lines.size(), equalTo(1)); + + DSpaceCSVLine line = lines.get(0); + + List subject = line.get("dc.subject"); + List provenance = line.get("dc.description.provenance"); + List title = line.get("dc.title"); + + assertNotNull(subject); + assertNotNull(provenance); + assertEquals("hidden subject", subject.get(0)); + assertEquals("provenance", provenance.get(0)); + assertNotNull(title); + assertEquals("Test Item", title.get(0)); + + } + } diff --git a/dspace/config/modules/bulkedit.cfg b/dspace/config/modules/bulkedit.cfg index 498d051bc6b2..7a9685d09ace 100644 --- a/dspace/config/modules/bulkedit.cfg +++ b/dspace/config/modules/bulkedit.cfg @@ -44,3 +44,6 @@ bulkedit.change.commit.count = 100 # Recommend to keep this at a feasible number, as exporting large amounts of items can be resource intensive # If not set, this will default to 500 items # bulkedit.export.max.items = 500 + +# Bulkedit setting to add metadata.hide fields to ignored fields defaults to true +# bulkedit.ignore-on-export.include-metadata-hide = true From bc28ded2f7533808167403d9ff89a7ff9104e7b0 Mon Sep 17 00:00:00 2001 From: Pascal-Nicolas Becker Date: Thu, 11 Dec 2025 12:11:54 +0100 Subject: [PATCH 090/283] Curator does not support items without handles The curation task CreateMissingIdentifiers should create all identifiers an item misses. Unfortunately it will not be started, if the item does not have a handle, as the curator falls back to handles, even if a uuid is given as identifier. This PR changes the Curator to check if an identifier is a uuid if no handle was found. I added a test to the CreateMissingIdentifiersIT. It would probably be better to add a test to the Curator, but the CreateMissingIdentifier task seems to be the most likely target for such a scenario. (cherry picked from commit 4a23b71758cf8d2fd3d0c1c3718f30b13d3452d1) --- .../dspace/curate/AbstractCurationTask.java | 26 +++++++- .../main/java/org/dspace/curate/Curator.java | 18 ++++++ .../general/CreateMissingIdentifiersIT.java | 60 +++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java b/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java index fa16d2736953..ca370bc68fe9 100644 --- a/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java +++ b/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java @@ -11,8 +11,13 @@ import java.sql.SQLException; import java.util.Iterator; import java.util.List; +import java.util.UUID; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.dspace.app.util.factory.UtilServiceFactory; +import org.dspace.app.util.service.DSpaceObjectUtils; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.content.DSpaceObject; @@ -42,6 +47,8 @@ public abstract class AbstractCurationTask implements CurationTask { protected ItemService itemService; protected HandleService handleService; protected ConfigurationService configurationService; + protected DSpaceObjectUtils dspaceObjectUtils; + private static final Logger log = LogManager.getLogger(); @Override public void init(Curator curator, String taskId) throws IOException { @@ -51,6 +58,7 @@ public void init(Curator curator, String taskId) throws IOException { itemService = ContentServiceFactory.getInstance().getItemService(); handleService = HandleServiceFactory.getInstance().getHandleService(); configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); + dspaceObjectUtils = UtilServiceFactory.getInstance().getDSpaceObjectUtils(); } @Override @@ -167,8 +175,24 @@ public int perform(Context ctx, String id) throws IOException { * @throws IOException if IO error */ protected DSpaceObject dereference(Context ctx, String id) throws IOException { + // the identifier can be a handle or uuid. Try handle first try { - return handleService.resolveToObject(ctx, id); + DSpaceObject dso = handleService.resolveToObject(ctx, id); + // if the id did not resolve to a handle, check if it is a uuid + if (dso == null) { + UUID uuid = null; + try { + uuid = UUID.fromString(id); + } catch (IllegalArgumentException iae) { + // no uuid, nothing to do here. + log.debug("ID {} is not a valid UUID", id); + } + if (uuid != null) { + dso = dspaceObjectUtils.findDSpaceObject(ctx, uuid); + } + } + // dso is either null or a DSpaceObject + return dso; } catch (SQLException sqlE) { throw new IOException(sqlE.getMessage(), sqlE); } diff --git a/dspace-api/src/main/java/org/dspace/curate/Curator.java b/dspace-api/src/main/java/org/dspace/curate/Curator.java index 4076fab51989..126f07aed229 100644 --- a/dspace-api/src/main/java/org/dspace/curate/Curator.java +++ b/dspace-api/src/main/java/org/dspace/curate/Curator.java @@ -15,9 +15,12 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.UUID; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.dspace.app.util.factory.UtilServiceFactory; +import org.dspace.app.util.service.DSpaceObjectUtils; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.content.DSpaceObject; @@ -90,6 +93,7 @@ public static enum TxScope { protected TaskResolver resolver = new TaskResolver(); protected TxScope txScope = TxScope.OPEN; protected CommunityService communityService; + protected DSpaceObjectUtils dspaceObjectUtils; protected ItemService itemService; protected HandleService handleService; protected DSpaceRunnableHandler handler; @@ -109,6 +113,7 @@ public Curator(DSpaceRunnableHandler handler) { */ public Curator() { communityService = ContentServiceFactory.getInstance().getCommunityService(); + dspaceObjectUtils = UtilServiceFactory.getInstance().getDSpaceObjectUtils(); itemService = ContentServiceFactory.getInstance().getItemService(); handleService = HandleServiceFactory.getInstance().getHandleService(); resolver = new TaskResolver(); @@ -249,6 +254,19 @@ public void curate(Context c, String id) throws IOException { curationCtx.set(c); DSpaceObject dso = handleService.resolveToObject(c, id); + // check if the DSpace Object does not have a handle and must be resolved by its uuid + if (dso == null) { + UUID uuid = null; + try { + uuid = UUID.fromString(id); + } catch (IllegalArgumentException iae) { + // no uuid, nothing to do here. + log.debug("ID {} is not a valid UUID", id); + } + if (uuid != null) { + dso = dspaceObjectUtils.findDSpaceObject(c, uuid); + } + } if (dso != null) { curate(dso); } else { diff --git a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java index 8ecddc6cd50c..63157301b960 100644 --- a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java +++ b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java @@ -8,8 +8,12 @@ package org.dspace.ctask.general; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; import java.io.IOException; +import java.util.List; +import java.util.stream.Collectors; import org.dspace.builder.CollectionBuilder; import org.dspace.builder.CommunityBuilder; @@ -19,6 +23,7 @@ import org.dspace.core.factory.CoreServiceFactory; import org.dspace.curate.Curator; import org.dspace.identifier.AbstractIdentifierProviderIT; +import org.dspace.identifier.IdentifierProvider; import org.dspace.identifier.VersionedHandleIdentifierProvider; import org.dspace.identifier.VersionedHandleIdentifierProviderWithCanonicalHandles; import org.dspace.services.ConfigurationService; @@ -85,4 +90,59 @@ public void testPerform() assertEquals("Curation should succeed", Curator.CURATE_SUCCESS, status); configurationService.setProperty(P_TASK_DEF, prevTaskDef); } + + @Test + public void testCreationOfMissingHandles() throws IOException { + // Must remove any cached named plugins before creating a new one + CoreServiceFactory.getInstance().getPluginService().clearNamedPluginClasses(); + // Define a new task dynamically + configurationService.setProperty(P_TASK_DEF, + CreateMissingIdentifiers.class.getCanonicalName() + " = " + TASK_NAME); + + // deactivate all identifier provider + List identifierProviders = identifierService.getProviders(); + List identifierProviderClasses = + identifierProviders.stream().map(Object::getClass).distinct().collect(Collectors.toList()); + for (Class identifierProviderClass : identifierProviderClasses) { + unregisterProvider(identifierProviderClass); + } + + try { + context.setCurrentUser(admin); + parentCommunity = CommunityBuilder.createCommunity(context) + .build(); + Collection collection = CollectionBuilder.createCollection(context, parentCommunity) + .build(); + // create item and assert it did not got any handle + Item item = ItemBuilder.createItem(context, collection) + .build(); + assertNull("Internal error in createMissingIdentifiersIT: item should not have a handle", + item.getHandle()); + + // setup the curator + Curator curator = new Curator(); + curator.addTask(TASK_NAME); + + // register the default Handle Provider + registerProvider(VersionedHandleIdentifierProvider.class); + + /* + * Now, verify curate with default Handle Provider works + * (and that our re-registration of the default provider above was successful) + * Use the uuid as reference to the item as the curation system takes handles and uuid as cli arguments. + * Do not use the item reference, to be sure the curator and the curation task are able to work without + * handle. + */ + curator.curate(context, item.getID().toString()); + int status = curator.getStatus(TASK_NAME); + assertEquals("Curation should succeed", Curator.CURATE_SUCCESS, status); + // assure we got a handle + assertNotNull("Curation task CreateMissingIdentifiers, did not assign a handle.", item.getHandle()); + } finally { + // restore the identifierProviders for following tests + for (Class identifierProviderClass : identifierProviderClasses) { + registerProvider(identifierProviderClass); + } + } + } } From be1d8d2ababb91c52efec5a63f241f39a58ae9a0 Mon Sep 17 00:00:00 2001 From: Pascal-Nicolas Becker Date: Thu, 19 Feb 2026 16:47:24 +0100 Subject: [PATCH 091/283] Move code to find items by uuid or handle to DSpaceObjectUtil (cherry picked from commit bdc575ff2b65a632b10db463a7e2a1aca6e41828) --- .../app/util/DSpaceObjectUtilsImpl.java | 31 ++++++++++++++++ .../app/util/service/DSpaceObjectUtils.java | 13 +++++++ .../dspace/curate/AbstractCurationTask.java | 35 ++----------------- .../main/java/org/dspace/curate/Curator.java | 16 +-------- 4 files changed, 48 insertions(+), 47 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/util/DSpaceObjectUtilsImpl.java b/dspace-api/src/main/java/org/dspace/app/util/DSpaceObjectUtilsImpl.java index e3f2b0ea5faa..33621abd529d 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DSpaceObjectUtilsImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DSpaceObjectUtilsImpl.java @@ -15,12 +15,15 @@ import org.dspace.content.factory.ContentServiceFactory; import org.dspace.content.service.DSpaceObjectService; import org.dspace.core.Context; +import org.dspace.handle.service.HandleService; import org.springframework.beans.factory.annotation.Autowired; public class DSpaceObjectUtilsImpl implements DSpaceObjectUtils { @Autowired private ContentServiceFactory contentServiceFactory; + @Autowired + private HandleService handleService; /** * Retrieve a DSpaceObject from its uuid. As this method need to iterate over all the different services that @@ -44,4 +47,32 @@ public DSpaceObject findDSpaceObject(Context context, UUID uuid) throws SQLExcep } return null; } + + /** + * Retrieve a DSpaceObject from its uuid or handle. As this method need to iterate over all the different services + * that support concrete class of DSpaceObject it has poor performance. Please consider the use of the direct + * service (ItemService, CommunityService, etc.) if you know in advance the type of DSpaceObject that you are + * looking for + * + * @param context DSpace context + * @param id the uuid or handle to lookup + * @return the DSpaceObject if any with the supplied uuid or handle + * @throws SQLException + */ + public DSpaceObject findDSpaceObject(Context context, String id) throws SQLException { + DSpaceObject dso = handleService.resolveToObject(context, id); + // if the id did not resolve to a handle, check if it is a uuid + if (dso == null) { + UUID uuid = null; + try { + uuid = UUID.fromString(id); + } catch (IllegalArgumentException iae) { + // nothing to do here. We check later fo empty uuids anyway + } + if (uuid != null) { + dso = findDSpaceObject(context, uuid); + } + } + return dso; + } } diff --git a/dspace-api/src/main/java/org/dspace/app/util/service/DSpaceObjectUtils.java b/dspace-api/src/main/java/org/dspace/app/util/service/DSpaceObjectUtils.java index e6a97004ef60..8088a4ca4de5 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/service/DSpaceObjectUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/util/service/DSpaceObjectUtils.java @@ -30,4 +30,17 @@ public interface DSpaceObjectUtils { * @throws SQLException */ public DSpaceObject findDSpaceObject(Context context, UUID uuid) throws SQLException; + + /** + * Retrieve a DSpaceObject from its uuid or handle. As this method need to iterate over all the different services + * that support concrete class of DSpaceObject it has poor performance. Please consider the use of the direct + * service (ItemService, CommunityService, etc.) if you know in advance the type of DSpaceObject that you are + * looking for + * + * @param context DSpace context + * @param id the uuid or handle to lookup + * @return the DSpaceObject if any with the supplied uuid or handle + * @throws SQLException + */ + public DSpaceObject findDSpaceObject(Context context, String id) throws SQLException; } diff --git a/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java b/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java index ca370bc68fe9..4d59d46a8042 100644 --- a/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java +++ b/dspace-api/src/main/java/org/dspace/curate/AbstractCurationTask.java @@ -11,7 +11,6 @@ import java.sql.SQLException; import java.util.Iterator; import java.util.List; -import java.util.UUID; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; @@ -161,41 +160,13 @@ protected void performItem(Item item) throws SQLException, IOException { @Override public int perform(Context ctx, String id) throws IOException { - DSpaceObject dso = dereference(ctx, id); - return (dso != null) ? perform(dso) : Curator.CURATE_FAIL; - } - - /** - * Returns a DSpaceObject for passed identifier, if it exists - * - * @param ctx DSpace context - * @param id canonical id of object - * @return dso - * DSpace object, or null if no object with id exists - * @throws IOException if IO error - */ - protected DSpaceObject dereference(Context ctx, String id) throws IOException { - // the identifier can be a handle or uuid. Try handle first + DSpaceObject dso = null; try { - DSpaceObject dso = handleService.resolveToObject(ctx, id); - // if the id did not resolve to a handle, check if it is a uuid - if (dso == null) { - UUID uuid = null; - try { - uuid = UUID.fromString(id); - } catch (IllegalArgumentException iae) { - // no uuid, nothing to do here. - log.debug("ID {} is not a valid UUID", id); - } - if (uuid != null) { - dso = dspaceObjectUtils.findDSpaceObject(ctx, uuid); - } - } - // dso is either null or a DSpaceObject - return dso; + dso = dspaceObjectUtils.findDSpaceObject(ctx, id); } catch (SQLException sqlE) { throw new IOException(sqlE.getMessage(), sqlE); } + return (dso != null) ? perform(dso) : Curator.CURATE_FAIL; } /** diff --git a/dspace-api/src/main/java/org/dspace/curate/Curator.java b/dspace-api/src/main/java/org/dspace/curate/Curator.java index 126f07aed229..91f984b72e5b 100644 --- a/dspace-api/src/main/java/org/dspace/curate/Curator.java +++ b/dspace-api/src/main/java/org/dspace/curate/Curator.java @@ -15,7 +15,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.UUID; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -253,20 +252,7 @@ public void curate(Context c, String id) throws IOException { //Save the context on current execution thread curationCtx.set(c); - DSpaceObject dso = handleService.resolveToObject(c, id); - // check if the DSpace Object does not have a handle and must be resolved by its uuid - if (dso == null) { - UUID uuid = null; - try { - uuid = UUID.fromString(id); - } catch (IllegalArgumentException iae) { - // no uuid, nothing to do here. - log.debug("ID {} is not a valid UUID", id); - } - if (uuid != null) { - dso = dspaceObjectUtils.findDSpaceObject(c, uuid); - } - } + DSpaceObject dso = dspaceObjectUtils.findDSpaceObject(c,id); if (dso != null) { curate(dso); } else { From 055128290fb8e5fb1f39c2628e9c78b26d4554f7 Mon Sep 17 00:00:00 2001 From: Pascal-Nicolas Becker Date: Thu, 19 Feb 2026 16:47:53 +0100 Subject: [PATCH 092/283] Restore curation task configuration at the end of IT (cherry picked from commit 0cc9a4d89add6adba4fff2ae4e372b61e0197e2e) --- .../org/dspace/ctask/general/CreateMissingIdentifiersIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java index 63157301b960..5013f2cb6690 100644 --- a/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java +++ b/dspace-api/src/test/java/org/dspace/ctask/general/CreateMissingIdentifiersIT.java @@ -96,6 +96,7 @@ public void testCreationOfMissingHandles() throws IOException { // Must remove any cached named plugins before creating a new one CoreServiceFactory.getInstance().getPluginService().clearNamedPluginClasses(); // Define a new task dynamically + String[] prevTaskDef = configurationService.getArrayProperty(P_TASK_DEF); configurationService.setProperty(P_TASK_DEF, CreateMissingIdentifiers.class.getCanonicalName() + " = " + TASK_NAME); @@ -143,6 +144,8 @@ public void testCreationOfMissingHandles() throws IOException { for (Class identifierProviderClass : identifierProviderClasses) { registerProvider(identifierProviderClass); } + // restore curation task configuration + configurationService.setProperty(P_TASK_DEF, prevTaskDef); } } } From 4ad9b1225f7e80ecb339f0080806b4d916d12f1a Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Fri, 27 Feb 2026 13:56:17 +0100 Subject: [PATCH 093/283] Migrate SHERPA/RoMEO integration to Jisc Open Policy Finder API The legacy SHERPA/RoMEO API at v2.sherpa.ac.uk is being retired at the end of April 2026. This migrates DSpace to the new Jisc Open Policy Finder API platform (fixes #12003). Two breaking changes addressed: - Base URL: v2.sherpa.ac.uk/cgi/retrieve -> api.openpolicyfinder.jisc.ac.uk/retrieve - Authentication: api-key query parameter -> x-api-key HTTP header Legacy sherpa.romeo.* config properties still work as fallback with deprecation warnings logged. Co-Authored-By: Claude Opus 4.6 --- .../org/dspace/app/sherpa/SHERPAService.java | 128 +++++++++++------- .../authority/SHERPARoMEOJournalTitle.java | 2 +- .../authority/SHERPARoMEOPublisher.java | 2 +- .../impl/SHERPAv2JournalDataProvider.java | 3 +- .../impl/SHERPAv2PublisherDataProvider.java | 3 +- .../spring-dspace-addon-sherpa-services.xml | 1 + .../dspace/app/sherpa/MockSHERPAService.java | 16 ++- .../dspace/app/sherpa/SHERPAServiceTest.java | 34 ++--- .../org/dspace/app/sherpa/2731-0582.json | 12 +- .../resources/org/dspace/app/sherpa/plos.json | 20 +-- .../org/dspace/app/sherpa/thelancet.json | 10 +- dspace/config/dspace.cfg | 20 +-- dspace/config/spring/api/sherpa.xml | 1 + 13 files changed, 140 insertions(+), 112 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java b/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java index 1fec20f51fee..c1d1b3d8fb6e 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java +++ b/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java @@ -34,8 +34,8 @@ import org.springframework.cache.annotation.Cacheable; /** - * SHERPAService is responsible for making the HTTP call to the SHERPA v2 API - * for SHERPASubmitService. + * SHERPAService is responsible for making the HTTP call to the Jisc Open Policy Finder API + * (formerly SHERPA/RoMEO v2) for SHERPASubmitService. * Note, this service is ported from DSpace 6 for the ability to search policies by ISSN * There are also new DataProvider implementations provided for use as 'external sources' * of journal and publisher data @@ -63,14 +63,32 @@ public class SHERPAService { @SuppressWarnings("unused") @PostConstruct private void init() { - // Get endpoint and API key from configuration - endpoint = configurationService.getProperty("sherpa.romeo.url", - "https://v2.sherpa.ac.uk/cgi/retrieve"); - apiKey = configurationService.getProperty("sherpa.romeo.apikey"); + // Get endpoint and API key from configuration, with fallback to legacy property names + String newUrl = configurationService.getProperty("openpolicyfinder.url"); + String legacyUrl = configurationService.getProperty("sherpa.romeo.url"); + if (newUrl != null) { + endpoint = newUrl; + } else if (legacyUrl != null) { + endpoint = legacyUrl; + log.warn("Configuration property 'sherpa.romeo.url' is deprecated. " + + "Please use 'openpolicyfinder.url' instead."); + } else { + endpoint = "https://api.openpolicyfinder.jisc.ac.uk/retrieve"; + } + + String newApiKey = configurationService.getProperty("openpolicyfinder.apikey"); + String legacyApiKey = configurationService.getProperty("sherpa.romeo.apikey"); + if (newApiKey != null) { + apiKey = newApiKey; + } else if (legacyApiKey != null) { + apiKey = legacyApiKey; + log.warn("Configuration property 'sherpa.romeo.apikey' is deprecated. " + + "Please use 'openpolicyfinder.apikey' instead."); + } } /** - * Search the SHERPA v2 API for a journal policy data using the supplied ISSN. + * Search the Open Policy Finder API for journal policy data using the supplied ISSN. * If the API key is missing, or the HTTP response is non-OK or does not complete * successfully, a simple error response will be returned. * Otherwise, the response body will be passed to SHERPAResponse for parsing as JSON @@ -84,9 +102,9 @@ public SHERPAResponse searchByJournalISSN(String query) { } /** - * Perform an API request to the SHERPA v2 API - this could be a search or a get for any entity type + * Perform an API request to the Open Policy Finder API - this could be a search or a get for any entity type * but the return object here must be a SHERPAPublisherResponse not the journal-centric SHERPAResponse - * For more information about the type, field and predicate arguments, see the SHERPA v2 API documentation + * For more information about the type, field and predicate arguments, see the API documentation * @param type entity type eg "publisher" * @param field field eg "issn" or "title" * @param predicate predicate eg "equals" or "contains-word" @@ -97,10 +115,11 @@ public SHERPAResponse searchByJournalISSN(String query) { */ public SHERPAPublisherResponse performPublisherRequest(String type, String field, String predicate, String value, int start, int limit) { - // API Key is *required* for v2 API calls + // API Key is *required* for API calls if (null == apiKey) { - log.error("SHERPA ROMeO API Key missing: please register for an API key and set sherpa.romeo.apikey"); - return new SHERPAPublisherResponse("SHERPA/RoMEO configuration invalid or missing"); + log.error("Open Policy Finder API Key missing: " + + "please register for an API key and set openpolicyfinder.apikey"); + return new SHERPAPublisherResponse("Open Policy Finder configuration invalid or missing"); } HttpGet method = null; @@ -111,7 +130,8 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field numberOfTries++; log.debug(String.format( - "Trying to contact SHERPA/RoMEO - attempt %d of %d; timeout is %d; sleep between timeouts is %d", + "Trying to contact Open Policy Finder - attempt %d of %d; timeout is %d; " + + "sleep between timeouts is %d", numberOfTries, maxNumberOfTries, timeout, @@ -131,40 +151,41 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field + response.getStatusLine().getReasonPhrase()); if (statusCode != HttpStatus.SC_OK) { - sherpaResponse = new SHERPAPublisherResponse("SHERPA/RoMEO return not OK status: " - + statusCode); + sherpaResponse = new SHERPAPublisherResponse( + "Open Policy Finder return not OK status: " + statusCode); String errorBody = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); - log.error("Error from SHERPA HTTP request: " + errorBody); + log.error("Error from Open Policy Finder HTTP request: " + errorBody); } HttpEntity responseBody = response.getEntity(); // If the response body is valid, pass to SHERPAResponse for parsing as JSON if (null != responseBody) { - log.debug("Non-null SHERPA response received for query of " + value); + log.debug("Non-null response received for query of " + value); InputStream content = null; try { content = responseBody.getContent(); sherpaResponse = new SHERPAPublisherResponse(content, SHERPAPublisherResponse.SHERPAFormat.JSON); } catch (IOException e) { - log.error("Encountered exception while contacting SHERPA/RoMEO: " + e.getMessage(), e); + log.error("Encountered exception while contacting Open Policy Finder: " + + e.getMessage(), e); } finally { if (content != null) { content.close(); } } } else { - log.debug("Empty SHERPA response body for query on " + value); - sherpaResponse = new SHERPAPublisherResponse("SHERPA/RoMEO returned no response"); + log.debug("Empty response body for query on " + value); + sherpaResponse = new SHERPAPublisherResponse("Open Policy Finder returned no response"); } } } catch (URISyntaxException e) { - String errorMessage = "Error building SHERPA v2 API URI: " + e.getMessage(); + String errorMessage = "Error building Open Policy Finder API URI: " + e.getMessage(); log.error(errorMessage, e); sherpaResponse = new SHERPAPublisherResponse(errorMessage); } catch (IOException e) { - String errorMessage = "Encountered exception while contacting SHERPA/RoMEO: " + e.getMessage(); + String errorMessage = "Encountered exception while contacting Open Policy Finder: " + e.getMessage(); log.error(errorMessage, e); sherpaResponse = new SHERPAPublisherResponse(errorMessage); } catch (InterruptedException e) { @@ -179,9 +200,9 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field } if (sherpaResponse == null) { - log.debug("SHERPA response is still null"); + log.debug("Response is still null"); sherpaResponse = new SHERPAPublisherResponse( - "Error processing the SHERPA/RoMEO answer"); + "Error processing the Open Policy Finder answer"); } // Return the final response @@ -189,8 +210,8 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field } /** - * Perform an API request to the SHERPA v2 API - this could be a search or a get for any entity type - * For more information about the type, field and predicate arguments, see the SHERPA v2 API documentation + * Perform an API request to the Open Policy Finder API - this could be a search or a get for any entity type + * For more information about the type, field and predicate arguments, see the API documentation * @param type entity type eg "publication" or "publisher" * @param field field eg "issn" or "title" * @param predicate predicate eg "equals" or "contains-word" @@ -201,10 +222,11 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field */ public SHERPAResponse performRequest(String type, String field, String predicate, String value, int start, int limit) { - // API Key is *required* for v2 API calls + // API Key is *required* for API calls if (null == apiKey) { - log.error("SHERPA ROMeO API Key missing: please register for an API key and set sherpa.romeo.apikey"); - return new SHERPAResponse("SHERPA/RoMEO configuration invalid or missing"); + log.error("Open Policy Finder API Key missing: " + + "please register for an API key and set openpolicyfinder.apikey"); + return new SHERPAResponse("Open Policy Finder configuration invalid or missing"); } HttpGet method = null; @@ -215,7 +237,8 @@ public SHERPAResponse performRequest(String type, String field, String predicate numberOfTries++; log.debug(String.format( - "Trying to contact SHERPA/RoMEO - attempt %d of %d; timeout is %d; sleep between timeouts is %d", + "Trying to contact Open Policy Finder - attempt %d of %d; timeout is %d; " + + "sleep between timeouts is %d", numberOfTries, maxNumberOfTries, timeout, @@ -235,39 +258,40 @@ public SHERPAResponse performRequest(String type, String field, String predicate + response.getStatusLine().getReasonPhrase()); if (statusCode != HttpStatus.SC_OK) { - sherpaResponse = new SHERPAResponse("SHERPA/RoMEO return not OK status: " - + statusCode); + sherpaResponse = new SHERPAResponse( + "Open Policy Finder return not OK status: " + statusCode); String errorBody = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); - log.error("Error from SHERPA HTTP request: " + errorBody); + log.error("Error from Open Policy Finder HTTP request: " + errorBody); } HttpEntity responseBody = response.getEntity(); // If the response body is valid, pass to SHERPAResponse for parsing as JSON if (null != responseBody) { - log.debug("Non-null SHERPA response received for query of " + value); + log.debug("Non-null response received for query of " + value); InputStream content = null; try { content = responseBody.getContent(); sherpaResponse = new SHERPAResponse(content, SHERPAResponse.SHERPAFormat.JSON); } catch (IOException e) { - log.error("Encountered exception while contacting SHERPA/RoMEO: " + e.getMessage(), e); + log.error("Encountered exception while contacting Open Policy Finder: " + + e.getMessage(), e); } finally { if (content != null) { content.close(); } } } else { - log.debug("Empty SHERPA response body for query on " + value); - sherpaResponse = new SHERPAResponse("SHERPA/RoMEO returned no response"); + log.debug("Empty response body for query on " + value); + sherpaResponse = new SHERPAResponse("Open Policy Finder returned no response"); } } } catch (URISyntaxException e) { - String errorMessage = "Error building SHERPA v2 API URI: " + e.getMessage(); + String errorMessage = "Error building Open Policy Finder API URI: " + e.getMessage(); log.error(errorMessage, e); sherpaResponse = new SHERPAResponse(errorMessage); } catch (IOException e) { - String errorMessage = "Encountered exception while contacting SHERPA/RoMEO: " + e.getMessage(); + String errorMessage = "Encountered exception while contacting Open Policy Finder: " + e.getMessage(); log.error(errorMessage, e); sherpaResponse = new SHERPAResponse(errorMessage); } catch (InterruptedException e) { @@ -282,9 +306,9 @@ public SHERPAResponse performRequest(String type, String field, String predicate } if (sherpaResponse == null) { - log.debug("SHERPA response is still null"); + log.debug("Response is still null"); sherpaResponse = new SHERPAResponse( - "Error processing the SHERPA/RoMEO answer"); + "Error processing the Open Policy Finder answer"); } // Return the final response @@ -339,15 +363,17 @@ public HttpGet constructHttpGet(String type, String field, String predicate, Str if (limit > 0) { uriBuilder.addParameter("limit", String.valueOf(limit)); } - if (StringUtils.isNotBlank(apiKey)) { - uriBuilder.addParameter("api-key", apiKey); - } - log.debug("SHERPA API URL: " + uriBuilder.toString()); + log.debug("Open Policy Finder API URL: " + uriBuilder.toString()); // Create HTTP GET object HttpGet method = new HttpGet(uriBuilder.build()); + // Set API key as HTTP header (required by Jisc Open Policy Finder API) + if (StringUtils.isNotBlank(apiKey)) { + method.addHeader("x-api-key", apiKey); + } + // Set connection parameters int timeout = 5000; method.setConfig(RequestConfig.custom() @@ -360,10 +386,11 @@ public HttpGet constructHttpGet(String type, String field, String predicate, Str } /** - * Prepare the API query for execution by the HTTP client + * Prepare the API query URI for validation purposes. + * Note: the API key is sent as an HTTP header, not as a query parameter. * @param query ISSN query string * @param endpoint API endpoint (base URL) - * @param apiKey API key parameter + * @param apiKey API key (unused in URI construction, kept for signature compatibility) * @return URI object * @throws URISyntaxException */ @@ -379,14 +406,11 @@ public URI prepareQuery(String query, String endpoint, String apiKey) throws URI // Log warning if no query is supplied if (null == query) { - log.warn("No ISSN supplied as query string for SHERPA service search"); + log.warn("No ISSN supplied as query string for Open Policy Finder service search"); } uriBuilder.addParameter("filter", "[[\"issn\",\"equals\",\"" + query + "\"]]"); uriBuilder.addParameter("format", "Json"); - if (StringUtils.isNotBlank(apiKey)) { - uriBuilder.addParameter("api-key", apiKey); - } - log.debug("Would search SHERPA endpoint with " + uriBuilder.toString()); + log.debug("Would search Open Policy Finder endpoint with " + uriBuilder.toString()); // Return final built URI return uriBuilder.build(); diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java index 418000e51e2a..14c0abacd2ed 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java @@ -16,7 +16,7 @@ import org.dspace.utils.DSpace; /** - * Journal-name authority based on SHERPA/RoMEO v2 + * Journal-name authority based on the Jisc Open Policy Finder API (formerly SHERPA/RoMEO v2) * * @author Larry Stone * @author Andrea Bollini (andrea.bollini at 4science.it) diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java index d1001ce5dba8..a8e834c27d68 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java @@ -16,7 +16,7 @@ import org.dspace.utils.DSpace; /** - * Publisher name authority based on SHERPA/RoMEO v2 + * Publisher name authority based on the Jisc Open Policy Finder API (formerly SHERPA/RoMEO v2) * * @author Larry Stone * @author Andrea Bollini (andrea.bollini at 4science.it) diff --git a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java b/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java index f0ce6a979a1f..c39c6dd13525 100644 --- a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java +++ b/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java @@ -26,7 +26,8 @@ /** * This class is the implementation of the ExternalDataProvider interface that will deal with SherpaJournal External * data lookups. - * This provider is a refactored version of SherpaJournalDataPublisher, rewritten to work with SHERPA v2 API + * This provider is a refactored version of SherpaJournalDataPublisher, rewritten to work with + * the Jisc Open Policy Finder API (formerly SHERPA v2 API) * * @author Kim Shepherd */ diff --git a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java b/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java index af922220ce54..0afe78b44137 100644 --- a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java +++ b/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java @@ -26,7 +26,8 @@ /** * This class is the implementation of the ExternalDataProvider interface that will deal with SHERPAPublisher External * data lookups. - * This provider is a refactored version of SherpaPublisherDataPublisher, rewritten to work with SHERPA v2 API + * This provider is a refactored version of SherpaPublisherDataPublisher, rewritten to work with + * the Jisc Open Policy Finder API (formerly SHERPA v2 API) * * It uses a more simple response object than the normal publication / policy search * diff --git a/dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml b/dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml index 76891d169c97..e2726e609b52 100644 --- a/dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml +++ b/dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml @@ -19,6 +19,7 @@ + diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java b/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java index 239d2864bfb1..f52f3032df40 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java +++ b/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java @@ -39,9 +39,11 @@ public class MockSHERPAService extends SHERPAService { public SHERPAResponse performRequest(String type, String field, String predicate, String value, int start, int limit) { try { - String endpoint = configurationService.getProperty("sherpa.romeo.url", - "https://v2.sherpa.ac.uk/cgi/retrieve"); - String apiKey = configurationService.getProperty("sherpa.romeo.apikey"); + String endpoint = configurationService.getProperty("openpolicyfinder.url", + configurationService.getProperty("sherpa.romeo.url", + "https://api.openpolicyfinder.jisc.ac.uk/retrieve")); + String apiKey = configurationService.getProperty("openpolicyfinder.apikey", + configurationService.getProperty("sherpa.romeo.apikey")); // Rather than search, we will simply attempt to build the URI using the real pepare method // so that any errors there are caught, and will return a valid response for The Lancet @@ -96,9 +98,11 @@ private InputStream getContent(String fileName) { public SHERPAPublisherResponse performPublisherRequest(String type, String field, String predicate, String value, int start, int limit) { try { - String endpoint = configurationService.getProperty("sherpa.romeo.url", - "https://v2.sherpa.ac.uk/cgi/retrieve"); - String apiKey = configurationService.getProperty("sherpa.romeo.apikey"); + String endpoint = configurationService.getProperty("openpolicyfinder.url", + configurationService.getProperty("sherpa.romeo.url", + "https://api.openpolicyfinder.jisc.ac.uk/retrieve")); + String apiKey = configurationService.getProperty("openpolicyfinder.apikey", + configurationService.getProperty("sherpa.romeo.apikey")); // Rather than search, we will simply attempt to build the URI using the real pepare method // so that any errors there are caught, and will return a valid response for The Lancet diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java b/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java index e6c3f4d07302..dde41ebcfa0a 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java +++ b/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java @@ -17,7 +17,6 @@ import java.nio.charset.StandardCharsets; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.apache.http.client.utils.URIBuilder; import org.dspace.AbstractDSpaceTest; import org.dspace.app.sherpa.v2.SHERPAPublisherResponse; @@ -88,15 +87,15 @@ public void testSearchByJournalISSN() { /** * Test that the URIBuilder and sanitation procedures are producing expected URLs, comparing the results - * to manually compiled strings + * to manually compiled strings. Note: the API key is now sent as an HTTP header, not as a query parameter. * @throws URISyntaxException */ @Test public void testUriConstruction() throws URISyntaxException, UnsupportedEncodingException { - // Get values for base URL and api key parameter - String endpoint = configurationService.getProperty("sherpa.romeo.url", - "https://v2.sherpa.ac.uk/cgi/retrieve"); - String apiKey = configurationService.getProperty("sherpa.romeo.apikey", null); + // Get values for base URL (API key is now a header, not in the URL) + String endpoint = configurationService.getProperty("openpolicyfinder.url", + configurationService.getProperty("sherpa.romeo.url", + "https://api.openpolicyfinder.jisc.ac.uk/retrieve")); // Compare expected outputs // Valid ISSN (The Lancet) @@ -109,27 +108,27 @@ public void testUriConstruction() throws URISyntaxException, UnsupportedEncoding "TEST", SHERPAUtils.sanitiseQuery(invalidISSN)); // The valid string should look like this (assuming default configuration) - // https://v2.sherpa.ac.uk/cgi/retrieve?item-type=publication&filter=[["issn","equals","0140-6736"]]&format=Json - String validUrl = new URIBuilder(buildUrlString(validISSN, endpoint, apiKey)).toString(); + // https://api.openpolicyfinder.jisc.ac.uk/retrieve?item-type=publication&...&format=Json + String validUrl = new URIBuilder(buildUrlString(validISSN, endpoint)).toString(); assertEquals("Built and expected valid URLs differ", validUrl, sherpaService.constructHttpGet("publication", "issn", "equals", validISSN) .getURI().toASCIIString()); // The invalid string should look like this (assuming default configuration) - // https://v2.sherpa.ac.uk/cgi/retrieve?item-type=publication&filter=[["issn","equals","TEST"]]&format=Json + // https://api.openpolicyfinder.jisc.ac.uk/retrieve?item-type=publication&...&format=Json // Note - it should return 0 results from the API, but these services are not intended to validate the ISSN // query, though they do sanitise it for the JSON input type, hence expecting the braces to be stripped - String invalidUrl = new URIBuilder(buildUrlString(invalidISSN, endpoint, apiKey)).toString(); + String invalidUrl = new URIBuilder(buildUrlString(invalidISSN, endpoint)).toString(); assertEquals("Built and expected invalid URLs differ", invalidUrl, sherpaService.constructHttpGet("publication", "issn", "equals", invalidISSN) .getURI().toASCIIString()); // The null query string should look like this (assuming default configuration) - // https://v2.sherpa.ac.uk/cgi/retrieve?item-type=publication&filter=[["issn","equals",""]]&format=Json + // https://api.openpolicyfinder.jisc.ac.uk/retrieve?item-type=publication&...&format=Json // Note - it should return 0 results from the API, but all we do is log a warning, this is not considered // a fatal URI syntax exception (the remote call does work, and returns 0 items as valid JSON) - String nullUrl = new URIBuilder(buildUrlString(null, endpoint, apiKey)).toString(); + String nullUrl = new URIBuilder(buildUrlString(null, endpoint)).toString(); assertEquals("Built and expected invalid URLs differ", nullUrl, sherpaService.constructHttpGet("publication", "issn", "equals", null) .getURI().toASCIIString()); @@ -159,7 +158,7 @@ public void testJournalResponse() { && expectedTitle.equals(response.getJournals().get(0).getTitles().get(0))); // Assert response has expected publication (metadata) URI - String expectedSystemMetadataUri = "http://v2.sherpa.ac.uk/id/publication/23803"; + String expectedSystemMetadataUri = "https://openpolicyfinder.jisc.ac.uk/id/publication/23803"; assertTrue("Response metadata URI did not match expected '" + expectedSystemMetadataUri + "' value", expectedSystemMetadataUri.equals(response.getMetadata().getUri())); @@ -215,22 +214,19 @@ public void testPublisherResponse() { } /** - * Build URL manually with string builder to compare to URIBuilder usage in actual service + * Build URL manually with string builder to compare to URIBuilder usage in actual service. + * Note: the API key is now sent as an HTTP header, not as a query parameter. * @param query * @param endpoint - * @param apiKey * @return */ - public static String buildUrlString(String query, String endpoint, String apiKey) { + public static String buildUrlString(String query, String endpoint) { query = SHERPAUtils.sanitiseQuery(query); StringBuilder expected = new StringBuilder(); String filter = "[[\"issn\",\"equals\",\"" + query + "\"]]"; expected.append(endpoint).append("?") .append("item-type=publication&filter=").append(URLEncoder.encode(filter, StandardCharsets.UTF_8)) .append("&format=Json&offset=0&limit=1"); - if (StringUtils.isNotBlank(apiKey)) { - expected.append("&api-key=").append(apiKey); - } return expected.toString(); } diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/2731-0582.json b/dspace-api/src/test/resources/org/dspace/app/sherpa/2731-0582.json index 2e5c7e2db9ca..9c3d6ff052f4 100644 --- a/dspace-api/src/test/resources/org/dspace/app/sherpa/2731-0582.json +++ b/dspace-api/src/test/resources/org/dspace/app/sherpa/2731-0582.json @@ -3,7 +3,7 @@ { "system_metadata": { "id": 40863, - "uri": "https://v2.sherpa.ac.uk/id/publication/40863", + "uri": "https://openpolicyfinder.jisc.ac.uk/id/publication/40863", "date_modified": "2022-03-25 14:08:29", "publicly_visible": "yes", "publicly_visible_phrases": [ @@ -78,7 +78,7 @@ } ], "publication_count": 87, - "uri": "https://v2.sherpa.ac.uk/id/publisher/3286", + "uri": "https://openpolicyfinder.jisc.ac.uk/id/publisher/3286", "url": "https://www.nature.com/" } } @@ -121,7 +121,7 @@ "language": "en" } ], - "uri": "https://v2.sherpa.ac.uk/id/publisher_policy/3286", + "uri": "https://openpolicyfinder.jisc.ac.uk/id/publisher_policy/3286", "permitted_oa": [ { "prerequisites": { @@ -429,13 +429,13 @@ }, "system_metadata": { "id": 908, - "uri": "https://v2.sherpa.ac.uk/id/repository/908" + "uri": "https://openpolicyfinder.jisc.ac.uk/id/repository/908" } }, { "system_metadata": { "id": 267, - "uri": "https://v2.sherpa.ac.uk/id/repository/267" + "uri": "https://openpolicyfinder.jisc.ac.uk/id/repository/267" }, "repository_metadata": { "type_phrases": [ @@ -473,7 +473,7 @@ ] } ], - "uri": "https://v2.sherpa.ac.uk/id/publisher_policy/4410" + "uri": "https://openpolicyfinder.jisc.ac.uk/id/publisher_policy/4410" } ], "title": [ diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/plos.json b/dspace-api/src/test/resources/org/dspace/app/sherpa/plos.json index d5c85fe5b7ef..c2cbf6120e9b 100644 --- a/dspace-api/src/test/resources/org/dspace/app/sherpa/plos.json +++ b/dspace-api/src/test/resources/org/dspace/app/sherpa/plos.json @@ -36,7 +36,7 @@ "system_metadata" : { "id" : 112, "publicly_visible" : "yes", - "uri" : "http://v2.sherpa.ac.uk/id/publisher/112", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publisher/112", "date_created" : "2005-02-07 00:00:00", "publicly_visible_phrases" : [ { @@ -62,7 +62,7 @@ ] } ], - "uri" : "http://v2.sherpa.ac.uk/id/publication/17601", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17601", "id" : 17601, "type" : "journal", "issns" : [ @@ -112,7 +112,7 @@ } ], "id" : 17595, - "uri" : "http://v2.sherpa.ac.uk/id/publication/17595", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17595", "type" : "journal", "issns" : [ { @@ -192,11 +192,11 @@ } ], "id" : 17596, - "uri" : "http://v2.sherpa.ac.uk/id/publication/17596", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17596", "type" : "journal" }, { - "uri" : "http://v2.sherpa.ac.uk/id/publication/17597", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17597", "id" : 17597, "title" : [ { @@ -260,7 +260,7 @@ } ], "id" : 17598, - "uri" : "http://v2.sherpa.ac.uk/id/publication/17598", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17598", "type" : "journal", "issns" : [ { @@ -304,7 +304,7 @@ "phrase" : "Journal" } ], - "uri" : "http://v2.sherpa.ac.uk/id/publication/17599", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17599", "id" : 17599, "title" : [ { @@ -367,7 +367,7 @@ "language" : "en" } ], - "uri" : "http://v2.sherpa.ac.uk/id/publication/17600", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/17600", "type" : "journal" } ], @@ -382,7 +382,7 @@ ], "internal_moniker" : "Default policy", "id" : 112, - "uri" : "http://v2.sherpa.ac.uk/id/publisher_policy/112", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publisher_policy/112", "open_access_prohibited" : "no", "permitted_oa" : [ { @@ -540,7 +540,7 @@ }, "system_metadata" : { "id" : 267, - "uri" : "http://v2.sherpa.ac.uk/id/repository/267" + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/repository/267" } } ], diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/thelancet.json b/dspace-api/src/test/resources/org/dspace/app/sherpa/thelancet.json index 6ff3440a44cd..9fb79a6fa319 100644 --- a/dspace-api/src/test/resources/org/dspace/app/sherpa/thelancet.json +++ b/dspace-api/src/test/resources/org/dspace/app/sherpa/thelancet.json @@ -59,7 +59,7 @@ "language" : "en" } ], - "uri" : "http://v2.sherpa.ac.uk/id/publisher/30", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publisher/30", "id" : 30, "name" : [ { @@ -99,7 +99,7 @@ "value" : "yes" } ], - "uri" : "http://v2.sherpa.ac.uk/id/publication/23803", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publication/23803", "date_modified" : "2020-03-06 11:25:54", "date_created" : "2012-11-20 14:51:52", "publicly_visible" : "yes" @@ -356,7 +356,7 @@ }, "system_metadata" : { "id" : 9, - "uri" : "http://v2.sherpa.ac.uk/id/funder/9" + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/funder/9" } } ] @@ -400,7 +400,7 @@ ] } ], - "uri" : "http://v2.sherpa.ac.uk/id/publisher_policy/1274", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publisher_policy/1274", "urls" : [ { "description" : "Guidelines for Authors", @@ -594,7 +594,7 @@ "url" : "https://www.elsevier.com/about/policies/open-access-licenses" } ], - "uri" : "http://v2.sherpa.ac.uk/id/publisher_policy/3323", + "uri" : "https://openpolicyfinder.jisc.ac.uk/id/publisher_policy/3323", "id" : 3323, "publication_count" : 2102 } diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 53d1ee039ec3..eee5d40ea817 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -1439,16 +1439,16 @@ sitemap.dir = ${dspace.dir}/sitemaps # Keep in mind, changing the schedule requires rebooting your servlet container, e.g. Tomcat. sitemap.cron = 0 15 1 * * ? -##### SHERPA/Romeo Integration Settings #### -# The SHERPA/RoMEO endpoint (v2 API) -sherpa.romeo.url = https://v2.sherpa.ac.uk/cgi/retrieve - -# Please register for a free api access key to use the SHERPA v2 API -# https://v2.sherpa.ac.uk/api/ -# Please note: the SHERPA v2 API uses different API keys to the legacy APIs. -# If you have been using the old ROMeO endpoint (end-of-life as at 2020-04-14), you must -# register for a new API key -sherpa.romeo.apikey = +##### Open Policy Finder Integration Settings #### +# (formerly SHERPA/RoMEO — legacy sherpa.romeo.* property names still work as fallback) + +# The Open Policy Finder API endpoint +openpolicyfinder.url = https://api.openpolicyfinder.jisc.ac.uk/retrieve + +# API key for the Open Policy Finder API +# Existing SHERPA/RoMEO API keys have been automatically migrated. +# For new keys, see: https://openpolicyfinder.jisc.ac.uk/help/developers +openpolicyfinder.apikey = ##### Google Scholar Metadata Configuration ##### google-metadata.config = ${dspace.dir}/config/crosswalks/google-metadata.properties diff --git a/dspace/config/spring/api/sherpa.xml b/dspace/config/spring/api/sherpa.xml index da42880218ca..b35a99874327 100644 --- a/dspace/config/spring/api/sherpa.xml +++ b/dspace/config/spring/api/sherpa.xml @@ -10,6 +10,7 @@ + From 86ab442a586ed586895103f0956b4cf9e60ca8b4 Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Sat, 21 Mar 2026 00:52:40 +0100 Subject: [PATCH 094/283] Rename SHERPA classes and identifiers to Open Policy Finder Rename all Java classes, packages, Spring bean IDs, external source identifiers, submission config, and cache config from SHERPA/sherpa naming to OpenPolicyFinder/opf naming, consistent with the openpolicyfinder.* config properties already in use. Package: org.dspace.app.sherpa -> org.dspace.app.openpolicyfinder Classes: SHERPAService -> OpenPolicyFinderService, etc. Identifiers: sherpaJournal -> opfJournal, sherpaPublisher -> opfPublisher Submission: sherpaPolicies -> opfPolicies, sherpaPolicy -> opfPolicy Cache: sherpa.searchByJournalISSN -> opf.searchByJournalISSN Co-Authored-By: Claude Opus 4.6 (1M context) --- dspace-api/pom.xml | 2 +- .../OpenPolicyFinderService.java} | 108 ++++++------ .../OpenPolicyFinderCacheEvictService.java} | 24 +-- .../cache/OpenPolicyFinderCacheLogger.java} | 12 +- .../submit/ISSNItemExtractor.java | 2 +- .../MetadataAuthorityISSNExtractor.java | 2 +- .../submit/MetadataValueISSNExtractor.java | 2 +- ...licyFinderSubmitConfigurationService.java} | 4 +- .../OpenPolicyFinderSubmitService.java} | 60 +++---- .../v2/OpenPolicyFinderEmbargo.java} | 8 +- .../v2/OpenPolicyFinderJournal.java} | 34 ++-- .../v2/OpenPolicyFinderPermittedVersion.java} | 17 +- .../v2/OpenPolicyFinderPublisher.java} | 25 +-- .../v2/OpenPolicyFinderPublisherPolicy.java} | 20 +-- .../OpenPolicyFinderPublisherResponse.java} | 58 +++---- .../v2/OpenPolicyFinderResponse.java} | 156 +++++++++--------- .../v2/OpenPolicyFinderSystemMetadata.java} | 15 +- .../v2/OpenPolicyFinderUtils.java} | 11 +- ...java => OpenPolicyFinderJournalTitle.java} | 49 +++--- ...> OpenPolicyFinderPublisherAuthority.java} | 56 ++++--- .../ctask/general/MetadataWebService.java | 2 +- ... OpenPolicyFinderJournalDataProvider.java} | 88 +++++----- ...nPolicyFinderJournalISSNDataProvider.java} | 97 +++++------ ...penPolicyFinderPublisherDataProvider.java} | 94 ++++++----- ...space-addon-openpolicyfinder-services.xml} | 26 +-- .../dspaceFolder/config/item-submission.xml | 10 +- .../config/spring/api/external-services.xml | 20 +-- .../api/{sherpa.xml => openpolicyfinder.xml} | 24 +-- .../MockOpenPolicyFinderService.java} | 51 +++--- .../OpenPolicyFinderDataProviderTest.java} | 88 +++++----- .../OpenPolicyFinderServiceTest.java} | 53 +++--- .../OpenPolicyFinderSubmitServiceTest.java} | 23 +-- .../0000-0000.json | 0 .../2731-0582.json | 0 .../{sherpa => openpolicyfinder}/plos.json | 0 .../thelancet.json | 0 ...olicy.java => OpenPolicyFinderPolicy.java} | 20 +-- .../step/OpenPolicyFinderPolicyStep.java | 64 +++++++ .../rest/submit/step/SherpaPolicyStep.java | 63 ------- .../rest/ExternalSourcesRestControllerIT.java | 6 +- .../app/rest/VocabularyRestRepositoryIT.java | 8 +- .../rest/WorkspaceItemRestRepositoryIT.java | 72 ++++---- dspace/config/ehcache.xml | 6 +- dspace/config/item-submission.xml | 12 +- dspace/config/modules/authority.cfg | 6 +- .../config/spring/api/external-services.xml | 26 +-- .../api/{sherpa.xml => openpolicyfinder.xml} | 18 +- dspace/config/submission-forms.xml | 2 +- 48 files changed, 791 insertions(+), 753 deletions(-) rename dspace-api/src/main/java/org/dspace/app/{sherpa/SHERPAService.java => openpolicyfinder/OpenPolicyFinderService.java} (80%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/cache/SherpaCacheEvictService.java => openpolicyfinder/cache/OpenPolicyFinderCacheEvictService.java} (64%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/cache/SherpaCacheLogger.java => openpolicyfinder/cache/OpenPolicyFinderCacheLogger.java} (59%) rename dspace-api/src/main/java/org/dspace/app/{sherpa => openpolicyfinder}/submit/ISSNItemExtractor.java (89%) rename dspace-api/src/main/java/org/dspace/app/{sherpa => openpolicyfinder}/submit/MetadataAuthorityISSNExtractor.java (96%) rename dspace-api/src/main/java/org/dspace/app/{sherpa => openpolicyfinder}/submit/MetadataValueISSNExtractor.java (96%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/submit/SHERPASubmitConfigurationService.java => openpolicyfinder/submit/OpenPolicyFinderSubmitConfigurationService.java} (83%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/submit/SHERPASubmitService.java => openpolicyfinder/submit/OpenPolicyFinderSubmitService.java} (63%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAEmbargo.java => openpolicyfinder/v2/OpenPolicyFinderEmbargo.java} (76%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAJournal.java => openpolicyfinder/v2/OpenPolicyFinderJournal.java} (62%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAPermittedVersion.java => openpolicyfinder/v2/OpenPolicyFinderPermittedVersion.java} (82%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAPublisher.java => openpolicyfinder/v2/OpenPolicyFinderPublisher.java} (69%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAPublisherPolicy.java => openpolicyfinder/v2/OpenPolicyFinderPublisherPolicy.java} (79%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAPublisherResponse.java => openpolicyfinder/v2/OpenPolicyFinderPublisherResponse.java} (75%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAResponse.java => openpolicyfinder/v2/OpenPolicyFinderResponse.java} (78%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPASystemMetadata.java => openpolicyfinder/v2/OpenPolicyFinderSystemMetadata.java} (75%) rename dspace-api/src/main/java/org/dspace/app/{sherpa/v2/SHERPAUtils.java => openpolicyfinder/v2/OpenPolicyFinderUtils.java} (69%) rename dspace-api/src/main/java/org/dspace/content/authority/{SHERPARoMEOJournalTitle.java => OpenPolicyFinderJournalTitle.java} (59%) rename dspace-api/src/main/java/org/dspace/content/authority/{SHERPARoMEOPublisher.java => OpenPolicyFinderPublisherAuthority.java} (58%) rename dspace-api/src/main/java/org/dspace/external/provider/impl/{SHERPAv2JournalDataProvider.java => OpenPolicyFinderJournalDataProvider.java} (58%) rename dspace-api/src/main/java/org/dspace/external/provider/impl/{SHERPAv2JournalISSNDataProvider.java => OpenPolicyFinderJournalISSNDataProvider.java} (57%) rename dspace-api/src/main/java/org/dspace/external/provider/impl/{SHERPAv2PublisherDataProvider.java => OpenPolicyFinderPublisherDataProvider.java} (54%) rename dspace-api/src/main/resources/spring/{spring-dspace-addon-sherpa-services.xml => spring-dspace-addon-openpolicyfinder-services.xml} (58%) rename dspace-api/src/test/data/dspaceFolder/config/spring/api/{sherpa.xml => openpolicyfinder.xml} (50%) rename dspace-api/src/test/java/org/dspace/app/{sherpa/MockSHERPAService.java => openpolicyfinder/MockOpenPolicyFinderService.java} (67%) rename dspace-api/src/test/java/org/dspace/app/{sherpa/SHERPADataProviderTest.java => openpolicyfinder/OpenPolicyFinderDataProviderTest.java} (83%) rename dspace-api/src/test/java/org/dspace/app/{sherpa/SHERPAServiceTest.java => openpolicyfinder/OpenPolicyFinderServiceTest.java} (82%) rename dspace-api/src/test/java/org/dspace/app/{sherpa/submit/SHERPASubmitServiceTest.java => openpolicyfinder/submit/OpenPolicyFinderSubmitServiceTest.java} (82%) rename dspace-api/src/test/resources/org/dspace/app/{sherpa => openpolicyfinder}/0000-0000.json (100%) rename dspace-api/src/test/resources/org/dspace/app/{sherpa => openpolicyfinder}/2731-0582.json (100%) rename dspace-api/src/test/resources/org/dspace/app/{sherpa => openpolicyfinder}/plos.json (100%) rename dspace-api/src/test/resources/org/dspace/app/{sherpa => openpolicyfinder}/thelancet.json (100%) rename dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/{SherpaPolicy.java => OpenPolicyFinderPolicy.java} (55%) create mode 100644 dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/OpenPolicyFinderPolicyStep.java delete mode 100644 dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/SherpaPolicyStep.java rename dspace/config/spring/api/{sherpa.xml => openpolicyfinder.xml} (63%) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 31ac0523f814..5961bc8a7a10 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -353,7 +353,7 @@ ${ehcache.version} + Caching dependencies for Open Policy Finder service. --> org.springframework.boot spring-boot-starter-cache diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java similarity index 80% rename from dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java index c1d1b3d8fb6e..c3146f4b218c 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/SHERPAService.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa; +package org.dspace.app.openpolicyfinder; import java.io.IOException; import java.io.InputStream; @@ -26,24 +26,24 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.dspace.app.client.DSpaceHttpClientFactory; -import org.dspace.app.sherpa.v2.SHERPAPublisherResponse; -import org.dspace.app.sherpa.v2.SHERPAResponse; -import org.dspace.app.sherpa.v2.SHERPAUtils; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderPublisherResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderUtils; import org.dspace.services.ConfigurationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.annotation.Cacheable; /** - * SHERPAService is responsible for making the HTTP call to the Jisc Open Policy Finder API - * (formerly SHERPA/RoMEO v2) for SHERPASubmitService. + * OpenPolicyFinderService is responsible for making the HTTP call to the Jisc Open Policy Finder API + * (formerly SHERPA/RoMEO v2) for OpenPolicyFinderSubmitService. * Note, this service is ported from DSpace 6 for the ability to search policies by ISSN * There are also new DataProvider implementations provided for use as 'external sources' * of journal and publisher data - * @see org.dspace.external.provider.impl.SHERPAv2JournalDataProvider - * @see org.dspace.external.provider.impl.SHERPAv2PublisherDataProvider + * @see org.dspace.external.provider.impl.OpenPolicyFinderJournalDataProvider + * @see org.dspace.external.provider.impl.OpenPolicyFinderPublisherDataProvider * @author Kim Shepherd */ -public class SHERPAService { +public class OpenPolicyFinderService { private int maxNumberOfTries; private long sleepBetweenTimeouts; @@ -52,7 +52,7 @@ public class SHERPAService { private String apiKey = null; /** log4j category */ - private static final Logger log = LogManager.getLogger(SHERPAService.class); + private static final Logger log = LogManager.getLogger(OpenPolicyFinderService.class); @Autowired ConfigurationService configurationService; @@ -91,19 +91,20 @@ private void init() { * Search the Open Policy Finder API for journal policy data using the supplied ISSN. * If the API key is missing, or the HTTP response is non-OK or does not complete * successfully, a simple error response will be returned. - * Otherwise, the response body will be passed to SHERPAResponse for parsing as JSON + * Otherwise, the response body will be passed to OpenPolicyFinderResponse for parsing as JSON * and the final result returned to the calling method * @param query ISSN string to pass in an "issn equals" API query - * @return SHERPAResponse containing an error or journal policies + * @return OpenPolicyFinderResponse containing an error or journal policies */ - @Cacheable(key = "#query", condition = "#query != null", cacheNames = "sherpa.searchByJournalISSN") - public SHERPAResponse searchByJournalISSN(String query) { + @Cacheable(key = "#query", condition = "#query != null", cacheNames = "opf.searchByJournalISSN") + public OpenPolicyFinderResponse searchByJournalISSN(String query) { return performRequest("publication", "issn", "equals", query, 0, 1); } /** * Perform an API request to the Open Policy Finder API - this could be a search or a get for any entity type - * but the return object here must be a SHERPAPublisherResponse not the journal-centric SHERPAResponse + * but the return object here must be a OpenPolicyFinderPublisherResponse + * not the journal-centric OpenPolicyFinderResponse * For more information about the type, field and predicate arguments, see the API documentation * @param type entity type eg "publisher" * @param field field eg "issn" or "title" @@ -111,22 +112,23 @@ public SHERPAResponse searchByJournalISSN(String query) { * @param value the actual value to search for (eg an ISSN or partial title) * @param start start / offset of search results * @param limit maximum search results to return - * @return SHERPAPublisherResponse object + * @return OpenPolicyFinderPublisherResponse object */ - public SHERPAPublisherResponse performPublisherRequest(String type, String field, String predicate, String value, - int start, int limit) { + public OpenPolicyFinderPublisherResponse performPublisherRequest( + String type, String field, String predicate, String value, + int start, int limit) { // API Key is *required* for API calls if (null == apiKey) { log.error("Open Policy Finder API Key missing: " + "please register for an API key and set openpolicyfinder.apikey"); - return new SHERPAPublisherResponse("Open Policy Finder configuration invalid or missing"); + return new OpenPolicyFinderPublisherResponse("Open Policy Finder configuration invalid or missing"); } HttpGet method = null; - SHERPAPublisherResponse sherpaResponse = null; + OpenPolicyFinderPublisherResponse opfResponse = null; int numberOfTries = 0; - while (numberOfTries < maxNumberOfTries && sherpaResponse == null) { + while (numberOfTries < maxNumberOfTries && opfResponse == null) { numberOfTries++; log.debug(String.format( @@ -151,7 +153,7 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field + response.getStatusLine().getReasonPhrase()); if (statusCode != HttpStatus.SC_OK) { - sherpaResponse = new SHERPAPublisherResponse( + opfResponse = new OpenPolicyFinderPublisherResponse( "Open Policy Finder return not OK status: " + statusCode); String errorBody = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); log.error("Error from Open Policy Finder HTTP request: " + errorBody); @@ -159,14 +161,15 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field HttpEntity responseBody = response.getEntity(); - // If the response body is valid, pass to SHERPAResponse for parsing as JSON + // If the response body is valid, pass to OpenPolicyFinderResponse for parsing as JSON if (null != responseBody) { log.debug("Non-null response received for query of " + value); InputStream content = null; try { content = responseBody.getContent(); - sherpaResponse = - new SHERPAPublisherResponse(content, SHERPAPublisherResponse.SHERPAFormat.JSON); + opfResponse = new OpenPolicyFinderPublisherResponse( + content, + OpenPolicyFinderPublisherResponse.ResponseFormat.JSON); } catch (IOException e) { log.error("Encountered exception while contacting Open Policy Finder: " + e.getMessage(), e); @@ -177,21 +180,21 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field } } else { log.debug("Empty response body for query on " + value); - sherpaResponse = new SHERPAPublisherResponse("Open Policy Finder returned no response"); + opfResponse = new OpenPolicyFinderPublisherResponse("Open Policy Finder returned no response"); } } } catch (URISyntaxException e) { String errorMessage = "Error building Open Policy Finder API URI: " + e.getMessage(); log.error(errorMessage, e); - sherpaResponse = new SHERPAPublisherResponse(errorMessage); + opfResponse = new OpenPolicyFinderPublisherResponse(errorMessage); } catch (IOException e) { String errorMessage = "Encountered exception while contacting Open Policy Finder: " + e.getMessage(); log.error(errorMessage, e); - sherpaResponse = new SHERPAPublisherResponse(errorMessage); + opfResponse = new OpenPolicyFinderPublisherResponse(errorMessage); } catch (InterruptedException e) { String errorMessage = "Encountered exception while sleeping thread: " + e.getMessage(); log.error(errorMessage, e); - sherpaResponse = new SHERPAPublisherResponse(errorMessage); + opfResponse = new OpenPolicyFinderPublisherResponse(errorMessage); } finally { if (method != null) { method.releaseConnection(); @@ -199,14 +202,14 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field } } - if (sherpaResponse == null) { + if (opfResponse == null) { log.debug("Response is still null"); - sherpaResponse = new SHERPAPublisherResponse( + opfResponse = new OpenPolicyFinderPublisherResponse( "Error processing the Open Policy Finder answer"); } // Return the final response - return sherpaResponse; + return opfResponse; } /** @@ -218,22 +221,22 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field * @param value the actual value to search for (eg an ISSN or partial title) * @param start start / offset of search results * @param limit maximum search results to return - * @return SHERPAResponse object + * @return OpenPolicyFinderResponse object */ - public SHERPAResponse performRequest(String type, String field, String predicate, String value, + public OpenPolicyFinderResponse performRequest(String type, String field, String predicate, String value, int start, int limit) { // API Key is *required* for API calls if (null == apiKey) { log.error("Open Policy Finder API Key missing: " + "please register for an API key and set openpolicyfinder.apikey"); - return new SHERPAResponse("Open Policy Finder configuration invalid or missing"); + return new OpenPolicyFinderResponse("Open Policy Finder configuration invalid or missing"); } HttpGet method = null; - SHERPAResponse sherpaResponse = null; + OpenPolicyFinderResponse opfResponse = null; int numberOfTries = 0; - while (numberOfTries < maxNumberOfTries && sherpaResponse == null) { + while (numberOfTries < maxNumberOfTries && opfResponse == null) { numberOfTries++; log.debug(String.format( @@ -258,7 +261,7 @@ public SHERPAResponse performRequest(String type, String field, String predicate + response.getStatusLine().getReasonPhrase()); if (statusCode != HttpStatus.SC_OK) { - sherpaResponse = new SHERPAResponse( + opfResponse = new OpenPolicyFinderResponse( "Open Policy Finder return not OK status: " + statusCode); String errorBody = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); log.error("Error from Open Policy Finder HTTP request: " + errorBody); @@ -266,13 +269,14 @@ public SHERPAResponse performRequest(String type, String field, String predicate HttpEntity responseBody = response.getEntity(); - // If the response body is valid, pass to SHERPAResponse for parsing as JSON + // If the response body is valid, pass to OpenPolicyFinderResponse for parsing as JSON if (null != responseBody) { log.debug("Non-null response received for query of " + value); InputStream content = null; try { content = responseBody.getContent(); - sherpaResponse = new SHERPAResponse(content, SHERPAResponse.SHERPAFormat.JSON); + opfResponse = new OpenPolicyFinderResponse( + content, OpenPolicyFinderResponse.ResponseFormat.JSON); } catch (IOException e) { log.error("Encountered exception while contacting Open Policy Finder: " + e.getMessage(), e); @@ -283,21 +287,21 @@ public SHERPAResponse performRequest(String type, String field, String predicate } } else { log.debug("Empty response body for query on " + value); - sherpaResponse = new SHERPAResponse("Open Policy Finder returned no response"); + opfResponse = new OpenPolicyFinderResponse("Open Policy Finder returned no response"); } } } catch (URISyntaxException e) { String errorMessage = "Error building Open Policy Finder API URI: " + e.getMessage(); log.error(errorMessage, e); - sherpaResponse = new SHERPAResponse(errorMessage); + opfResponse = new OpenPolicyFinderResponse(errorMessage); } catch (IOException e) { String errorMessage = "Encountered exception while contacting Open Policy Finder: " + e.getMessage(); log.error(errorMessage, e); - sherpaResponse = new SHERPAResponse(errorMessage); + opfResponse = new OpenPolicyFinderResponse(errorMessage); } catch (InterruptedException e) { String errorMessage = "Encountered exception while sleeping thread: " + e.getMessage(); log.error(errorMessage, e); - sherpaResponse = new SHERPAResponse(errorMessage); + opfResponse = new OpenPolicyFinderResponse(errorMessage); } finally { if (method != null) { method.releaseConnection(); @@ -305,14 +309,14 @@ public SHERPAResponse performRequest(String type, String field, String predicate } } - if (sherpaResponse == null) { + if (opfResponse == null) { log.debug("Response is still null"); - sherpaResponse = new SHERPAResponse( + opfResponse = new OpenPolicyFinderResponse( "Error processing the Open Policy Finder answer"); } // Return the final response - return sherpaResponse; + return opfResponse; } /** @@ -346,10 +350,10 @@ public HttpGet constructHttpGet(String type, String field, String predicate, Str if (null == type) { type = "publication"; } - field = SHERPAUtils.sanitiseQuery(field); - predicate = SHERPAUtils.sanitiseQuery(predicate); - value = SHERPAUtils.sanitiseQuery(value); - type = SHERPAUtils.sanitiseQuery(type); + field = OpenPolicyFinderUtils.sanitiseQuery(field); + predicate = OpenPolicyFinderUtils.sanitiseQuery(predicate); + value = OpenPolicyFinderUtils.sanitiseQuery(value); + type = OpenPolicyFinderUtils.sanitiseQuery(type); // Build URL based on search query URIBuilder uriBuilder = new URIBuilder(endpoint); @@ -396,7 +400,7 @@ public HttpGet constructHttpGet(String type, String field, String predicate, Str */ public URI prepareQuery(String query, String endpoint, String apiKey) throws URISyntaxException { // Sanitise query string - query = SHERPAUtils.sanitiseQuery(query); + query = OpenPolicyFinderUtils.sanitiseQuery(query); // Instantiate URI builder URIBuilder uriBuilder = new URIBuilder(endpoint); diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheEvictService.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/cache/OpenPolicyFinderCacheEvictService.java similarity index 64% rename from dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheEvictService.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/cache/OpenPolicyFinderCacheEvictService.java index 94ecfb5e213d..b64c552ec0ad 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheEvictService.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/cache/OpenPolicyFinderCacheEvictService.java @@ -5,29 +5,29 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.cache; +package org.dspace.app.openpolicyfinder.cache; import java.util.Objects; import java.util.Set; -import org.dspace.app.sherpa.submit.SHERPASubmitService; +import org.dspace.app.openpolicyfinder.submit.OpenPolicyFinderSubmitService; import org.dspace.content.Item; import org.dspace.core.Context; import org.springframework.cache.CacheManager; /** - * This service is responsible to deal with the SherpaService cache. + * This service is responsible to deal with the Open Policy Finder service cache. * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) */ -public class SherpaCacheEvictService { +public class OpenPolicyFinderCacheEvictService { // The cache that is managed by this service. - static final String CACHE_NAME = "sherpa.searchByJournalISSN"; + static final String CACHE_NAME = "opf.searchByJournalISSN"; private CacheManager cacheManager; - private SHERPASubmitService sherpaSubmitService; + private OpenPolicyFinderSubmitService opfSubmitService; /** * Remove immediately from the cache all the response that are related to a specific item @@ -37,14 +37,14 @@ public class SherpaCacheEvictService { * @param item an Item */ public void evictCacheValues(Context context, Item item) { - Set ISSNs = sherpaSubmitService.getISSNs(context, item); + Set ISSNs = opfSubmitService.getISSNs(context, item); for (String issn : ISSNs) { Objects.requireNonNull(cacheManager.getCache(CACHE_NAME)).evictIfPresent(issn); } } /** - * Invalidate immediately the Sherpa cache + * Invalidate the Open Policy Finder cache immediately */ public void evictAllCacheValues() { Objects.requireNonNull(cacheManager.getCache(CACHE_NAME)).invalidate(); @@ -60,12 +60,12 @@ public void setCacheManager(CacheManager cacheManager) { } /** - * Set the reference to the SherpaSubmitService + * Set the reference to the OpenPolicyFinderSubmitService * - * @param sherpaSubmitService + * @param opfSubmitService */ - public void setSherpaSubmitService(SHERPASubmitService sherpaSubmitService) { - this.sherpaSubmitService = sherpaSubmitService; + public void setOpenPolicyFinderSubmitService(OpenPolicyFinderSubmitService opfSubmitService) { + this.opfSubmitService = opfSubmitService; } } \ No newline at end of file diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/cache/OpenPolicyFinderCacheLogger.java similarity index 59% rename from dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/cache/OpenPolicyFinderCacheLogger.java index e84fb7775ae2..22499cd6efca 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/cache/SherpaCacheLogger.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/cache/OpenPolicyFinderCacheLogger.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.cache; +package org.dspace.app.openpolicyfinder.cache; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -13,21 +13,21 @@ import org.ehcache.event.CacheEventListener; /** - * This is a EHCache listner responsible for logging sherpa cache events. It is - * bound to the sherpa cache via the dspace/config/ehcache.xml file. We need a + * This is a EHCache listener responsible for logging Open Policy Finder cache events. It is + * bound to the Open Policy Finder cache via the dspace/config/ehcache.xml file. We need a * dedicated Logger for each cache as the CacheEvent doesn't include details * about where the event occur * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) * */ -public class SherpaCacheLogger implements CacheEventListener { +public class OpenPolicyFinderCacheLogger implements CacheEventListener { - private static final Logger log = LogManager.getLogger(SherpaCacheLogger.class); + private static final Logger log = LogManager.getLogger(OpenPolicyFinderCacheLogger.class); @Override public void onEvent(CacheEvent cacheEvent) { - log.debug("Sherpa Cache Event Type: {} | Key: {} ", + log.debug("Open Policy Finder Cache Event Type: {} | Key: {} ", cacheEvent.getType(), cacheEvent.getKey()); } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/ISSNItemExtractor.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/ISSNItemExtractor.java similarity index 89% rename from dspace-api/src/main/java/org/dspace/app/sherpa/submit/ISSNItemExtractor.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/ISSNItemExtractor.java index 3230d18e2a27..62c0d4fbcdf3 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/ISSNItemExtractor.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/ISSNItemExtractor.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.submit; +package org.dspace.app.openpolicyfinder.submit; import java.util.List; diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/MetadataAuthorityISSNExtractor.java similarity index 96% rename from dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/MetadataAuthorityISSNExtractor.java index a08b4d9502cc..c593517e150a 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataAuthorityISSNExtractor.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/MetadataAuthorityISSNExtractor.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.submit; +package org.dspace.app.openpolicyfinder.submit; import java.util.ArrayList; import java.util.List; diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataValueISSNExtractor.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/MetadataValueISSNExtractor.java similarity index 96% rename from dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataValueISSNExtractor.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/MetadataValueISSNExtractor.java index 6ed0e4fc9bcd..b6db8b869a50 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/MetadataValueISSNExtractor.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/MetadataValueISSNExtractor.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.submit; +package org.dspace.app.openpolicyfinder.submit; import java.util.ArrayList; import java.util.List; diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitConfigurationService.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitConfigurationService.java similarity index 83% rename from dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitConfigurationService.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitConfigurationService.java index 69447fd8c617..9107f4dc15ec 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitConfigurationService.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitConfigurationService.java @@ -5,11 +5,11 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.submit; +package org.dspace.app.openpolicyfinder.submit; import java.util.List; -public class SHERPASubmitConfigurationService { +public class OpenPolicyFinderSubmitConfigurationService { private List issnItemExtractors; public void setIssnItemExtractors(List issnItemExtractors) { diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitService.java similarity index 63% rename from dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitService.java index b795c8a2b2d2..fb66ec60518f 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/submit/SHERPASubmitService.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitService.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.submit; +package org.dspace.app.openpolicyfinder.submit; import java.util.Iterator; import java.util.LinkedHashSet; @@ -13,74 +13,74 @@ import java.util.Set; import org.apache.logging.log4j.Logger; -import org.dspace.app.sherpa.SHERPAService; -import org.dspace.app.sherpa.v2.SHERPAResponse; +import org.dspace.app.openpolicyfinder.OpenPolicyFinderService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; import org.dspace.content.Item; import org.dspace.core.Context; import org.dspace.core.LogHelper; /** - * SHERPASubmitService is + * OpenPolicyFinderSubmitService is * @see * @author Kim Shepherd */ -public class SHERPASubmitService { +public class OpenPolicyFinderSubmitService { /** * Spring beans for configuration and API service */ - protected SHERPAService sherpaService; - protected SHERPASubmitConfigurationService configuration; + protected OpenPolicyFinderService openPolicyFinderService; + protected OpenPolicyFinderSubmitConfigurationService configuration; /** * log4j logger */ - private static Logger log = org.apache.logging.log4j.LogManager.getLogger(SHERPASubmitService.class); + private static Logger log = org.apache.logging.log4j.LogManager.getLogger(OpenPolicyFinderSubmitService.class); /** * Setter for configuration (from Spring) - * @see "dspace-dspace-addon-sherpa-configuration-services.xml" + * @see "spring-dspace-addon-openpolicyfinder-services.xml" * @param configuration */ - public void setConfiguration(SHERPASubmitConfigurationService configuration) { + public void setConfiguration(OpenPolicyFinderSubmitConfigurationService configuration) { this.configuration = configuration; } /** - * Setter for SHERPA service, reponsible for actual HTTP API calls - * @see "dspace-dspace-addon-sherpa-configuration-services.xml" - * @param sherpaService + * Setter for Open Policy Finder service, responsible for actual HTTP API calls + * @see "spring-dspace-addon-openpolicyfinder-services.xml" + * @param openPolicyFinderService */ - public void setSherpaService(SHERPAService sherpaService) { - this.sherpaService = sherpaService; + public void setOpenPolicyFinderService(OpenPolicyFinderService openPolicyFinderService) { + this.openPolicyFinderService = openPolicyFinderService; } /** - * Search SHERPA for journal policies matching the ISSNs in the item. + * Search Open Policy Finder for journal policies matching the ISSNs in the item. * Rather than a 'search' query for any/all ISSNs, the v2 API requires a separate * query for each ISSN found in the item. The ISSNs are extracted using the configured - * issnItemExtractor(s) in the SHERPA spring configuration. + * issnItemExtractor(s) in the Open Policy Finder spring configuration. * The ISSNs are not validated with a regular expression or other rules - any values * extracted will be included in API queries. - * Return the first not empty response from Sherpa - * @see "dspace-dspace-addon-sherpa-configuration-services.xml" + * Return the first non-empty response from Open Policy Finder + * @see "spring-dspace-addon-openpolicyfinder-services.xml" * @param context DSpace context * @param item DSpace item containing ISSNs to be checked - * @return SHERPA v2 API response (policy data) + * @return Open Policy Finder API response (policy data) */ - public SHERPAResponse searchRelatedJournals(Context context, Item item) { + public OpenPolicyFinderResponse searchRelatedJournals(Context context, Item item) { Set issns = getISSNs(context, item); if (issns == null || issns.size() == 0) { return null; } else { - // SHERPA v2 API no longer supports "OR'd" ISSN search, perform individual searches instead + // Open Policy Finder API no longer supports "OR'd" ISSN search, perform individual searches instead Iterator issnIterator = issns.iterator(); while (issnIterator.hasNext()) { String issn = issnIterator.next(); - SHERPAResponse response = sherpaService.searchByJournalISSN(issn); + OpenPolicyFinderResponse response = openPolicyFinderService.searchByJournalISSN(issn); if (response.isError()) { // Continue with loop - log.warn("Failed to look up SHERPA ROMeO result for ISSN: " + issn + log.warn("Failed to look up Open Policy Finder result for ISSN: " + issn + ": " + response.getMessage()); return response; } else if (!response.getJournals().isEmpty()) { @@ -88,23 +88,23 @@ public SHERPAResponse searchRelatedJournals(Context context, Item item) { return response; } } - return new SHERPAResponse(); + return new OpenPolicyFinderResponse(); } } /** - * Search SHERPA for journal policies matching the passed ISSN. + * Search Open Policy Finder for journal policies matching the passed ISSN. * The ISSN are not validated with a regular expression or other rules - any String * passed to this method will be considered an ISSN for the purposes of an API query * @param issn ISSN string - * @return SHERPA v2 API response object (policy data) + * @return Open Policy Finder API response object (policy data) */ - public SHERPAResponse searchRelatedJournalsByISSN(String issn) { - return sherpaService.searchByJournalISSN(issn); + public OpenPolicyFinderResponse searchRelatedJournalsByISSN(String issn) { + return openPolicyFinderService.searchByJournalISSN(issn); } /** - * Using the configured itemIssnExtractors from SHERPA configuration, extract + * Using the configured itemIssnExtractors from Open Policy Finder configuration, extract * ISSNs from item metadata or authority values * @param context DSpace context * @param item Item containing metadata / authority values diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAEmbargo.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderEmbargo.java similarity index 76% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAEmbargo.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderEmbargo.java index c6a0bb79428f..fda5a005a0b1 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAEmbargo.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderEmbargo.java @@ -5,23 +5,23 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.Serializable; /** - * Model class for the Embargo of SHERPAv2 API (JSON) + * Model class for the Embargo of Open Policy Finder API (JSON) * * @author Mykhaylo Boychuk (mykhaylo.boychuk@4science.com) */ -public class SHERPAEmbargo implements Serializable { +public class OpenPolicyFinderEmbargo implements Serializable { private static final long serialVersionUID = 6140668058547523656L; private int amount; private String units; - public SHERPAEmbargo(int amount, String units) { + public OpenPolicyFinderEmbargo(int amount, String units) { this.amount = amount; this.units = units; } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAJournal.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderJournal.java similarity index 62% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAJournal.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderJournal.java index 8728eb1a798d..addce9bfdd1b 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAJournal.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderJournal.java @@ -5,36 +5,36 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.Serializable; import java.util.List; /** - * Plain java representation of a SHERPA Journal object, based on SHERPA API v2 responses. + * Plain java representation of a Open Policy Finder Journal object, based on Open Policy Finder API responses. * - * In a SHERPA search for journal deposit policies, this is generally structured - * as a list in the SHERPAResponse object. + * In a Open Policy Finder search for journal deposit policies, this is generally structured + * as a list in the OpenPolicyFinderResponse object. * Each journal contains a list of publisher data and list of publishing policies as well as basic metadata * about the journal such as ISSNs, titles, whether it appears in DOAJ, primary publisher, etc. - * @see SHERPAResponse - * @see org.dspace.external.provider.impl.SHERPAv2JournalDataProvider + * @see OpenPolicyFinderResponse + * @see org.dspace.external.provider.impl.OpenPolicyFinderJournalDataProvider * * @author Kim Shepherd */ -public class SHERPAJournal implements Serializable { +public class OpenPolicyFinderJournal implements Serializable { private List titles; private String url; private List issns; private String romeoPub; private String zetoPub; - private SHERPAPublisher publisher; - private List publishers; - private List policies; + private OpenPolicyFinderPublisher publisher; + private List publishers; + private List policies; private Boolean inDOAJ; - public SHERPAJournal() { + public OpenPolicyFinderJournal() { } @@ -78,27 +78,27 @@ public void setZetoPub(String zetoPub) { this.zetoPub = zetoPub; } - public SHERPAPublisher getPublisher() { + public OpenPolicyFinderPublisher getPublisher() { return publisher; } - public void setPublisher(SHERPAPublisher publisher) { + public void setPublisher(OpenPolicyFinderPublisher publisher) { this.publisher = publisher; } - public List getPublishers() { + public List getPublishers() { return publishers; } - public void setPublishers(List publishers) { + public void setPublishers(List publishers) { this.publishers = publishers; } - public List getPolicies() { + public List getPolicies() { return policies; } - public void setPolicies(List policies) { + public void setPolicies(List policies) { this.policies = policies; } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPermittedVersion.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPermittedVersion.java similarity index 82% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPermittedVersion.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPermittedVersion.java index 85d5f8960aed..8a0804072a8d 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPermittedVersion.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPermittedVersion.java @@ -5,15 +5,16 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.Serializable; import java.util.List; /** - * Plain java representation of a SHERPA Permitted Version object, based on SHERPA API v2 responses. + * Plain java representation of an Open Policy Finder Permitted Version object, + * based on Open Policy Finder API responses. * - * In a SHERPA search for journal deposit policies, this data is contained within a publisher policy. + * In a Open Policy Finder search for journal deposit policies, this data is contained within a publisher policy. * Each permitted version is for a particular article version (e.g. submitted, accepted, published) and contains: * *

    @@ -27,9 +28,9 @@ * This class also has some helper data for labels, which can be used with i18n * when displaying policy information. * - * @see SHERPAPublisherPolicy + * @see OpenPolicyFinderPublisherPolicy */ -public class SHERPAPermittedVersion implements Serializable { +public class OpenPolicyFinderPermittedVersion implements Serializable { private static final long serialVersionUID = 4992181606327727442L; @@ -48,7 +49,7 @@ public class SHERPAPermittedVersion implements Serializable { // Required license(s) private List licenses; // Embargo - private SHERPAEmbargo embargo; + private OpenPolicyFinderEmbargo embargo; public String getArticleVersion() { return articleVersion; @@ -90,11 +91,11 @@ public void setLicenses(List licenses) { this.licenses = licenses; } - public SHERPAEmbargo getEmbargo() { + public OpenPolicyFinderEmbargo getEmbargo() { return embargo; } - public void setEmbargo(SHERPAEmbargo embargo) { + public void setEmbargo(OpenPolicyFinderEmbargo embargo) { this.embargo = embargo; } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisher.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisher.java similarity index 69% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisher.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisher.java index ee1491ed8b1a..9931ec151cdc 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisher.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisher.java @@ -5,22 +5,24 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.Serializable; /** - * Plain java representation of a SHERPA Publisher object, based on SHERPA API v2 responses. + * Plain java representation of a Open Policy Finder Publisher object, based on Open Policy Finder API responses. * - * In a search for SHERPA journal deposit policy, this publisher object will appear in a list of publishers - * from the journal object, and as a single publisher member for the primary/current publisher of the journal. - * In a search for SHERPA publisher information, this object will appear in a list of publishers from the main - * SHERPA Publisher Response object + * In a search for Open Policy Finder journal deposit policy, this publisher + * object will appear in a list of publishers from the journal object, and as + * a single publisher member for the primary/current publisher of the journal. + * In a search for Open Policy Finder publisher information, this object will + * appear in a list of publishers from the main Open Policy Finder Publisher + * Response object * - * @see SHERPAJournal - * @see SHERPAPublisherResponse + * @see OpenPolicyFinderJournal + * @see OpenPolicyFinderPublisherResponse */ -public class SHERPAPublisher implements Serializable { +public class OpenPolicyFinderPublisher implements Serializable { private String name = null; private String relationshipType; private String country; @@ -28,12 +30,13 @@ public class SHERPAPublisher implements Serializable { private String identifier = null; private int publicationCount; - // this is not technically in the same place in SHERPA data model but it makes more sense to apply it here + // this is not technically in the same place in Open Policy Finder data + // model but it makes more sense to apply it here // is it is treated as a 'special case' - just for printing links to paid OA access policies private String paidAccessDescription; private String paidAccessUrl; - public SHERPAPublisher() { + public OpenPolicyFinderPublisher() { } public String getName() { diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisherPolicy.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisherPolicy.java similarity index 79% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisherPolicy.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisherPolicy.java index 3e76c5cd37ce..34f4ead8b316 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisherPolicy.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisherPolicy.java @@ -5,31 +5,31 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.Serializable; import java.util.List; import java.util.Map; /** - * Plain java representation of a SHERPA Publisher Policy object, based on SHERPA API v2 responses. + * Plain java representation of a Open Policy Finder Publisher Policy object, based on Open Policy Finder API responses. * - * In a SHERPA search for deposit policies, each journal contains one or more publisher policies + * In a Open Policy Finder search for deposit policies, each journal contains one or more publisher policies * Each publisher policies contains a list of different article versions (eg. submitted, accepted, published) * which hold the data about what can be done with each version. * This class also holds copyright URLs and other policy URLs, as well as some helper information for display - * of overall policies in UI (as per legacy SHERPA data) + * of overall policies in UI (as per legacy Open Policy Finder data) * - * @see SHERPAJournal - * @see SHERPAPermittedVersion + * @see OpenPolicyFinderJournal + * @see OpenPolicyFinderPermittedVersion */ -public class SHERPAPublisherPolicy implements Serializable { +public class OpenPolicyFinderPublisherPolicy implements Serializable { private int id; private boolean openAccessPermitted; private String uri; private String internalMoniker; - private List permittedVersions; + private List permittedVersions; private Map urls; private boolean openAccessProhibited; private int publicationCount; @@ -71,11 +71,11 @@ public void setInternalMoniker(String internalMoniker) { this.internalMoniker = internalMoniker; } - public List getPermittedVersions() { + public List getPermittedVersions() { return permittedVersions; } - public void setPermittedVersions(List permittedVersions) { + public void setPermittedVersions(List permittedVersions) { this.permittedVersions = permittedVersions; } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisherResponse.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisherResponse.java similarity index 75% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisherResponse.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisherResponse.java index ac71c6e84418..1eab045cc531 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAPublisherResponse.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderPublisherResponse.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.IOException; import java.io.InputStream; @@ -22,15 +22,15 @@ import org.json.JSONTokener; /** - * Model class for the SHERPAv2 API (JSON) response for a publisher search + * Model class for the Open Policy Finder API (JSON) response for a publisher search * The structure and approached used is quite different to the simple v1 API used previously * - * @see SHERPAPublisher + * @see OpenPolicyFinderPublisher * * @author Kim Shepherd * */ -public class SHERPAPublisherResponse { +public class OpenPolicyFinderPublisherResponse { // Is this response to be treated as an error? private boolean error; @@ -38,38 +38,38 @@ public class SHERPAPublisherResponse { private String message; // Parsed system metadata from search results - private SHERPASystemMetadata metadata; + private OpenPolicyFinderSystemMetadata metadata; // List of parsed publisher results - private List publishers; + private List publishers; - // Internal Sherpa ID + // Internal Open Policy Finder ID private int id; - // SHERPA URI (the human page version of this API response) + // Open Policy Finder URI (the human page version of this API response) private String uri; // Format enum - currently only JSON is supported - public enum SHERPAFormat { + public enum ResponseFormat { JSON, XML }; private static Logger log = LogManager.getLogger(); /** - * Parse SHERPA v2 API for a given format + * Parse Open Policy Finder API for a given format * @param input - input stream from the HTTP response content * @param format - requested format * @throws IOException */ - public SHERPAPublisherResponse(InputStream input, SHERPAFormat format) throws IOException { - if (format == SHERPAFormat.JSON) { + public OpenPolicyFinderPublisherResponse(InputStream input, ResponseFormat format) throws IOException { + if (format == ResponseFormat.JSON) { parseJSON(input); } } /** - * Parse the SHERPA v2 API JSON and construct simple list of publisher objects + * Parse the Open Policy Finder API JSON and construct simple list of publisher objects * This method does not return a value, but rather populates the metadata and publishers objects * with data parsed from the JSON. * @param jsonData - the JSON input stream from the API result response body @@ -86,11 +86,11 @@ private void parseJSON(InputStream jsonData) throws IOException { // items array in this context is publisher results - parsing is more simple than // parsing the full journal / policy responses if (items.length() > 0) { - metadata = new SHERPASystemMetadata(); + metadata = new OpenPolicyFinderSystemMetadata(); this.publishers = new ArrayList<>(); // Iterate search result items for (int itemIndex = 0; itemIndex < items.length(); itemIndex++) { - SHERPAPublisher sherpaPublisher = new SHERPAPublisher(); + OpenPolicyFinderPublisher publisher = new OpenPolicyFinderPublisher(); JSONObject item = items.getJSONObject(itemIndex); @@ -99,19 +99,19 @@ private void parseJSON(InputStream jsonData) throws IOException { JSONObject systemMetadata = item.getJSONObject("system_metadata"); metadata = parseSystemMetadata(systemMetadata); if (metadata.getId() >= 0) { - // Set publisher identifier to be the internal SHERPA ID + // Set publisher identifier to be the internal Open Policy Finder ID // eg. '30' (Elsevier) - sherpaPublisher.setIdentifier(String.valueOf(metadata.getId())); + publisher.setIdentifier(String.valueOf(metadata.getId())); } } // Set publisher name - sherpaPublisher.setName(parsePublisherName(item)); + publisher.setName(parsePublisherName(item)); // Set publisher URL - sherpaPublisher.setUri(parsePublisherURL(item)); + publisher.setUri(parsePublisherURL(item)); - this.publishers.add(sherpaPublisher); + this.publishers.add(publisher); } } else { @@ -124,7 +124,7 @@ private void parseJSON(InputStream jsonData) throws IOException { } } catch (JSONException e) { - log.error("Failed to parse SHERPA response", e); + log.error("Failed to parse Open Policy Finder response", e); error = true; } finally { streamReader.close(); @@ -132,24 +132,24 @@ private void parseJSON(InputStream jsonData) throws IOException { } /** - * Parse system metadata and return populated SHERPASystemMetadata object + * Parse system metadata and return populated OpenPolicyFinderSystemMetadata object * @param systemMetadata */ - private SHERPASystemMetadata parseSystemMetadata(JSONObject systemMetadata) { + private OpenPolicyFinderSystemMetadata parseSystemMetadata(JSONObject systemMetadata) { - SHERPASystemMetadata metadata = new SHERPASystemMetadata(); + OpenPolicyFinderSystemMetadata metadata = new OpenPolicyFinderSystemMetadata(); if (systemMetadata.has("uri")) { this.uri = systemMetadata.getString("uri"); metadata.setUri(this.uri); } else { - log.error("SHERPA URI missing for API response item"); + log.error("Open Policy Finder URI missing for API response item"); } if (systemMetadata.has("id")) { this.id = systemMetadata.getInt("id"); metadata.setId(this.id); } else { - log.error("SHERPA internal ID missing for API response item"); + log.error("Open Policy Finder internal ID missing for API response item"); } // Get date created and added - DSpace expects this in the publisher object, though if (systemMetadata.has("date_created")) { @@ -198,7 +198,7 @@ private String parsePublisherURL(JSONObject publisher) { * Create new response object to be handled as an error * @param message - the message to render in logs or error pages */ - public SHERPAPublisherResponse(String message) { + public OpenPolicyFinderPublisherResponse(String message) { this.message = message; this.error = true; } @@ -215,11 +215,11 @@ public void setMessage(String message) { this.message = message; } - public SHERPASystemMetadata getMetadata() { + public OpenPolicyFinderSystemMetadata getMetadata() { return metadata; } - public List getPublishers() { + public List getPublishers() { return publishers; } } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAResponse.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderResponse.java similarity index 78% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAResponse.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderResponse.java index 83dd1e0d3c3d..df8ca3155df8 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAResponse.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderResponse.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.IOException; import java.io.InputStream; @@ -27,16 +27,16 @@ import org.json.JSONTokener; /** - * Model class for the SHERPAv2 API (JSON) response for a publication (journal) search + * Model class for the Open Policy Finder API (JSON) response for a publication (journal) search * The structure and approached used is quite different to the simple v1 API used previously * The structure is based on journal data, which in turn contains data about publishers and policies * - * @see SHERPAJournal + * @see OpenPolicyFinderJournal * * @author Kim Shepherd * */ -public class SHERPAResponse implements Serializable { +public class OpenPolicyFinderResponse implements Serializable { private static final long serialVersionUID = 2732963970169240597L; @@ -47,46 +47,46 @@ public class SHERPAResponse implements Serializable { private String message; // Parsed system metadata from search results - private SHERPASystemMetadata metadata; + private OpenPolicyFinderSystemMetadata metadata; // List of parsed journal results - private List journals; + private List journals; - // Internal Sherpa ID + // Internal Open Policy Finder ID private int id; - // SHERPA URI (the human page version of this API response) + // Open Policy Finder URI (the human page version of this API response) private String uri; @JsonIgnore private Date retrievalTime = new Date(); // Format enum - currently only JSON is supported - public enum SHERPAFormat { + public enum ResponseFormat { JSON, XML }; private static Logger log = LogManager.getLogger(); /** - * Parse SHERPA v2 API for a given format + * Parse Open Policy Finder API for a given format * @param input - input stream from the HTTP response content * @param format - requested format * @throws IOException */ - public SHERPAResponse(InputStream input, SHERPAFormat format) throws IOException { - if (format == SHERPAFormat.JSON) { + public OpenPolicyFinderResponse(InputStream input, ResponseFormat format) throws IOException { + if (format == ResponseFormat.JSON) { parseJSON(input); } } /** - * Create an empty SHERPAResponse representation + * Create an empty OpenPolicyFinderResponse representation */ - public SHERPAResponse() {} + public OpenPolicyFinderResponse() {} /** - * Parse the SHERPA v2 API JSON and construct Romeo policy data for display + * Parse the Open Policy Finder API JSON and construct Romeo policy data for display * This method does not return a value, but rather populates the metadata and journals objects * with data parsed from the JSON. * @param jsonData - the JSON input stream from the API result response body @@ -103,14 +103,14 @@ private void parseJSON(InputStream jsonData) throws IOException { // items array is search results, *not* journals or publishers - they are listed for each item // - however, we only ever want one result since we're passing an "equals ISSN" query if (items.length() > 0) { - metadata = new SHERPASystemMetadata(); + metadata = new OpenPolicyFinderSystemMetadata(); this.journals = new ArrayList<>(); // Iterate search result items for (int itemIndex = 0; itemIndex < items.length(); itemIndex++) { - List sherpaPublishers = new ArrayList<>(); - List policies = new ArrayList<>(); - SHERPAPublisher sherpaPublisher = new SHERPAPublisher(); - SHERPAJournal sherpaJournal = new SHERPAJournal(); + List publishers = new ArrayList<>(); + List policies = new ArrayList<>(); + OpenPolicyFinderPublisher publisher = new OpenPolicyFinderPublisher(); + OpenPolicyFinderJournal journal = new OpenPolicyFinderJournal(); JSONObject item = items.getJSONObject(itemIndex); @@ -150,8 +150,8 @@ private void parseJSON(InputStream jsonData) throws IOException { if (url.has("description") && "Open Access".equalsIgnoreCase(url.getString("description"))) { log.debug("Found OA paid access url: " + url.getString("url")); - sherpaPublisher.setPaidAccessDescription(url.getString("description")); - sherpaPublisher.setPaidAccessUrl(url.getString("url")); + publisher.setPaidAccessDescription(url.getString("description")); + publisher.setPaidAccessUrl(url.getString("url")); break; } } @@ -162,33 +162,33 @@ private void parseJSON(InputStream jsonData) throws IOException { } // Parse the main publisher policy object and add to the list - SHERPAPublisherPolicy sherpaPublisherPolicy = parsePublisherPolicy(policy); - policies.add(sherpaPublisherPolicy); + OpenPolicyFinderPublisherPolicy publisherPolicy = parsePublisherPolicy(policy); + policies.add(publisherPolicy); } // set publisher name - note we're only looking for the first name here // as per previous functionality (for simple display) if (item.has("publishers")) { - JSONArray publishers = item.getJSONArray("publishers"); - if (publishers.length() > 0) { - JSONObject publisherElement = publishers.getJSONObject(0); + JSONArray publishersArray = item.getJSONArray("publishers"); + if (publishersArray.length() > 0) { + JSONObject publisherElement = publishersArray.getJSONObject(0); if (publisherElement.has("publisher")) { - JSONObject publisher = publisherElement.getJSONObject("publisher"); - sherpaPublisher.setName(parsePublisherName(publisher)); - sherpaPublisher.setUri(parsePublisherURL(publisher)); + JSONObject publisherJson = publisherElement.getJSONObject("publisher"); + publisher.setName(parsePublisherName(publisherJson)); + publisher.setUri(parsePublisherURL(publisherJson)); } } } // Parse journal data - sherpaJournal = parseJournal(item, sherpaPublisher.getName()); + journal = parseJournal(item, publisher.getName()); } - sherpaPublishers.add(sherpaPublisher); - sherpaJournal.setPublisher(sherpaPublisher); - sherpaJournal.setPublishers(sherpaPublishers); - sherpaJournal.setPolicies(policies); - this.journals.add(sherpaJournal); + publishers.add(publisher); + journal.setPublisher(publisher); + journal.setPublishers(publishers); + journal.setPolicies(policies); + this.journals.add(journal); } } else { @@ -201,7 +201,7 @@ private void parseJSON(InputStream jsonData) throws IOException { } } catch (JSONException e) { - log.error("Failed to parse SHERPA response", e); + log.error("Failed to parse Open Policy Finder response", e); error = true; } finally { streamReader.close(); @@ -209,24 +209,24 @@ private void parseJSON(InputStream jsonData) throws IOException { } /** - * Parse system metadata and return populated SHERPASystemMetadata object + * Parse system metadata and return populated OpenPolicyFinderSystemMetadata object * @param systemMetadata */ - private SHERPASystemMetadata parseSystemMetadata(JSONObject systemMetadata) { + private OpenPolicyFinderSystemMetadata parseSystemMetadata(JSONObject systemMetadata) { - SHERPASystemMetadata metadata = new SHERPASystemMetadata(); + OpenPolicyFinderSystemMetadata metadata = new OpenPolicyFinderSystemMetadata(); if (systemMetadata.has("uri")) { this.uri = systemMetadata.getString("uri"); metadata.setUri(this.uri); } else { - log.error("SHERPA URI missing for API response item"); + log.error("Open Policy Finder URI missing for API response item"); } if (systemMetadata.has("id")) { this.id = systemMetadata.getInt("id"); metadata.setId(this.id); } else { - log.error("SHERPA internal ID missing for API response item"); + log.error("Open Policy Finder internal ID missing for API response item"); } // Get date created and added - DSpace expects this in the publisher object, though if (systemMetadata.has("date_created")) { @@ -257,9 +257,9 @@ private SHERPASystemMetadata parseSystemMetadata(JSONObject systemMetadata) { * @param publisherName - the parsed publisher name * @return */ - private SHERPAJournal parseJournal(JSONObject item, String publisherName) { + private OpenPolicyFinderJournal parseJournal(JSONObject item, String publisherName) { - SHERPAJournal sherpaJournal = new SHERPAJournal(); + OpenPolicyFinderJournal journal = new OpenPolicyFinderJournal(); // set journal title if (item.has("title")) { @@ -272,12 +272,12 @@ private SHERPAJournal parseJournal(JSONObject item, String publisherName) { titleList.add(title.getString("title").trim()); } } - sherpaJournal.setTitles(titleList); + journal.setTitles(titleList); if (titleList.size() > 0) { // Faking this a bit based on what I'd seen - not in the API v2 data - sherpaJournal.setRomeoPub(publisherName + ": " + journal.setRomeoPub(publisherName + ": " + titleList.get(0)); - sherpaJournal.setZetoPub(publisherName + ": " + journal.setZetoPub(publisherName + ": " + titleList.get(0)); log.debug("Found journal title: " + titleList.get(0)); } @@ -286,7 +286,7 @@ private SHERPAJournal parseJournal(JSONObject item, String publisherName) { // Journal URL if (item.has("url")) { - sherpaJournal.setUrl(item.getString("url")); + journal.setUrl(item.getString("url")); } // set ISSNs @@ -298,31 +298,31 @@ private SHERPAJournal parseJournal(JSONObject item, String publisherName) { JSONObject issn = issns.getJSONObject(ii); issnList.add(issn.getString("issn").trim()); } - sherpaJournal.setIssns(issnList); + journal.setIssns(issnList); } // Is the item in DOAJ? if (item.has("listed_in_doaj")) { - sherpaJournal.setInDOAJ("yes".equals(item.getString("listed_in_doaj"))); + journal.setInDOAJ("yes".equals(item.getString("listed_in_doaj"))); } - return sherpaJournal; + return journal; } /** * Parse a publisher_policy JSON data and return a populated bean * @param policy - each publisher policy node in the JSON array - * @return populated SHERPAPublisherPolicy object + * @return populated OpenPolicyFinderPublisherPolicy object */ - private SHERPAPublisherPolicy parsePublisherPolicy(JSONObject policy) { + private OpenPolicyFinderPublisherPolicy parsePublisherPolicy(JSONObject policy) { - SHERPAPublisherPolicy sherpaPublisherPolicy = new SHERPAPublisherPolicy(); + OpenPolicyFinderPublisherPolicy publisherPolicy = new OpenPolicyFinderPublisherPolicy(); // Get and set monikers String moniker = null; if (policy.has("internal_moniker")) { moniker = policy.getString("internal_moniker"); - sherpaPublisherPolicy.setInternalMoniker(moniker); + publisherPolicy.setInternalMoniker(moniker); } // URLs (used to be Copyright Links) @@ -336,7 +336,7 @@ private SHERPAPublisherPolicy parsePublisherPolicy(JSONObject policy) { copyrightLinks.put(url.getString("url"), url.getString("description")); } } - sherpaPublisherPolicy.setUrls(copyrightLinks); + publisherPolicy.setUrls(copyrightLinks); } // Permitted OA options @@ -347,7 +347,7 @@ private SHERPAPublisherPolicy parsePublisherPolicy(JSONObject policy) { if (policy.has("permitted_oa")) { List allowed = new ArrayList<>(); JSONArray permittedOA = policy.getJSONArray("permitted_oa"); - List permittedVersions = new ArrayList<>(); + List permittedVersions = new ArrayList<>(); // Iterate each permitted OA version / option. The permitted_oa node is also known as a 'pathway' -- // essentially "a way to get a work into a repository". Each pathway could refer to one article version @@ -364,7 +364,7 @@ private SHERPAPublisherPolicy parsePublisherPolicy(JSONObject policy) { JSONArray versions = permitted.getJSONArray("article_version"); for (int v = 0; v < versions.length(); v++) { // Parse this permitted_oa node but specifically looking for the article_version 'v' - SHERPAPermittedVersion permittedVersion = parsePermittedVersion(permitted, v); + OpenPolicyFinderPermittedVersion permittedVersion = parsePermittedVersion(permitted, v); // To determine which option # we are, inspect article versions and set allowed.add(permittedVersion.getArticleVersion()); @@ -385,30 +385,30 @@ private SHERPAPublisherPolicy parsePublisherPolicy(JSONObject policy) { // Populate the old indicators into the publisher policy object if (allowed.contains("submitted")) { - sherpaPublisherPolicy.setPreArchiving("can"); + publisherPolicy.setPreArchiving("can"); } if (allowed.contains("accepted")) { - sherpaPublisherPolicy.setPostArchiving("can"); + publisherPolicy.setPostArchiving("can"); } if (allowed.contains("published")) { - sherpaPublisherPolicy.setPubArchiving("can"); + publisherPolicy.setPubArchiving("can"); } } - sherpaPublisherPolicy.setPermittedVersions(permittedVersions); + publisherPolicy.setPermittedVersions(permittedVersions); } - return sherpaPublisherPolicy; + return publisherPolicy; } /** * Parse permitted version JSON and populate new bean from the data * @param permitted - each 'permitted_oa' node in the JSON array - * @return populated SHERPAPermittedVersion object + * @return populated OpenPolicyFinderPermittedVersion object */ - private SHERPAPermittedVersion parsePermittedVersion(JSONObject permitted, int index) { + private OpenPolicyFinderPermittedVersion parsePermittedVersion(JSONObject permitted, int index) { - SHERPAPermittedVersion permittedVersion = new SHERPAPermittedVersion(); + OpenPolicyFinderPermittedVersion permittedVersion = new OpenPolicyFinderPermittedVersion(); // Get the article version, which is ultimately used for the ticks / crosses // in the UI display. My assumptions around translation: @@ -457,7 +457,7 @@ private SHERPAPermittedVersion parsePermittedVersion(JSONObject permitted, int i permittedVersion.setPrerequisites(prerequisites); // Locations where this version / option may be archived - List sherpaLocations = new ArrayList<>(); + List allowedLocations = new ArrayList<>(); if (permitted.has("location")) { JSONObject locations = permitted.getJSONObject("location"); if (locations.has("location_phrases")) { @@ -466,15 +466,15 @@ private SHERPAPermittedVersion parsePermittedVersion(JSONObject permitted, int i for (int l = 0; l < locationPhrases.length(); l++) { JSONObject locationPhrase = locationPhrases.getJSONObject(l); if (locationPhrase.has("phrase")) { - sherpaLocations.add(locationPhrase.getString("phrase").trim()); + allowedLocations.add(locationPhrase.getString("phrase").trim()); } } } } } - permittedVersion.setLocations(sherpaLocations); + permittedVersion.setLocations(allowedLocations); - List sherpaLicenses = new ArrayList<>(); + List licenses = new ArrayList<>(); // required licences if (permitted.has("license")) { JSONArray licences = permitted.getJSONArray("license"); @@ -485,18 +485,20 @@ private SHERPAPermittedVersion parsePermittedVersion(JSONObject permitted, int i for (int ll = 0; ll < phrases.length(); ll++) { JSONObject phrase = phrases.getJSONObject(ll); if (phrase.has("phrase")) { - sherpaLicenses.add(phrase.getString("phrase").trim()); + licenses.add(phrase.getString("phrase").trim()); } } } } } - permittedVersion.setLicenses(sherpaLicenses); + permittedVersion.setLicenses(licenses); if (permitted.has("embargo")) { JSONObject embargo = permitted.getJSONObject("embargo"); - SHERPAEmbargo SHERPAEmbargo = new SHERPAEmbargo(embargo.getInt("amount"), embargo.getString("units")); - permittedVersion.setEmbargo(SHERPAEmbargo); + OpenPolicyFinderEmbargo OpenPolicyFinderEmbargo = + new OpenPolicyFinderEmbargo(embargo.getInt("amount"), + embargo.getString("units")); + permittedVersion.setEmbargo(OpenPolicyFinderEmbargo); } return permittedVersion; @@ -538,7 +540,7 @@ private String parsePublisherURL(JSONObject publisher) { * Create new response object to be handled as an error * @param message - the message to render in logs or error pages */ - public SHERPAResponse(String message) { + public OpenPolicyFinderResponse(String message) { this.message = message; this.error = true; } @@ -555,11 +557,11 @@ public void setMessage(String message) { this.message = message; } - public List getJournals() { + public List getJournals() { return journals; } - public SHERPASystemMetadata getMetadata() { + public OpenPolicyFinderSystemMetadata getMetadata() { return metadata; } diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPASystemMetadata.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderSystemMetadata.java similarity index 75% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPASystemMetadata.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderSystemMetadata.java index 65b07c181131..431c0c85ea65 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPASystemMetadata.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderSystemMetadata.java @@ -5,22 +5,23 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; import java.io.Serializable; /** - * Plain java representation of a SHERPA System Metadata object, based on SHERPA API v2 responses. + * Plain java representation of a Open Policy Finder System Metadata object, based on Open Policy Finder API responses. * * This data is included in both journal deposit policy and publisher searches and contains basic metadata - * about the SHERPA record and API response, eg. creation and modification dates, internal IDs, permissions, etc. + * about the Open Policy Finder record and API response, eg. creation and + * modification dates, internal IDs, permissions, etc. * - * @see SHERPAResponse - * @see SHERPAPublisherResponse + * @see OpenPolicyFinderResponse + * @see OpenPolicyFinderPublisherResponse * * @author Kim Shepherd */ -public class SHERPASystemMetadata implements Serializable { +public class OpenPolicyFinderSystemMetadata implements Serializable { private int id; private String uri; @@ -29,7 +30,7 @@ public class SHERPASystemMetadata implements Serializable { private boolean isPubliclyVisible = false; private boolean inDOAJ = false; - public SHERPASystemMetadata() { + public OpenPolicyFinderSystemMetadata() { } public int getId() { diff --git a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAUtils.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderUtils.java similarity index 69% rename from dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAUtils.java rename to dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderUtils.java index 08a0bc5e86fa..0b818f435c58 100644 --- a/dspace-api/src/main/java/org/dspace/app/sherpa/v2/SHERPAUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/v2/OpenPolicyFinderUtils.java @@ -5,20 +5,21 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.v2; +package org.dspace.app.openpolicyfinder.v2; /** - * SHERPA v2 API query handling utility methods (static). Used by external data providers and SHERPA service. + * Open Policy Finder API query handling utility methods (static). + * Used by external data providers and Open Policy Finder service. * * @author Kim Shepherd */ -public final class SHERPAUtils { +public final class OpenPolicyFinderUtils { // Private constructor (since this is a Utility class) - private SHERPAUtils() {} + private OpenPolicyFinderUtils() {} /** - * Sanitise a SHERPA v2 API query for some special JSON characters to help with parsing at remote end + * Sanitise a Open Policy Finder API query for some special JSON characters to help with parsing at remote end * Strip all these characters: "'{}; * The URI builder used in the provider and service classes will perform URL encoding. This string * is the raw query submitted to the provider or service. diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java b/dspace-api/src/main/java/org/dspace/content/authority/OpenPolicyFinderJournalTitle.java similarity index 59% rename from dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java rename to dspace-api/src/main/java/org/dspace/content/authority/OpenPolicyFinderJournalTitle.java index 14c0abacd2ed..78a5d17958f8 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOJournalTitle.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/OpenPolicyFinderJournalTitle.java @@ -11,8 +11,8 @@ import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; -import org.dspace.app.sherpa.SHERPAService; -import org.dspace.app.sherpa.v2.SHERPAResponse; +import org.dspace.app.openpolicyfinder.OpenPolicyFinderService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; import org.dspace.utils.DSpace; /** @@ -21,12 +21,12 @@ * @author Larry Stone * @author Andrea Bollini (andrea.bollini at 4science.it) * @version $Revision $ - * @see SHERPARoMEOProtocol + * @see OpenPolicyFinderJournalTitle */ -public class SHERPARoMEOJournalTitle implements ChoiceAuthority { +public class OpenPolicyFinderJournalTitle implements ChoiceAuthority { private String pluginInstanceName; - public SHERPARoMEOJournalTitle() { + public OpenPolicyFinderJournalTitle() { super(); } @@ -36,19 +36,20 @@ public Choices getMatches(String text, int start, int limit, String locale) { if (text == null || text.trim().length() == 0) { return new Choices(true); } - SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); - SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "title", + OpenPolicyFinderService openPolicyFinderService = + new DSpace().getSingletonService(OpenPolicyFinderService.class); + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest("publication", "title", "contains word", text, 0, 0); Choices result; - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - List list = sherpaResponse + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + List list = opfResponse .getJournals().stream() .skip(start) .limit(limit) - .map(sherpaJournal -> new Choice(sherpaJournal.getIssns().get(0), - sherpaJournal.getTitles().get(0), sherpaJournal.getTitles().get(0))) + .map(journal -> new Choice(journal.getIssns().get(0), + journal.getTitles().get(0), journal.getTitles().get(0))) .collect(Collectors.toList()); - int total = sherpaResponse.getJournals().size(); + int total = opfResponse.getJournals().size(); result = new Choices(list.toArray(new Choice[list.size()]), start, total, Choices.CF_ACCEPTED, total > (start + limit)); } else { @@ -64,17 +65,18 @@ public Choices getBestMatch(String text, String locale) { return new Choices(true); } int limit = 10; - SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); - SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "title", + OpenPolicyFinderService openPolicyFinderService = + new DSpace().getSingletonService(OpenPolicyFinderService.class); + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest("publication", "title", "equals", text, 0, limit); Choices result; - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - List list = sherpaResponse + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + List list = opfResponse .getJournals().stream() - .map(sherpaJournal -> new Choice(sherpaJournal.getIssns().get(0), - sherpaJournal.getTitles().get(0), sherpaJournal.getTitles().get(0))) + .map(journal -> new Choice(journal.getIssns().get(0), + journal.getTitles().get(0), journal.getTitles().get(0))) .collect(Collectors.toList()); - int total = sherpaResponse.getJournals().size(); + int total = opfResponse.getJournals().size(); int confidence; if (list.isEmpty()) { @@ -94,11 +96,12 @@ public Choices getBestMatch(String text, String locale) { @Override public String getLabel(String key, String locale) { - SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); - SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "issn", + OpenPolicyFinderService openPolicyFinderService = + new DSpace().getSingletonService(OpenPolicyFinderService.class); + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest("publication", "issn", "equals", key, 0, 1); - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - return sherpaResponse.getJournals().get(0).getTitles().get(0); + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + return opfResponse.getJournals().get(0).getTitles().get(0); } else { return null; } diff --git a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java b/dspace-api/src/main/java/org/dspace/content/authority/OpenPolicyFinderPublisherAuthority.java similarity index 58% rename from dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java rename to dspace-api/src/main/java/org/dspace/content/authority/OpenPolicyFinderPublisherAuthority.java index a8e834c27d68..726da556473a 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/SHERPARoMEOPublisher.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/OpenPolicyFinderPublisherAuthority.java @@ -11,8 +11,8 @@ import java.util.stream.Collectors; import org.apache.commons.collections4.CollectionUtils; -import org.dspace.app.sherpa.SHERPAService; -import org.dspace.app.sherpa.v2.SHERPAPublisherResponse; +import org.dspace.app.openpolicyfinder.OpenPolicyFinderService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderPublisherResponse; import org.dspace.utils.DSpace; /** @@ -21,12 +21,12 @@ * @author Larry Stone * @author Andrea Bollini (andrea.bollini at 4science.it) * @version $Revision $ - * @see SHERPARoMEOProtocol + * @see OpenPolicyFinderJournalTitle */ -public class SHERPARoMEOPublisher implements ChoiceAuthority { +public class OpenPolicyFinderPublisherAuthority implements ChoiceAuthority { private String pluginInstanceName; - public SHERPARoMEOPublisher() { + public OpenPolicyFinderPublisherAuthority() { super(); } @@ -36,20 +36,22 @@ public Choices getMatches(String text, int start, int limit, String locale) { if (text == null || text.trim().length() == 0) { return new Choices(true); } - SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); - SHERPAPublisherResponse sherpaResponse = sherpaService.performPublisherRequest("publisher", "name", + OpenPolicyFinderService openPolicyFinderService = + new DSpace().getSingletonService(OpenPolicyFinderService.class); + OpenPolicyFinderPublisherResponse opfResponse = + openPolicyFinderService.performPublisherRequest("publisher", "name", "contains word", text, 0, 0); Choices result; - if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { - List list = sherpaResponse + if (CollectionUtils.isNotEmpty(opfResponse.getPublishers())) { + List list = opfResponse .getPublishers().stream() .skip(start) .limit(limit) - .map(sherpaPublisher -> - new Choice(sherpaPublisher.getIdentifier(), - sherpaPublisher.getName(), sherpaPublisher.getName())) + .map(publisher -> + new Choice(publisher.getIdentifier(), + publisher.getName(), publisher.getName())) .collect(Collectors.toList()); - int total = sherpaResponse.getPublishers().size(); + int total = opfResponse.getPublishers().size(); result = new Choices(list.toArray(new Choice[list.size()]), start, total, Choices.CF_ACCEPTED, total > (start + limit)); } else { @@ -65,18 +67,20 @@ public Choices getBestMatch(String text, String locale) { return new Choices(true); } int limit = 10; - SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); - SHERPAPublisherResponse sherpaResponse = sherpaService.performPublisherRequest("publisher", "name", + OpenPolicyFinderService openPolicyFinderService = + new DSpace().getSingletonService(OpenPolicyFinderService.class); + OpenPolicyFinderPublisherResponse opfResponse = + openPolicyFinderService.performPublisherRequest("publisher", "name", "equals", text, 0, limit); Choices result; - if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { - List list = sherpaResponse + if (CollectionUtils.isNotEmpty(opfResponse.getPublishers())) { + List list = opfResponse .getPublishers().stream() - .map(sherpaPublisher -> - new Choice(sherpaPublisher.getIdentifier(), - sherpaPublisher.getName(), sherpaPublisher.getName())) + .map(publisher -> + new Choice(publisher.getIdentifier(), + publisher.getName(), publisher.getName())) .collect(Collectors.toList()); - int total = sherpaResponse.getPublishers().size(); + int total = opfResponse.getPublishers().size(); int confidence; if (list.isEmpty()) { @@ -96,11 +100,13 @@ public Choices getBestMatch(String text, String locale) { @Override public String getLabel(String key, String locale) { - SHERPAService sherpaService = new DSpace().getSingletonService(SHERPAService.class); - SHERPAPublisherResponse sherpaResponse = sherpaService.performPublisherRequest("publisher", "id", + OpenPolicyFinderService openPolicyFinderService = + new DSpace().getSingletonService(OpenPolicyFinderService.class); + OpenPolicyFinderPublisherResponse opfResponse = + openPolicyFinderService.performPublisherRequest("publisher", "id", "equals", key, 0, 1); - if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { - return sherpaResponse.getPublishers().get(0).getName(); + if (CollectionUtils.isNotEmpty(opfResponse.getPublishers())) { + return opfResponse.getPublishers().get(0).getName(); } else { return null; } diff --git a/dspace-api/src/main/java/org/dspace/ctask/general/MetadataWebService.java b/dspace-api/src/main/java/org/dspace/ctask/general/MetadataWebService.java index 1b618ad31fb7..d1009429c4c9 100644 --- a/dspace-api/src/main/java/org/dspace/ctask/general/MetadataWebService.java +++ b/dspace-api/src/main/java/org/dspace/ctask/general/MetadataWebService.java @@ -64,7 +64,7 @@ * Intended use: cataloging tool in workflow and general curation. * The task uses a URL 'template' to compose the service call, e.g. * - *

    {@code http://www.sherpa.ac.uk/romeo/api29.php?issn=\{dc.identifier.issn\}} + *

    {@code http://www.openpolicyfinder.jisc.ac.uk/api29.php?issn=\{dc.identifier.issn\}} * *

    Task will substitute the value of the passed item's metadata field * in the {parameter} position. If multiple values are present in the diff --git a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java b/dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderJournalDataProvider.java similarity index 58% rename from dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java rename to dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderJournalDataProvider.java index c39c6dd13525..7b0735b30df2 100644 --- a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalDataProvider.java +++ b/dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderJournalDataProvider.java @@ -15,29 +15,29 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.dspace.app.sherpa.SHERPAService; -import org.dspace.app.sherpa.v2.SHERPAJournal; -import org.dspace.app.sherpa.v2.SHERPAResponse; -import org.dspace.app.sherpa.v2.SHERPAUtils; +import org.dspace.app.openpolicyfinder.OpenPolicyFinderService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderJournal; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderUtils; import org.dspace.content.dto.MetadataValueDTO; import org.dspace.external.model.ExternalDataObject; import org.dspace.external.provider.AbstractExternalDataProvider; /** - * This class is the implementation of the ExternalDataProvider interface that will deal with SherpaJournal External - * data lookups. - * This provider is a refactored version of SherpaJournalDataPublisher, rewritten to work with - * the Jisc Open Policy Finder API (formerly SHERPA v2 API) + * This class is the implementation of the ExternalDataProvider interface that will deal with + * Open Policy Finder Journal External data lookups. + * This provider is a refactored version of OpenPolicyFinderJournalDataProvider, rewritten to work with + * the Jisc Open Policy Finder API (formerly Open Policy Finder API) * * @author Kim Shepherd */ -public class SHERPAv2JournalDataProvider extends AbstractExternalDataProvider { +public class OpenPolicyFinderJournalDataProvider extends AbstractExternalDataProvider { // Source identifier (configured in spring configuration) private String sourceIdentifier; - // SHERPA v2 API service (configured in spring configuration) - SHERPAService sherpaService; + // Open Policy Finder API service (configured in spring configuration) + OpenPolicyFinderService openPolicyFinderService; @Override public String getSourceIdentifier() { @@ -58,17 +58,18 @@ public void init() throws IOException {} @Override public Optional getExternalDataObject(String id) { // Sanitise ID / title query string (strips some special characters) - id = SHERPAUtils.sanitiseQuery(id); + id = OpenPolicyFinderUtils.sanitiseQuery(id); - // Perform request using the SHERPA service (first row only) - SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "title", "equals", id, - 0, 1); + // Perform request using the Open Policy Finder service (first row only) + OpenPolicyFinderResponse opfResponse = + openPolicyFinderService.performRequest("publication", "title", "equals", id, + 0, 1); // If a journal was returned, get it and convert it to an ExternalDataObject - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - SHERPAJournal sherpaJournal = sherpaResponse.getJournals().get(0); + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + OpenPolicyFinderJournal journal = opfResponse.getJournals().get(0); - ExternalDataObject externalDataObject = constructExternalDataObjectFromSherpaJournal(sherpaJournal); + ExternalDataObject externalDataObject = constructExternalDataObjectFromJournal(journal); return Optional.of(externalDataObject); } @@ -77,26 +78,26 @@ public Optional getExternalDataObject(String id) { } /** - * Construct ExternalDataObject populated with journal metadata from the SHERPA v2 API response - * @param sherpaJournal + * Construct ExternalDataObject populated with journal metadata from the Open Policy Finder API response + * @param journal * @return external data object representing a journal */ - private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJournal sherpaJournal) { + private ExternalDataObject constructExternalDataObjectFromJournal(OpenPolicyFinderJournal journal) { // Set up external object ExternalDataObject externalDataObject = new ExternalDataObject(); externalDataObject.setSource(sourceIdentifier); // Set journal title in external object - if (CollectionUtils.isNotEmpty(sherpaJournal.getTitles())) { - String journalTitle = sherpaJournal.getTitles().get(0); - externalDataObject.setId(sherpaJournal.getTitles().get(0)); + if (CollectionUtils.isNotEmpty(journal.getTitles())) { + String journalTitle = journal.getTitles().get(0); + externalDataObject.setId(journal.getTitles().get(0)); externalDataObject.addMetadata(new MetadataValueDTO( "dc", "title", null, null, journalTitle)); externalDataObject.setValue(journalTitle); externalDataObject.setDisplayValue(journalTitle); } // Set ISSNs in external object - if (CollectionUtils.isNotEmpty(sherpaJournal.getIssns())) { - String issn = sherpaJournal.getIssns().get(0); + if (CollectionUtils.isNotEmpty(journal.getIssns())) { + String issn = journal.getIssns().get(0); externalDataObject.addMetadata(new MetadataValueDTO( "creativeworkseries", "issn", null, null, issn)); @@ -106,7 +107,7 @@ private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJo } /** - * Search SHERPA v2 API for journal results based on a 'contains word' query + * Search Open Policy Finder API for journal results based on a 'contains word' query * @param query The query for the search * @param start The start of the search * @param limit The max amount of records to be returned by the search @@ -114,14 +115,14 @@ private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJo */ @Override public List searchExternalDataObjects(String query, int start, int limit) { - // Search SHERPA for journals with the query term in the title - SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "title", + // Search Open Policy Finder for journals with the query term in the title + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest("publication", "title", "contains word", query, start, limit); - // Convert SHERPA response to a Collection and return the list - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - List list = sherpaResponse.getJournals().stream().map( - sherpaJournal -> constructExternalDataObjectFromSherpaJournal(sherpaJournal)).collect( + // Convert Open Policy Finder response to a Collection and return the list + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + List list = opfResponse.getJournals().stream().map( + journal -> constructExternalDataObjectFromJournal(journal)).collect( Collectors.toList()); // Unlike the previous API version we can request offset and limit, so no need to build a @@ -139,20 +140,20 @@ public boolean supports(String source) { } /** - * Get number of results returned from a SHERPA v2 publication search + * Get number of results returned from a Open Policy Finder publication search * @param query The query to be search on and give the total amount of results * @return int representing number of journal results */ @Override public int getNumberOfResults(String query) { - // Search SHERPA for journals with the query term in the title + // Search Open Policy Finder for journals with the query term in the title // Limit = 0 means the limit parameter will not be added to the API query - SHERPAResponse sherpaResponse = sherpaService.performRequest("publication", "title", + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest("publication", "title", "contains word", query, 0, 0); // Get number of journals returned in response - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - return sherpaResponse.getJournals().size(); + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + return opfResponse.getJournals().size(); } // If other checks have failed return 0 @@ -161,18 +162,19 @@ public int getNumberOfResults(String query) { /** * Generic setter for the sourceIdentifier - * @param sourceIdentifier The sourceIdentifier to be set on this SHERPAv2JournalDataProvider + * @param sourceIdentifier The sourceIdentifier to be set on this OpenPolicyFinderJournalDataProvider */ public void setSourceIdentifier(String sourceIdentifier) { this.sourceIdentifier = sourceIdentifier; } /** - * Generic setter for the SHERPA service - * @param sherpaService The sherpaService to be set on this SHERPAv2JournalDataProvider + * Generic setter for the Open Policy Finder service + * @param openPolicyFinderService The openPolicyFinderService to be set on this + * OpenPolicyFinderJournalDataProvider */ - public void setSherpaService(SHERPAService sherpaService) { - this.sherpaService = sherpaService; + public void setOpenPolicyFinderService(OpenPolicyFinderService openPolicyFinderService) { + this.openPolicyFinderService = openPolicyFinderService; } } diff --git a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java b/dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderJournalISSNDataProvider.java similarity index 57% rename from dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java rename to dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderJournalISSNDataProvider.java index 860334847ccb..ad2e10c48c79 100644 --- a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2JournalISSNDataProvider.java +++ b/dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderJournalISSNDataProvider.java @@ -16,33 +16,35 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.Logger; -import org.dspace.app.sherpa.SHERPAService; -import org.dspace.app.sherpa.v2.SHERPAJournal; -import org.dspace.app.sherpa.v2.SHERPAResponse; -import org.dspace.app.sherpa.v2.SHERPAUtils; +import org.dspace.app.openpolicyfinder.OpenPolicyFinderService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderJournal; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderUtils; import org.dspace.content.dto.MetadataValueDTO; import org.dspace.external.model.ExternalDataObject; import org.dspace.external.provider.AbstractExternalDataProvider; /** - * This class is the implementation of the ExternalDataProvider interface that will deal with SherpaJournal External - * data lookups based on ISSN (to match functinoality offered by legacy SHERPASubmitService for policy lookups - * at the time of submission). - * This provider is a refactored version of SherpaJournalDataPublisher, rewritten to work with SHERPA v2 API + * This class is the implementation of the ExternalDataProvider interface that will deal with + * Open Policy Finder Journal External data lookups based on ISSN + * (to match functionality offered by legacy OpenPolicyFinderSubmitService + * for policy lookups at the time of submission). + * This provider is a refactored version of OpenPolicyFinderJournalDataProvider, rewritten to work with + * Open Policy Finder API * * @author Kim Shepherd */ -public class SHERPAv2JournalISSNDataProvider extends AbstractExternalDataProvider { +public class OpenPolicyFinderJournalISSNDataProvider extends AbstractExternalDataProvider { private static final Logger log = org.apache.logging.log4j.LogManager.getLogger( - org.dspace.external.provider.impl.SHERPAv2JournalISSNDataProvider.class); + org.dspace.external.provider.impl.OpenPolicyFinderJournalISSNDataProvider.class); // Source identifier (configured in spring configuration) private String sourceIdentifier; - // SHERPA v2 API service (configured in spring configuration) - SHERPAService sherpaService; + // Open Policy Finder API service (configured in spring configuration) + OpenPolicyFinderService openPolicyFinderService; @Override public String getSourceIdentifier() { @@ -50,7 +52,7 @@ public String getSourceIdentifier() { } /** - * Initialise the provider - this no longer starts client since that is handled by SHERPAService + * Initialise the provider - this no longer starts client since that is handled by OpenPolicyFinderService * @throws IOException If something goes wrong */ public void init() throws IOException { @@ -65,45 +67,45 @@ public void init() throws IOException { public Optional getExternalDataObject(String issn) { // Sanitise ID / title query string (strips some special characters) - issn = SHERPAUtils.sanitiseQuery(issn); + issn = OpenPolicyFinderUtils.sanitiseQuery(issn); - log.debug("Searching SHERPA for ISSN: " + issn); + log.debug("Searching Open Policy Finder for ISSN: " + issn); - // Get SHERPA response from base service - // Get SHERPA response from the API for all objects matching this ISSN - SHERPAResponse sherpaResponse = sherpaService.performRequest( + // Get Open Policy Finder response from base service + // Get Open Policy Finder response from the API for all objects matching this ISSN + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest( "publication", "issn", "equals", issn, 0, 1); // Construct external data objects - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - SHERPAJournal sherpaJournal = sherpaResponse.getJournals().get(0); - ExternalDataObject externalDataObject = constructExternalDataObjectFromSherpaJournal(sherpaJournal); + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + OpenPolicyFinderJournal journal = opfResponse.getJournals().get(0); + ExternalDataObject externalDataObject = constructExternalDataObjectFromJournal(journal); return Optional.of(externalDataObject); } return Optional.empty(); } /** - * Construct ExternalDataObject populated with journal metadata from the SHERPA v2 API response - * @param sherpaJournal + * Construct ExternalDataObject populated with journal metadata from the Open Policy Finder API response + * @param journal * @return external data object representing a journal */ - private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJournal sherpaJournal) { + private ExternalDataObject constructExternalDataObjectFromJournal(OpenPolicyFinderJournal journal) { // Set up external object ExternalDataObject externalDataObject = new ExternalDataObject(); externalDataObject.setSource(sourceIdentifier); // Set journal title in external object - if (CollectionUtils.isNotEmpty(sherpaJournal.getTitles())) { - String journalTitle = sherpaJournal.getTitles().get(0); - externalDataObject.setId(sherpaJournal.getTitles().get(0)); + if (CollectionUtils.isNotEmpty(journal.getTitles())) { + String journalTitle = journal.getTitles().get(0); + externalDataObject.setId(journal.getTitles().get(0)); externalDataObject.addMetadata(new MetadataValueDTO( "dc", "title", null, null, journalTitle)); externalDataObject.setValue(journalTitle); externalDataObject.setDisplayValue(journalTitle); } // Set ISSNs in external object - if (CollectionUtils.isNotEmpty(sherpaJournal.getIssns())) { - String issn = sherpaJournal.getIssns().get(0); + if (CollectionUtils.isNotEmpty(journal.getIssns())) { + String issn = journal.getIssns().get(0); externalDataObject.setId(issn); externalDataObject.addMetadata(new MetadataValueDTO( "creativeworkseries", "issn", null, null, issn)); @@ -116,7 +118,7 @@ private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJo } /** - * Search SHERPA v2 API for journal results based on a 'contains word' query + * Search Open Policy Finder API for journal results based on a 'contains word' query * @param query The term to query for the search * @param start The start of the search * @param limit The max amount of records to be returned by the search @@ -125,22 +127,22 @@ private ExternalDataObject constructExternalDataObjectFromSherpaJournal(SHERPAJo @Override public List searchExternalDataObjects(String query, int start, int limit) { - // Get SHERPA response from the API for all objects matching this ISSN - SHERPAResponse sherpaResponse = sherpaService.performRequest( + // Get Open Policy Finder response from the API for all objects matching this ISSN + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest( "publication", "issn", "equals", query, start, limit); // Construct a list of external data objects and return it - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - log.debug("Found " + sherpaResponse.getJournals().size() + " matching journals for ISSN " + query); - List list = sherpaResponse.getJournals().stream().map( - sherpaJournal -> constructExternalDataObjectFromSherpaJournal(sherpaJournal)).collect( + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + log.debug("Found " + opfResponse.getJournals().size() + " matching journals for ISSN " + query); + List list = opfResponse.getJournals().stream().map( + journal -> constructExternalDataObjectFromJournal(journal)).collect( Collectors.toList()); // Unlike the previous API version we can request offset and limit, so no need to build aF // sublist from this list, we can just return the list. return list; } else { - log.debug("Empty response from SHERPA v2 API for ISSN " + query); + log.debug("Empty response from Open Policy Finder API for ISSN " + query); } // If nothing was returned from the response, return an empty list @@ -153,21 +155,21 @@ public boolean supports(String source) { } /** - * Get number of results returned from a SHERPA v2 publication search + * Get number of results returned from a Open Policy Finder publication search * @param issn The query to be search on and give the total amount of results * @return int representing number of journal results */ @Override public int getNumberOfResults(String issn) { - // Get SHERPA response from the API for all objects matching this ISSN. + // Get Open Policy Finder response from the API for all objects matching this ISSN. // The limit of 0 means a limit parameter will not be added to the API query - SHERPAResponse sherpaResponse = sherpaService.performRequest( + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.performRequest( "publication", "issn", "equals", issn, 0, 0); // Return the size of the journal collection - if (CollectionUtils.isNotEmpty(sherpaResponse.getJournals())) { - return sherpaResponse.getJournals().size(); + if (CollectionUtils.isNotEmpty(opfResponse.getJournals())) { + return opfResponse.getJournals().size(); } // If other checks have failed return 0 @@ -176,17 +178,18 @@ public int getNumberOfResults(String issn) { /** * Generic setter for the sourceIdentifier - * @param sourceIdentifier The sourceIdentifier to be set on this SHERPAv2JournalISSNDataProvider + * @param sourceIdentifier The sourceIdentifier to be set on this OpenPolicyFinderJournalISSNDataProvider */ public void setSourceIdentifier(String sourceIdentifier) { this.sourceIdentifier = sourceIdentifier; } /** - * Generic setter for the SHERPA Service - * @param sherpaService THe SHERPA service to be set on this SHERPAv2JournalISSNDataProvider + * Generic setter for the Open Policy Finder Service + * @param openPolicyFinderService THe Open Policy Finder service to be set on this + * OpenPolicyFinderJournalISSNDataProvider */ - public void setSherpaService(SHERPAService sherpaService) { - this.sherpaService = sherpaService; + public void setOpenPolicyFinderService(OpenPolicyFinderService openPolicyFinderService) { + this.openPolicyFinderService = openPolicyFinderService; } } diff --git a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java b/dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderPublisherDataProvider.java similarity index 54% rename from dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java rename to dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderPublisherDataProvider.java index 0afe78b44137..5b36fdf3747e 100644 --- a/dspace-api/src/main/java/org/dspace/external/provider/impl/SHERPAv2PublisherDataProvider.java +++ b/dspace-api/src/main/java/org/dspace/external/provider/impl/OpenPolicyFinderPublisherDataProvider.java @@ -15,30 +15,31 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.dspace.app.sherpa.SHERPAService; -import org.dspace.app.sherpa.v2.SHERPAPublisher; -import org.dspace.app.sherpa.v2.SHERPAPublisherResponse; -import org.dspace.app.sherpa.v2.SHERPAUtils; +import org.dspace.app.openpolicyfinder.OpenPolicyFinderService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderPublisher; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderPublisherResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderUtils; import org.dspace.content.dto.MetadataValueDTO; import org.dspace.external.model.ExternalDataObject; import org.dspace.external.provider.AbstractExternalDataProvider; /** - * This class is the implementation of the ExternalDataProvider interface that will deal with SHERPAPublisher External + * This class is the implementation of the ExternalDataProvider interface that will deal with + * OpenPolicyFinderPublisher External * data lookups. - * This provider is a refactored version of SherpaPublisherDataPublisher, rewritten to work with - * the Jisc Open Policy Finder API (formerly SHERPA v2 API) + * This provider is a refactored version of OpenPolicyFinderPublisherDataProvider, rewritten to work with + * the Jisc Open Policy Finder API (formerly Open Policy Finder API) * * It uses a more simple response object than the normal publication / policy search * * @author Kim Shepherd */ -public class SHERPAv2PublisherDataProvider extends AbstractExternalDataProvider { +public class OpenPolicyFinderPublisherDataProvider extends AbstractExternalDataProvider { - // Source identifier (eg 'sherpaPublisher') configured in spring configuration + // Source identifier (eg 'opfPublisher') configured in spring configuration private String sourceIdentifier; - // SHERPA service configured in spring configuration - private SHERPAService sherpaService; + // Open Policy Finder service configured in spring configuration + private OpenPolicyFinderService openPolicyFinderService; @Override public String getSourceIdentifier() { @@ -59,24 +60,25 @@ public void init() throws IOException {} @Override public Optional getExternalDataObject(String id) { // Sanitise the given ID / title query - id = SHERPAUtils.sanitiseQuery(id); + id = OpenPolicyFinderUtils.sanitiseQuery(id); - // Search for publishers matching this ID in SHERPA. Limit to 1 result since this is for a single object - SHERPAPublisherResponse sherpaResponse = - sherpaService.performPublisherRequest("publisher", "id", "equals", id, 0, 1); + // Search for publishers matching this ID in Open Policy Finder. + // Limit to 1 result since this is for a single object + OpenPolicyFinderPublisherResponse opfResponse = + openPolicyFinderService.performPublisherRequest("publisher", "id", "equals", id, 0, 1); // If there is at least one publisher, retrieve it and transform it to an ExternalDataObject - if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { - SHERPAPublisher sherpaPublisher = sherpaResponse.getPublishers().get(0); + if (CollectionUtils.isNotEmpty(opfResponse.getPublishers())) { + OpenPolicyFinderPublisher publisher = opfResponse.getPublishers().get(0); // Construct external data object from returned publisher - ExternalDataObject externalDataObject = constructExternalDataObjectFromSherpaPublisher(sherpaPublisher); + ExternalDataObject externalDataObject = constructExternalDataObjectFromPublisher(publisher); return Optional.of(externalDataObject); } return Optional.empty(); } /** - * Search SHERPA v2 API for publisher results based on a 'contains word' query for publisher name + * Search Open Policy Finder API for publisher results based on a 'contains word' query for publisher name * @param query The query for the search * @param start The start of the search * @param limit The max amount of records to be returned by the search @@ -84,14 +86,14 @@ public Optional getExternalDataObject(String id) { */ @Override public List searchExternalDataObjects(String query, int start, int limit) { - // Search SHERPA for publishers with the query term in the title (name) - SHERPAPublisherResponse sherpaResponse = sherpaService.performPublisherRequest( + // Search Open Policy Finder for publishers with the query term in the title (name) + OpenPolicyFinderPublisherResponse opfResponse = openPolicyFinderService.performPublisherRequest( "publisher", "name", "contains word", query, start, limit); // If at least one publisher was found, convert to a list of ExternalDataObjects and return - if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { - List list = sherpaResponse.getPublishers().stream().map( - sherpaPublisher -> constructExternalDataObjectFromSherpaPublisher(sherpaPublisher)).collect( + if (CollectionUtils.isNotEmpty(opfResponse.getPublishers())) { + List list = opfResponse.getPublishers().stream().map( + publisher -> constructExternalDataObjectFromPublisher(publisher)).collect( Collectors.toList()); // Unlike the previous API version we can request offset and limit, so no need to build a @@ -103,29 +105,30 @@ public List searchExternalDataObjects(String query, int star return Collections.emptyList(); } - private ExternalDataObject constructExternalDataObjectFromSherpaPublisher(SHERPAPublisher sherpaPublisher) { + private ExternalDataObject constructExternalDataObjectFromPublisher( + OpenPolicyFinderPublisher publisher) { ExternalDataObject externalDataObject = new ExternalDataObject(); externalDataObject.setSource(sourceIdentifier); // Set publisher name - if (StringUtils.isNotBlank(sherpaPublisher.getName())) { + if (StringUtils.isNotBlank(publisher.getName())) { externalDataObject.addMetadata(new MetadataValueDTO( - "dc", "title", null, null, sherpaPublisher.getName())); - externalDataObject.setDisplayValue(sherpaPublisher.getName()); - externalDataObject.setValue(sherpaPublisher.getName()); + "dc", "title", null, null, publisher.getName())); + externalDataObject.setDisplayValue(publisher.getName()); + externalDataObject.setValue(publisher.getName()); } // Set publisher ID - if (StringUtils.isNotBlank(sherpaPublisher.getIdentifier())) { - externalDataObject.setId(sherpaPublisher.getIdentifier()); + if (StringUtils.isNotBlank(publisher.getIdentifier())) { + externalDataObject.setId(publisher.getIdentifier()); externalDataObject.addMetadata(new MetadataValueDTO( - "dc", "identifier", "sherpaPublisher", null, - sherpaPublisher.getIdentifier())); + "dc", "identifier", "opfPublisher", null, + publisher.getIdentifier())); } // Set home URL - if (StringUtils.isNotBlank(sherpaPublisher.getUri())) { + if (StringUtils.isNotBlank(publisher.getUri())) { externalDataObject.addMetadata(new MetadataValueDTO( - "dc", "identifier", "other", null, sherpaPublisher.getUri())); + "dc", "identifier", "other", null, publisher.getUri())); } return externalDataObject; @@ -137,20 +140,20 @@ public boolean supports(String source) { } /** - * Get number of results returned from a SHERPA v2 publication search + * Get number of results returned from a Open Policy Finder publication search * @param query The query to be search on and give the total amount of results * @return int representing number of publisher results */ @Override public int getNumberOfResults(String query) { - // Search SHERPA for publishers with the query term in the title (name) + // Search Open Policy Finder for publishers with the query term in the title (name) // a limit of 0 means the limit parameter won't be added to the API query - SHERPAPublisherResponse sherpaResponse = sherpaService.performPublisherRequest( + OpenPolicyFinderPublisherResponse opfResponse = openPolicyFinderService.performPublisherRequest( "publication", "title", "contains word", query, 0, 0); // Return the number of publishers in the response object - if (CollectionUtils.isNotEmpty(sherpaResponse.getPublishers())) { - return sherpaResponse.getPublishers().size(); + if (CollectionUtils.isNotEmpty(opfResponse.getPublishers())) { + return opfResponse.getPublishers().size(); } // If other checks have failed return 0 @@ -159,18 +162,19 @@ public int getNumberOfResults(String query) { /** * Generic setter for the sourceIdentifier - * @param sourceIdentifier The sourceIdentifier to be set on this SHERPAv2PublisherDataProvider + * @param sourceIdentifier The sourceIdentifier to be set on this OpenPolicyFinderPublisherDataProvider */ public void setSourceIdentifier(String sourceIdentifier) { this.sourceIdentifier = sourceIdentifier; } /** - * Generic setter for the SHERPA Service - * @param sherpaService THe SHERPA service to be set on this SHERPAv2PublisherDataProvider + * Generic setter for the Open Policy Finder Service + * @param openPolicyFinderService THe Open Policy Finder service to be set on this + * OpenPolicyFinderPublisherDataProvider */ - public void setSherpaService(SHERPAService sherpaService) { - this.sherpaService = sherpaService; + public void setOpenPolicyFinderService(OpenPolicyFinderService openPolicyFinderService) { + this.openPolicyFinderService = openPolicyFinderService; } } diff --git a/dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml b/dspace-api/src/main/resources/spring/spring-dspace-addon-openpolicyfinder-services.xml similarity index 58% rename from dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml rename to dspace-api/src/main/resources/spring/spring-dspace-addon-openpolicyfinder-services.xml index e2726e609b52..9cae36f2b12f 100644 --- a/dspace-api/src/main/resources/spring/spring-dspace-addon-sherpa-services.xml +++ b/dspace-api/src/main/resources/spring/spring-dspace-addon-openpolicyfinder-services.xml @@ -20,31 +20,31 @@ - + - - - + + + - + - + dc.identifier.issn - - + diff --git a/dspace-api/src/test/data/dspaceFolder/config/spring/api/external-services.xml b/dspace-api/src/test/data/dspaceFolder/config/spring/api/external-services.xml index 83d45b38cc76..d6e7e7c2e515 100644 --- a/dspace-api/src/test/data/dspaceFolder/config/spring/api/external-services.xml +++ b/dspace-api/src/test/data/dspaceFolder/config/spring/api/external-services.xml @@ -12,28 +12,28 @@ - - - - + + + + Journal - - - + + + Journal - - - + + + OrgUnit diff --git a/dspace-api/src/test/data/dspaceFolder/config/spring/api/sherpa.xml b/dspace-api/src/test/data/dspaceFolder/config/spring/api/openpolicyfinder.xml similarity index 50% rename from dspace-api/src/test/data/dspaceFolder/config/spring/api/sherpa.xml rename to dspace-api/src/test/data/dspaceFolder/config/spring/api/openpolicyfinder.xml index 206326f3db70..f44cee6fb769 100644 --- a/dspace-api/src/test/data/dspaceFolder/config/spring/api/sherpa.xml +++ b/dspace-api/src/test/data/dspaceFolder/config/spring/api/openpolicyfinder.xml @@ -10,19 +10,19 @@ - + - + dc.identifier.issn - - - + + + - - - + + + diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/MockOpenPolicyFinderService.java similarity index 67% rename from dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java rename to dspace-api/src/test/java/org/dspace/app/openpolicyfinder/MockOpenPolicyFinderService.java index f52f3032df40..bceefc916ffe 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/MockSHERPAService.java +++ b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/MockOpenPolicyFinderService.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa; +package org.dspace.app.openpolicyfinder; import java.io.IOException; import java.io.InputStream; @@ -13,30 +13,31 @@ import java.net.URISyntaxException; import java.util.Objects; -import org.dspace.app.sherpa.v2.SHERPAPublisherResponse; -import org.dspace.app.sherpa.v2.SHERPAResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderPublisherResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; /** - * Mock implementation for SHERPA API service (used by SHERPA submit service to check + * Mock implementation for Open Policy Finder API service (used by Open Policy Finder submit service to check * journal policies). - * This class will return mock SHERPA responses so they can be parsed and turned + * This class will return mock Open Policy Finder responses so they can be parsed and turned * into external data objects downstream. * * @author Kim Shepherd */ -public class MockSHERPAService extends SHERPAService { +public class MockOpenPolicyFinderService extends OpenPolicyFinderService { /** * Simple overridden performRequest so that we do attempt to build the URI but rather than make - * an actual HTTP call, return parsed SHERPAResponse for The Lancet based on known-good JSON stored with our + * an actual HTTP call, return parsed OpenPolicyFinderResponse for The Lancet based on known-good JSON stored with + * our * test resources. - * If URI creation, parsing, or IO fails along the way, a SHERPAResponse with an error message set will be + * If URI creation, parsing, or IO fails along the way, a OpenPolicyFinderResponse with an error message set will be * returned. * @param value a journal / publication name, or ID, etc. - * @return SHERPAResponse + * @return OpenPolicyFinderResponse */ @Override - public SHERPAResponse performRequest(String type, String field, String predicate, String value, + public OpenPolicyFinderResponse performRequest(String type, String field, String predicate, String value, int start, int limit) { try { String endpoint = configurationService.getProperty("openpolicyfinder.url", @@ -53,7 +54,7 @@ public SHERPAResponse performRequest(String type, String field, String predicate // in case a syntax exception is thrown URI uri = prepareQuery(value, endpoint, apiKey); if (uri == null) { - return new SHERPAResponse("Error building URI"); + return new OpenPolicyFinderResponse("Error building URI"); } // Get mock JSON @@ -64,11 +65,11 @@ public SHERPAResponse performRequest(String type, String field, String predicate } // Parse JSON input stream and return response for later evaluation - return new SHERPAResponse(content, SHERPAResponse.SHERPAFormat.JSON); + return new OpenPolicyFinderResponse(content, OpenPolicyFinderResponse.ResponseFormat.JSON); } catch (URISyntaxException e) { // This object will be marked as having an error for later evaluation - return new SHERPAResponse(e.getMessage()); + return new OpenPolicyFinderResponse(e.getMessage()); } finally { // Close input stream if (content != null) { @@ -77,7 +78,7 @@ public SHERPAResponse performRequest(String type, String field, String predicate } } catch (IOException e) { // This object will be marked as having an error for later evaluation - return new SHERPAResponse(e.getMessage()); + return new OpenPolicyFinderResponse(e.getMessage()); } } @@ -87,16 +88,17 @@ private InputStream getContent(String fileName) { /** * Simple overridden performPublisherRequest so that we do attempt to build the URI but rather than make - * an actual HTTP call, return parsed SHERPAPublisherResponse for PLOS based on known-good JSON stored with our - * test resources. - * If URI creation, parsing, or IO fails along the way, a SHERPAPublisherResponse with an error message set will be - * returned. + * an actual HTTP call, return parsed OpenPolicyFinderPublisherResponse for PLOS based on known-good JSON stored + * with our test resources. + * If URI creation, parsing, or IO fails along the way, a OpenPolicyFinderPublisherResponse with an error message + * set will be returned. * @param value a journal / publication name, or ID, etc. - * @return SHERPAResponse + * @return OpenPolicyFinderResponse */ @Override - public SHERPAPublisherResponse performPublisherRequest(String type, String field, String predicate, String value, - int start, int limit) { + public OpenPolicyFinderPublisherResponse performPublisherRequest(String type, String field, + String predicate, String value, + int start, int limit) { try { String endpoint = configurationService.getProperty("openpolicyfinder.url", configurationService.getProperty("sherpa.romeo.url", @@ -116,11 +118,12 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field content = getClass().getResourceAsStream("plos.json"); // Parse JSON input stream and return response for later evaluation - return new SHERPAPublisherResponse(content, SHERPAPublisherResponse.SHERPAFormat.JSON); + return new OpenPolicyFinderPublisherResponse(content, + OpenPolicyFinderPublisherResponse.ResponseFormat.JSON); } catch (URISyntaxException e) { // This object will be marked as having an error for later evaluation - return new SHERPAPublisherResponse(e.getMessage()); + return new OpenPolicyFinderPublisherResponse(e.getMessage()); } finally { // Close input stream if (content != null) { @@ -129,7 +132,7 @@ public SHERPAPublisherResponse performPublisherRequest(String type, String field } } catch (IOException e) { // This object will be marked as having an error for later evaluation - return new SHERPAPublisherResponse(e.getMessage()); + return new OpenPolicyFinderPublisherResponse(e.getMessage()); } } diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPADataProviderTest.java b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderDataProviderTest.java similarity index 83% rename from dspace-api/src/test/java/org/dspace/app/sherpa/SHERPADataProviderTest.java rename to dspace-api/src/test/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderDataProviderTest.java index f37d9469d12d..a063295810d1 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPADataProviderTest.java +++ b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderDataProviderTest.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa; +package org.dspace.app.openpolicyfinder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; @@ -31,17 +31,17 @@ /** * */ -public class SHERPADataProviderTest extends AbstractDSpaceTest { +public class OpenPolicyFinderDataProviderTest extends AbstractDSpaceTest { ExternalDataService externalDataService; - ExternalDataProvider sherpaJournalProvider; - ExternalDataProvider sherpaPublisherProvider; - ExternalDataProvider sherpaJournalIssnProvider; + ExternalDataProvider opfJournalProvider; + ExternalDataProvider opfPublisherProvider; + ExternalDataProvider opfJournalIssnProvider; private static final MetadataFieldRef TITLE_FIELD = new MetadataFieldRef("dc", "title", null); private static final MetadataFieldRef ISSN_FIELD = new MetadataFieldRef("creativeworkseries", "issn", null); - private static final MetadataFieldRef SHERPA_PUBLISHER_FIELD = - new MetadataFieldRef("dc", "identifier", "sherpaPublisher"); + private static final MetadataFieldRef OPF_PUBLISHER_FIELD = + new MetadataFieldRef("dc", "identifier", "opfPublisher"); private static final MetadataFieldRef OTHER_FIELD = new MetadataFieldRef("dc", "identifier", "other"); @BeforeClass @@ -56,10 +56,10 @@ public static void tearDownClass() { public void setUp() { // Set up External Service Factory and set data providers externalDataService = ExternalServiceFactory.getInstance().getExternalDataService(); - sherpaJournalProvider = externalDataService.getExternalDataProvider("sherpaJournal"); - sherpaPublisherProvider = externalDataService.getExternalDataProvider("sherpaPublisher"); - sherpaJournalIssnProvider = - externalDataService.getExternalDataProvider("sherpaJournalIssn"); + opfJournalProvider = externalDataService.getExternalDataProvider("opfJournal"); + opfPublisherProvider = externalDataService.getExternalDataProvider("opfPublisher"); + opfJournalIssnProvider = + externalDataService.getExternalDataProvider("opfJournalIssn"); } @After @@ -67,8 +67,8 @@ public void tearDown() { } /** - * Test searching the SHERPAv2JournalISSNProvider for an ISSN and inspect the returned data object - * The provider is configured to use the Mock SHERPAService. + * Test searching the OpenPolicyFinderJournalISSNDataProvider for an ISSN and inspect the returned data object + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testGetJournalISSNExternalObject() { @@ -81,7 +81,7 @@ public void testGetJournalISSNExternalObject() { String validIssn = "0140-6736"; String validName = "The Lancet"; - Optional externalDataObject = sherpaJournalIssnProvider.getExternalDataObject(validIssn); + Optional externalDataObject = opfJournalIssnProvider.getExternalDataObject(validIssn); // If data object isn't here, throw a resource not found exception ExternalDataObject dataObject = externalDataObject.orElseThrow( () -> new ResourceNotFoundException("Couldn't find a data object for ISSN " + validIssn)); @@ -105,8 +105,8 @@ public void testGetJournalISSNExternalObject() { } /** - * Test searching the SHERPAv2JournalISSNProvider for an ISSN and inspect the returned data object - * The provider is configured to use the Mock SHERPAService. + * Test searching the OpenPolicyFinderJournalISSNDataProvider for an ISSN and inspect the returned data object + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testSearchJournalISSNExternalObjects() { @@ -120,7 +120,7 @@ public void testSearchJournalISSNExternalObjects() { String validIssn = "0140-6736"; String validName = "The Lancet"; List externalDataObjects = - sherpaJournalIssnProvider.searchExternalDataObjects(validIssn, 0, 1); + opfJournalIssnProvider.searchExternalDataObjects(validIssn, 0, 1); // Assert that the response is valid and not empty assertTrue("Couldn't find a data object for publication name " + validName, @@ -151,8 +151,8 @@ public void testSearchJournalISSNExternalObjects() { } /** - * Test searching the SHERPAv2JournalProvider for a journal and inspect the returned data object - * The provider is configured to use the Mock SHERPAService. + * Test searching the OpenPolicyFinderJournalDataProvider for a journal and inspect the returned data object + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testGetJournalExternalObject() { @@ -165,7 +165,7 @@ public void testGetJournalExternalObject() { String validIssn = "0140-6736"; String validName = "The Lancet"; - Optional externalDataObject = sherpaJournalProvider.getExternalDataObject(validName); + Optional externalDataObject = opfJournalProvider.getExternalDataObject(validName); // If data object isn't here, throw a resource not found exception ExternalDataObject dataObject = externalDataObject.orElseThrow( () -> new ResourceNotFoundException("Couldn't find a data object for publication name " + validName)); @@ -189,8 +189,8 @@ public void testGetJournalExternalObject() { } /** - * Test searching the SHERPAv2JournalProvider for a journal and inspect the returned data object - * The provider is configured to use the Mock SHERPAService. + * Test searching the OpenPolicyFinderJournalDataProvider for a journal and inspect the returned data object + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testSearchJournalObjects() { @@ -205,7 +205,7 @@ public void testSearchJournalObjects() { String validIssn = "0140-6736"; String validName = "The Lancet"; List externalDataObjects = - sherpaJournalProvider.searchExternalDataObjects(validName, 0, 1); + opfJournalProvider.searchExternalDataObjects(validName, 0, 1); // Assert that the response is valid and not empty assertTrue("Couldn't find a data object for publication name " + validName, @@ -236,8 +236,8 @@ public void testSearchJournalObjects() { } /** - * Test searching the SHERPAv2JournalProvider for a journal and inspect the returned data object - * The provider is configured to use the Mock SHERPAService. + * Test searching the OpenPolicyFinderJournalDataProvider for a journal and inspect the returned data object + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testGetPublisherExternalObject() { @@ -245,7 +245,7 @@ public void testGetPublisherExternalObject() { // thelancet.json stored response in test resources // We expect to see the following values set correctly: // dc.title = Public Library of Science - // dc.identifier.sherpaPublisher 112 + // dc.identifier.opfPublisher 112 // dc.identifier.other http://www.plos.org/ // Set expected values @@ -254,7 +254,7 @@ public void testGetPublisherExternalObject() { String validUrl = "http://www.plos.org/"; // Retrieve the dataobject(s) from the data provider - Optional externalDataObject = sherpaPublisherProvider.getExternalDataObject(validName); + Optional externalDataObject = opfPublisherProvider.getExternalDataObject(validName); // If data object isn't here, throw a resource not found exception ExternalDataObject dataObject = externalDataObject.orElseThrow( () -> new ResourceNotFoundException("Couldn't find a data object for publication name " + validName)); @@ -266,7 +266,7 @@ public void testGetPublisherExternalObject() { for (MetadataValueDTO metadataValue : dataObject.getMetadata()) { if (TITLE_FIELD.matches(metadataValue)) { title = metadataValue.getValue(); - } else if (SHERPA_PUBLISHER_FIELD.matches(metadataValue)) { + } else if (OPF_PUBLISHER_FIELD.matches(metadataValue)) { identifier = metadataValue.getValue(); } else if (OTHER_FIELD.matches(metadataValue)) { url = metadataValue.getValue(); @@ -276,7 +276,7 @@ public void testGetPublisherExternalObject() { // Does dc.title match the expected value? assertEquals("Title metadata must equal '" + validName + "' ", validName, title); - // Does dc.identifier.sherpaPublisher match the expected value? + // Does dc.identifier.opfPublisher match the expected value? assertEquals("Publisher ID must equal " + validIdentifier, validIdentifier, identifier); // Does dc.identifier.other match the expected value? @@ -284,8 +284,8 @@ public void testGetPublisherExternalObject() { } /** - * Test searching the SHERPAv2JournalProvider for a journal and inspect the returned data object - * The provider is configured to use the Mock SHERPAService. + * Test searching the OpenPolicyFinderJournalDataProvider for a journal and inspect the returned data object + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testSearchPublisherExternalObjects() { @@ -293,7 +293,7 @@ public void testSearchPublisherExternalObjects() { // thelancet.json stored response in test resources // We expect to see the following values set correctly: // dc.title = Public Library of Science - // dc.identifier.sherpaPublisher 112 + // dc.identifier.opfPublisher 112 // dc.identifier.other http://www.plos.org/ // Set expected values @@ -303,7 +303,7 @@ public void testSearchPublisherExternalObjects() { // Retrieve the dataobject(s) from the data provider List externalDataObjects = - sherpaPublisherProvider.searchExternalDataObjects(validName, 0, 1); + opfPublisherProvider.searchExternalDataObjects(validName, 0, 1); // Assert that the response is valid and not empty assertTrue("Couldn't find a data object for publication name " + validName, @@ -321,7 +321,7 @@ public void testSearchPublisherExternalObjects() { for (MetadataValueDTO metadataValue : dataObject.getMetadata()) { if (TITLE_FIELD.matches(metadataValue)) { title = metadataValue.getValue(); - } else if (SHERPA_PUBLISHER_FIELD.matches(metadataValue)) { + } else if (OPF_PUBLISHER_FIELD.matches(metadataValue)) { identifier = metadataValue.getValue(); } else if (OTHER_FIELD.matches(metadataValue)) { url = metadataValue.getValue(); @@ -331,7 +331,7 @@ public void testSearchPublisherExternalObjects() { // Does dc.title match the expected value? assertEquals("Title metadata must equal '" + validName + "' ", validName, title); - // Does dc.identifier.sherpaPublisher match the expected value? + // Does dc.identifier.opfPublisher match the expected value? assertEquals("Publisher ID must equal " + validIdentifier, validIdentifier, identifier); // Does dc.identifier.other match the expected value? @@ -342,7 +342,7 @@ public void testSearchPublisherExternalObjects() { * Perform the same essential test as prior, but making sure the new comparator and equals methods * in MetadataValueDTO and ExternalDataObject properly compare objects (even when DTO values are not strictly * in the same order) - * The provider is configured to use the Mock SHERPAService. + * The provider is configured to use the Mock OpenPolicyFinderService. */ @Test public void testComparePublisherExternalObjects() { @@ -350,7 +350,7 @@ public void testComparePublisherExternalObjects() { // thelancet.json stored response in test resources // We expect to see the following values set correctly: // dc.title = Public Library of Science - // dc.identifier.sherpaPublisher 112 + // dc.identifier.opfPublisher 112 // dc.identifier.other http://www.plos.org/ // Set expected values @@ -360,39 +360,39 @@ public void testComparePublisherExternalObjects() { // First exemplar object should be identical ExternalDataObject exemplarDataObject = new ExternalDataObject(); - exemplarDataObject.setSource("sherpaPublisher"); + exemplarDataObject.setSource("opfPublisher"); exemplarDataObject.setId(validIdentifier); exemplarDataObject.setValue(validName); exemplarDataObject.setDisplayValue(validName); exemplarDataObject.addMetadata(TITLE_FIELD.toMetadata(validName)); - exemplarDataObject.addMetadata(SHERPA_PUBLISHER_FIELD.toMetadata(validIdentifier)); + exemplarDataObject.addMetadata(OPF_PUBLISHER_FIELD.toMetadata(validIdentifier)); exemplarDataObject.addMetadata(OTHER_FIELD.toMetadata(validUrl)); // Exemplar object 2 has a different order of metadata values // (we still expect it to be 'equal' when comparing since there is no concept of place for DTOs) ExternalDataObject exemplarDataObject2 = new ExternalDataObject(); - exemplarDataObject2.setSource("sherpaPublisher"); + exemplarDataObject2.setSource("opfPublisher"); exemplarDataObject2.setId(validIdentifier); exemplarDataObject2.setValue(validName); exemplarDataObject2.setDisplayValue(validName); exemplarDataObject2.addMetadata(OTHER_FIELD.toMetadata(validUrl)); exemplarDataObject2.addMetadata(TITLE_FIELD.toMetadata(validName)); - exemplarDataObject2.addMetadata(SHERPA_PUBLISHER_FIELD.toMetadata(validIdentifier)); + exemplarDataObject2.addMetadata(OPF_PUBLISHER_FIELD.toMetadata(validIdentifier)); // Nonequal object should NOT evaluate as equal to our data ExternalDataObject nonEqualObject = new ExternalDataObject(); - nonEqualObject.setSource("sherpaPublisher"); + nonEqualObject.setSource("opfPublisher"); nonEqualObject.setId(validIdentifier); nonEqualObject.setValue(validName); nonEqualObject.setDisplayValue(validName); nonEqualObject.addMetadata(TITLE_FIELD.toMetadata("Private Library of Science")); - nonEqualObject.addMetadata(SHERPA_PUBLISHER_FIELD.toMetadata(validIdentifier)); + nonEqualObject.addMetadata(OPF_PUBLISHER_FIELD.toMetadata(validIdentifier)); nonEqualObject.addMetadata(OTHER_FIELD.toMetadata(validUrl)); // Retrieve the dataobject(s) from the data provider List externalDataObjects = - sherpaPublisherProvider.searchExternalDataObjects(validName, 0, 1); + opfPublisherProvider.searchExternalDataObjects(validName, 0, 1); // Assert that the response is valid and not empty assertTrue("Couldn't find a data object for publication name " + validName, diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderServiceTest.java similarity index 82% rename from dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java rename to dspace-api/src/test/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderServiceTest.java index dde41ebcfa0a..dce78044cea3 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/SHERPAServiceTest.java +++ b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderServiceTest.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa; +package org.dspace.app.openpolicyfinder; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; @@ -19,9 +19,9 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.http.client.utils.URIBuilder; import org.dspace.AbstractDSpaceTest; -import org.dspace.app.sherpa.v2.SHERPAPublisherResponse; -import org.dspace.app.sherpa.v2.SHERPAResponse; -import org.dspace.app.sherpa.v2.SHERPAUtils; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderPublisherResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderUtils; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; import org.junit.After; @@ -31,21 +31,23 @@ import org.junit.Test; /** - * Integration tests for SHERPA service + * Integration tests for Open Policy Finder service * @author Kim Shepherd - * @see MockSHERPAService + * @see MockOpenPolicyFinderService */ -public class SHERPAServiceTest extends AbstractDSpaceTest { +public class OpenPolicyFinderServiceTest extends AbstractDSpaceTest { protected ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); - // Spring SHERPA service. For testing purposes, this will use a mock service + // Spring Open Policy Finder service. For testing purposes, this will use a mock service // that doesn't perform actual HTTP queries but does construct URIs // and returns a valid response (The Lancet) if no other errors are encountered - protected SHERPAService sherpaService = DSpaceServicesFactory.getInstance().getServiceManager() - .getServiceByName("org.dspace.app.sherpa.MockSHERPAService", MockSHERPAService.class); + protected OpenPolicyFinderService openPolicyFinderService = DSpaceServicesFactory.getInstance() + .getServiceManager().getServiceByName( + "org.dspace.app.openpolicyfinder.MockOpenPolicyFinderService", + MockOpenPolicyFinderService.class); - public SHERPAServiceTest() { + public OpenPolicyFinderServiceTest() { } @@ -66,23 +68,23 @@ public void tearDown() { } /** - * Test searching by Journal ISSN directly against SHERPA service + * Test searching by Journal ISSN directly against Open Policy Finder service */ @Test public void testSearchByJournalISSN() { // Get a response with a single valid ISSN, using the mock service which will return a response based on // thelancet.json stored response in test resources String validISSN = "0140-6736"; - SHERPAResponse sherpaResponse = sherpaService.searchByJournalISSN(validISSN); + OpenPolicyFinderResponse opfResponse = openPolicyFinderService.searchByJournalISSN(validISSN); // This response should NOT contain an error (isError() should be false) - assertFalse("Response contained an error flag / message: " + sherpaResponse.getMessage(), - sherpaResponse.isError()); + assertFalse("Response contained an error flag / message: " + opfResponse.getMessage(), + opfResponse.isError()); // This response should contain a single journal called The Lancet String expectedTitle = "The Lancet"; assertTrue("Response did not contain a journal with the expected title '" + expectedTitle + '"', - expectedTitle.equals(sherpaResponse.getJournals().get(0).getTitles().get(0))); + expectedTitle.equals(opfResponse.getJournals().get(0).getTitles().get(0))); } /** @@ -105,13 +107,13 @@ public void testUriConstruction() throws URISyntaxException, UnsupportedEncoding // Characters like { and } that conflict with JSON should be stripped from the filter query assertEquals("JSON filter query sanitisation not stripping special characters", - "TEST", SHERPAUtils.sanitiseQuery(invalidISSN)); + "TEST", OpenPolicyFinderUtils.sanitiseQuery(invalidISSN)); // The valid string should look like this (assuming default configuration) // https://api.openpolicyfinder.jisc.ac.uk/retrieve?item-type=publication&...&format=Json String validUrl = new URIBuilder(buildUrlString(validISSN, endpoint)).toString(); assertEquals("Built and expected valid URLs differ", validUrl, - sherpaService.constructHttpGet("publication", "issn", "equals", validISSN) + openPolicyFinderService.constructHttpGet("publication", "issn", "equals", validISSN) .getURI().toASCIIString()); // The invalid string should look like this (assuming default configuration) @@ -120,7 +122,7 @@ public void testUriConstruction() throws URISyntaxException, UnsupportedEncoding // query, though they do sanitise it for the JSON input type, hence expecting the braces to be stripped String invalidUrl = new URIBuilder(buildUrlString(invalidISSN, endpoint)).toString(); assertEquals("Built and expected invalid URLs differ", invalidUrl, - sherpaService.constructHttpGet("publication", "issn", "equals", invalidISSN) + openPolicyFinderService.constructHttpGet("publication", "issn", "equals", invalidISSN) .getURI().toASCIIString()); @@ -130,19 +132,19 @@ public void testUriConstruction() throws URISyntaxException, UnsupportedEncoding // a fatal URI syntax exception (the remote call does work, and returns 0 items as valid JSON) String nullUrl = new URIBuilder(buildUrlString(null, endpoint)).toString(); assertEquals("Built and expected invalid URLs differ", nullUrl, - sherpaService.constructHttpGet("publication", "issn", "equals", null) + openPolicyFinderService.constructHttpGet("publication", "issn", "equals", null) .getURI().toASCIIString()); } /** - * Thorough test of returned SHERPAResponse object to ensure all expected fields are there and valid + * Thorough test of returned OpenPolicyFinderResponse object to ensure all expected fields are there and valid */ @Test public void testJournalResponse() { // Valid ISSN (The Lancet) String validISSN = "0140-6736"; - SHERPAResponse response = sherpaService.searchByJournalISSN(validISSN); + OpenPolicyFinderResponse response = openPolicyFinderService.searchByJournalISSN(validISSN); // Assert response is not error, or fail with message assertFalse("Response was flagged as 'isError'", response.isError()); @@ -181,13 +183,14 @@ public void testJournalResponse() { } /** - * Thorough test of returned SHERPAPublisherResponse object to ensure all expected fields are there and valid + * Thorough test of returned OpenPolicyFinderPublisherResponse object to ensure all expected fields are there + * and valid */ @Test public void testPublisherResponse() { // Set up basic query and query the (mock) service String publisherName = "Public Library of Science"; - SHERPAPublisherResponse response = sherpaService.performPublisherRequest( + OpenPolicyFinderPublisherResponse response = openPolicyFinderService.performPublisherRequest( "publisher", "name", "equals", publisherName, 0, 1); // Assert response is not error, or fail with message @@ -221,7 +224,7 @@ public void testPublisherResponse() { * @return */ public static String buildUrlString(String query, String endpoint) { - query = SHERPAUtils.sanitiseQuery(query); + query = OpenPolicyFinderUtils.sanitiseQuery(query); StringBuilder expected = new StringBuilder(); String filter = "[[\"issn\",\"equals\",\"" + query + "\"]]"; expected.append(endpoint).append("?") diff --git a/dspace-api/src/test/java/org/dspace/app/sherpa/submit/SHERPASubmitServiceTest.java b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitServiceTest.java similarity index 82% rename from dspace-api/src/test/java/org/dspace/app/sherpa/submit/SHERPASubmitServiceTest.java rename to dspace-api/src/test/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitServiceTest.java index 438d754aa5f2..e5ebdf485cd5 100644 --- a/dspace-api/src/test/java/org/dspace/app/sherpa/submit/SHERPASubmitServiceTest.java +++ b/dspace-api/src/test/java/org/dspace/app/openpolicyfinder/submit/OpenPolicyFinderSubmitServiceTest.java @@ -5,7 +5,7 @@ * * http://www.dspace.org/license/ */ -package org.dspace.app.sherpa.submit; +package org.dspace.app.openpolicyfinder.submit; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -13,7 +13,7 @@ import java.sql.SQLException; import org.dspace.AbstractUnitTest; -import org.dspace.app.sherpa.v2.SHERPAResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; import org.dspace.authorize.AuthorizeException; import org.dspace.content.Collection; import org.dspace.content.Community; @@ -38,10 +38,10 @@ import org.junit.Test; /** - * SHERPASubmitServiceTest creates a dummy item with an ISSN in its metadata, and makes sure - * that the ISSN is detected and passed to SHERPAService for a mock query + * OpenPolicyFinderSubmitServiceTest creates a dummy item with an ISSN in its metadata, and makes sure + * that the ISSN is detected and passed to OpenPolicyFinderService for a mock query */ -public class SHERPASubmitServiceTest extends AbstractUnitTest { +public class OpenPolicyFinderSubmitServiceTest extends AbstractUnitTest { // Set up services protected ItemService itemService = ContentServiceFactory.getInstance().getItemService(); @@ -51,8 +51,9 @@ public class SHERPASubmitServiceTest extends AbstractUnitTest { protected CollectionService collectionService = ContentServiceFactory.getInstance().getCollectionService(); protected MetadataFieldService metadataFieldService = ContentServiceFactory.getInstance().getMetadataFieldService(); protected MetadataValueService metadataValueService = ContentServiceFactory.getInstance().getMetadataValueService(); - SHERPASubmitService sherpaSubmitService = DSpaceServicesFactory.getInstance().getServiceManager() - .getServiceByName("org.dspace.app.sherpa.submit.SHERPASubmitService", SHERPASubmitService.class); + OpenPolicyFinderSubmitService opfSubmitService = DSpaceServicesFactory.getInstance().getServiceManager() + .getServiceByName("org.dspace.app.openpolicyfinder.submit.OpenPolicyFinderSubmitService", + OpenPolicyFinderSubmitService.class); Collection testCollection = null; Community testCommunity = null; @@ -106,9 +107,9 @@ public void testGetISSNs() throws AuthorizeException, SQLException { MetadataValue metadataValue = metadataValueService.create(context, testItem, issnField); metadataValue.setValue(validISSN); - // Get responses from SHERPA submit service, which should inspect item ISSNs and perform search - // on the mock SHERPA service - SHERPAResponse response = sherpaSubmitService.searchRelatedJournals(context, testItem); + // Get responses from Open Policy Finder submit service, which should inspect item ISSNs and perform search + // on the mock Open Policy Finder service + OpenPolicyFinderResponse response = opfSubmitService.searchRelatedJournals(context, testItem); // Make sure response is not null or empty assertTrue("Response should not be null", response != null); @@ -119,7 +120,7 @@ public void testGetISSNs() throws AuthorizeException, SQLException { // Assert response is not error, or fail with message assertFalse("Response was flagged as 'isError'", response.isError()); - // Skip remainder of parsing tests - these are already done in SHERPAServiceTEst + // Skip remainder of parsing tests - these are already done in OpenPolicyFinderServiceTEst } } diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/0000-0000.json b/dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/0000-0000.json similarity index 100% rename from dspace-api/src/test/resources/org/dspace/app/sherpa/0000-0000.json rename to dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/0000-0000.json diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/2731-0582.json b/dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/2731-0582.json similarity index 100% rename from dspace-api/src/test/resources/org/dspace/app/sherpa/2731-0582.json rename to dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/2731-0582.json diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/plos.json b/dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/plos.json similarity index 100% rename from dspace-api/src/test/resources/org/dspace/app/sherpa/plos.json rename to dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/plos.json diff --git a/dspace-api/src/test/resources/org/dspace/app/sherpa/thelancet.json b/dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/thelancet.json similarity index 100% rename from dspace-api/src/test/resources/org/dspace/app/sherpa/thelancet.json rename to dspace-api/src/test/resources/org/dspace/app/openpolicyfinder/thelancet.json diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/SherpaPolicy.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/OpenPolicyFinderPolicy.java similarity index 55% rename from dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/SherpaPolicy.java rename to dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/OpenPolicyFinderPolicy.java index 1f6bd07c2af1..08e0e9441498 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/SherpaPolicy.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/step/OpenPolicyFinderPolicy.java @@ -9,20 +9,20 @@ import java.util.Date; -import org.dspace.app.sherpa.v2.SHERPAResponse; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; /** - * Java Bean to expose Sherpa policies during in progress submission. + * Java Bean to expose Open Policy Finder policies during in progress submission. * * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) */ -public class SherpaPolicy implements SectionData { +public class OpenPolicyFinderPolicy implements SectionData { private static final long serialVersionUID = 2440249335255683173L; private Date retrievalTime; - private SHERPAResponse sherpaResponse; + private OpenPolicyFinderResponse opfResponse; public Date getRetrievalTime() { return retrievalTime; @@ -32,17 +32,17 @@ public void setRetrievalTime(Date retrievalTime) { this.retrievalTime = retrievalTime; } - public SHERPAResponse getSherpaResponse() { - return sherpaResponse; + public OpenPolicyFinderResponse getOpfResponse() { + return opfResponse; } /** - * Setting a sherpaResponse will automatically set the retrievealTime + * Setting a opfResponse will automatically set the retrievealTime * of the section copying the value from the response if not null */ - public void setSherpaResponse(SHERPAResponse sherpaResponse) { - this.sherpaResponse = sherpaResponse; - this.retrievalTime = sherpaResponse.getRetrievalTime(); + public void setOpfResponse(OpenPolicyFinderResponse opfResponse) { + this.opfResponse = opfResponse; + this.retrievalTime = opfResponse.getRetrievalTime(); } } \ No newline at end of file diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/OpenPolicyFinderPolicyStep.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/OpenPolicyFinderPolicyStep.java new file mode 100644 index 000000000000..cf89feb26111 --- /dev/null +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/OpenPolicyFinderPolicyStep.java @@ -0,0 +1,64 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.app.rest.submit.step; + +import java.util.Objects; + +import jakarta.servlet.http.HttpServletRequest; +import org.dspace.app.openpolicyfinder.cache.OpenPolicyFinderCacheEvictService; +import org.dspace.app.openpolicyfinder.submit.OpenPolicyFinderSubmitService; +import org.dspace.app.openpolicyfinder.v2.OpenPolicyFinderResponse; +import org.dspace.app.rest.model.patch.Operation; +import org.dspace.app.rest.model.step.OpenPolicyFinderPolicy; +import org.dspace.app.rest.submit.AbstractProcessingStep; +import org.dspace.app.rest.submit.SubmissionService; +import org.dspace.app.util.SubmissionStepConfig; +import org.dspace.content.InProgressSubmission; +import org.dspace.core.Context; +import org.dspace.utils.DSpace; +import org.dspace.web.ContextUtil; + +/** + * OpenPolicyFinderPolicy step for DSpace Spring Rest. Expose information about + * the Open Policy Finder policies for the in progress submission. + * + * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) + */ +public class OpenPolicyFinderPolicyStep extends AbstractProcessingStep { + + public static final String RETRIEVAL_TIME = "retrievalTime"; + + private OpenPolicyFinderCacheEvictService opfCacheEvictService = new DSpace().getSingletonService( + OpenPolicyFinderCacheEvictService.class); + private OpenPolicyFinderSubmitService opfSubmitService = + new DSpace().getSingletonService(OpenPolicyFinderSubmitService.class); + + @Override + @SuppressWarnings("unchecked") + public OpenPolicyFinderPolicy getData(SubmissionService submissionService, InProgressSubmission obj, + SubmissionStepConfig config) throws Exception { + Context context = ContextUtil.obtainCurrentRequestContext(); + OpenPolicyFinderResponse response = opfSubmitService.searchRelatedJournals(context, obj.getItem()); + if (Objects.nonNull(response)) { + OpenPolicyFinderPolicy result = new OpenPolicyFinderPolicy(); + result.setOpfResponse(response); + return result; + } + return null; + } + + @Override + public void doPatchProcessing(Context context, HttpServletRequest currentRequest, InProgressSubmission source, + Operation op, SubmissionStepConfig stepConf) throws Exception { + String path = op.getPath(); + if (path.contains(RETRIEVAL_TIME)) { + opfCacheEvictService.evictCacheValues(context, source.getItem()); + } + } + +} \ No newline at end of file diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/SherpaPolicyStep.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/SherpaPolicyStep.java deleted file mode 100644 index 206b3fab5974..000000000000 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/submit/step/SherpaPolicyStep.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * The contents of this file are subject to the license and copyright - * detailed in the LICENSE and NOTICE files at the root of the source - * tree and available online at - * - * http://www.dspace.org/license/ - */ -package org.dspace.app.rest.submit.step; - -import java.util.Objects; - -import jakarta.servlet.http.HttpServletRequest; -import org.dspace.app.rest.model.patch.Operation; -import org.dspace.app.rest.model.step.SherpaPolicy; -import org.dspace.app.rest.submit.AbstractProcessingStep; -import org.dspace.app.rest.submit.SubmissionService; -import org.dspace.app.sherpa.cache.SherpaCacheEvictService; -import org.dspace.app.sherpa.submit.SHERPASubmitService; -import org.dspace.app.sherpa.v2.SHERPAResponse; -import org.dspace.app.util.SubmissionStepConfig; -import org.dspace.content.InProgressSubmission; -import org.dspace.core.Context; -import org.dspace.utils.DSpace; -import org.dspace.web.ContextUtil; - -/** - * SherpaPolicy step for DSpace Spring Rest. Expose information about - * the Sherpa policies for the in progress submission. - * - * @author Mykhaylo Boychuk (mykhaylo.boychuk at 4science.com) - */ -public class SherpaPolicyStep extends AbstractProcessingStep { - - public static final String SHERPA_RETRIEVAL_TIME = "retrievalTime"; - - private SherpaCacheEvictService sherpaCacheEvictService = new DSpace().getSingletonService( - SherpaCacheEvictService.class); - private SHERPASubmitService sherpaSubmitService = new DSpace().getSingletonService(SHERPASubmitService.class); - - @Override - @SuppressWarnings("unchecked") - public SherpaPolicy getData(SubmissionService submissionService, InProgressSubmission obj, - SubmissionStepConfig config) throws Exception { - Context context = ContextUtil.obtainCurrentRequestContext(); - SHERPAResponse response = sherpaSubmitService.searchRelatedJournals(context, obj.getItem()); - if (Objects.nonNull(response)) { - SherpaPolicy result = new SherpaPolicy(); - result.setSherpaResponse(response); - return result; - } - return null; - } - - @Override - public void doPatchProcessing(Context context, HttpServletRequest currentRequest, InProgressSubmission source, - Operation op, SubmissionStepConfig stepConf) throws Exception { - String path = op.getPath(); - if (path.contains(SHERPA_RETRIEVAL_TIME)) { - sherpaCacheEvictService.evictCacheValues(context, source.getItem()); - } - } - -} \ No newline at end of file diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java index 55cc99567f59..cf9d91b84b8b 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java @@ -44,11 +44,11 @@ public void findAllExternalSources() throws Exception { ExternalSourceMatcher.matchExternalSource("suggestion", "suggestion", false), ExternalSourceMatcher.matchExternalSource("scopus", "scopus", false), ExternalSourceMatcher.matchExternalSource( - "sherpaJournalIssn", "sherpaJournalIssn", false), + "opfJournalIssn", "opfJournalIssn", false), ExternalSourceMatcher.matchExternalSource( - "sherpaJournal", "sherpaJournal", false), + "opfJournal", "opfJournal", false), ExternalSourceMatcher.matchExternalSource( - "sherpaPublisher", "sherpaPublisher", false), + "opfPublisher", "opfPublisher", false), ExternalSourceMatcher.matchExternalSource( "pubmed", "pubmed", false), ExternalSourceMatcher.matchExternalSource( diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyRestRepositoryIT.java index 7a3bc738eb66..356ca9fe9900 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/VocabularyRestRepositoryIT.java @@ -73,8 +73,8 @@ public void setup() throws Exception { configurationService.setProperty("plugin.named.org.dspace.content.authority.ChoiceAuthority", new String[] { "org.dspace.content.authority.SolrAuthority = SolrAuthorAuthority", - "org.dspace.content.authority.SHERPARoMEOPublisher = SRPublisher", - "org.dspace.content.authority.SHERPARoMEOJournalTitle = SRJournalTitle" + "org.dspace.content.authority.OpenPolicyFinderPublisherAuthority = SRPublisher", + "org.dspace.content.authority.OpenPolicyFinderJournalTitle = SRJournalTitle" }); configurationService.setProperty("solr.authority.server", @@ -364,7 +364,7 @@ public void noResultsSolrQueryTest() throws Exception { } @Test - public void sherpaJournalTest() throws Exception { + public void opfJournalTest() throws Exception { String token = getAuthToken(admin.getEmail(), password); getClient(token).perform( get("/api/submission/vocabularies/SRJournalTitle/entries") @@ -380,7 +380,7 @@ public void sherpaJournalTest() throws Exception { } @Test - public void sherpaPublisherTest() throws Exception { + public void opfPublisherTest() throws Exception { String token = getAuthToken(admin.getEmail(), password); getClient(token).perform( get("/api/submission/vocabularies/SRPublisher/entries") diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java index 24a389dcaf69..fb07ad843913 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/WorkspaceItemRestRepositoryIT.java @@ -8133,7 +8133,7 @@ public void verifyUnconfiguredBitstreamPolicyIsDeniedTest() throws Exception { } @Test - public void sherpaPolicySectionCacheTest() throws Exception { + public void opfPolicySectionCacheTest() throws Exception { context.turnOffAuthorisationSystem(); String dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"; @@ -8161,15 +8161,15 @@ public void sherpaPolicySectionCacheTest() throws Exception { getClient(token).perform(get("/api/submission/workspaceitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(false))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(false))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].titles[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].titles[0]", is("Nature Synthesis"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].issns[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].issns[0]", is("2731-0582"))))) .andDo(result -> retrievalTime.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); Date date = new SimpleDateFormat(dateFormat).parse(retrievalTime.get()); @@ -8177,15 +8177,15 @@ public void sherpaPolicySectionCacheTest() throws Exception { getClient(token).perform(get("/api/submission/workspaceitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(false))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(false))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].titles[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].titles[0]", is("Nature Synthesis"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].issns[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].issns[0]", is("2731-0582"))))) .andDo(result -> retrievalTime2.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); Date date2 = new SimpleDateFormat(dateFormat).parse(retrievalTime2.get()); @@ -8193,7 +8193,7 @@ public void sherpaPolicySectionCacheTest() throws Exception { // create a list of values to use in add operation List operations = new ArrayList<>(); - operations.add(new RemoveOperation("/sections/sherpaPolicies/retrievalTime")); + operations.add(new RemoveOperation("/sections/opfPolicies/retrievalTime")); // empty the cache and verify the retrivatTime String patchBody = getPatchContent(operations); @@ -8202,15 +8202,15 @@ public void sherpaPolicySectionCacheTest() throws Exception { .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(false))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(false))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].titles[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].titles[0]", is("Nature Synthesis"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].issns[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].issns[0]", is("2731-0582"))))) .andDo(result -> retrievalTime.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); date = new SimpleDateFormat(dateFormat).parse(retrievalTime.get()); @@ -8220,22 +8220,22 @@ public void sherpaPolicySectionCacheTest() throws Exception { getClient(token).perform(get("/api/submission/workspaceitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(false))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(false))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].titles[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].titles[0]", is("Nature Synthesis"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals[0].issns[0]", + hasJsonPath("$.sections.opfPolicies.opfResponse.journals[0].issns[0]", is("2731-0582"))))) .andDo(result -> retrievalTime2.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); date2 = new SimpleDateFormat(dateFormat).parse(retrievalTime2.get()); assertTrue(date.equals(date2)); } @Test - public void sherpaPolicySectionWithWrongIssnCacheTest() throws Exception { + public void opfPolicySectionWithWrongIssnCacheTest() throws Exception { context.turnOffAuthorisationSystem(); String dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"; @@ -8263,13 +8263,13 @@ public void sherpaPolicySectionWithWrongIssnCacheTest() throws Exception { getClient(token).perform(get("/api/submission/workspaceitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(true))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(true))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.message", is("No results found"))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.message", is("No results found"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals", nullValue())))) + hasJsonPath("$.sections.opfPolicies.opfResponse.journals", nullValue())))) .andDo(result -> retrievalTime.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); Date date = new SimpleDateFormat(dateFormat).parse(retrievalTime.get()); @@ -8277,13 +8277,13 @@ public void sherpaPolicySectionWithWrongIssnCacheTest() throws Exception { getClient(token).perform(get("/api/submission/workspaceitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(true))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(true))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.message", is("No results found"))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.message", is("No results found"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals", nullValue())))) + hasJsonPath("$.sections.opfPolicies.opfResponse.journals", nullValue())))) .andDo(result -> retrievalTime2.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); Date date2 = new SimpleDateFormat(dateFormat).parse(retrievalTime2.get()); @@ -8291,7 +8291,7 @@ public void sherpaPolicySectionWithWrongIssnCacheTest() throws Exception { // create a list of values to use in add operation List operations = new ArrayList<>(); - operations.add(new RemoveOperation("/sections/sherpaPolicies/retrievalTime")); + operations.add(new RemoveOperation("/sections/opfPolicies/retrievalTime")); // empty the cache and verify the retrivatTime String patchBody = getPatchContent(operations); @@ -8300,13 +8300,13 @@ public void sherpaPolicySectionWithWrongIssnCacheTest() throws Exception { .contentType(MediaType.APPLICATION_JSON_PATCH_JSON)) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(true))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(true))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.message", is("No results found"))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.message", is("No results found"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals", nullValue())))) + hasJsonPath("$.sections.opfPolicies.opfResponse.journals", nullValue())))) .andDo(result -> retrievalTime.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); date = new SimpleDateFormat(dateFormat).parse(retrievalTime.get()); @@ -8316,13 +8316,13 @@ public void sherpaPolicySectionWithWrongIssnCacheTest() throws Exception { getClient(token).perform(get("/api/submission/workspaceitems/" + witem.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.error", is(true))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.error", is(true))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.message", is("No results found"))))) + hasJsonPath("$.sections.opfPolicies.opfResponse.message", is("No results found"))))) .andExpect(jsonPath("$", Matchers.allOf( - hasJsonPath("$.sections.sherpaPolicies.sherpaResponse.journals", nullValue())))) + hasJsonPath("$.sections.opfPolicies.opfResponse.journals", nullValue())))) .andDo(result -> retrievalTime2.set(read( - result.getResponse().getContentAsString(), "$.sections.sherpaPolicies.retrievalTime"))); + result.getResponse().getContentAsString(), "$.sections.opfPolicies.retrievalTime"))); date2 = new SimpleDateFormat(dateFormat).parse(retrievalTime2.get()); assertTrue(date.equals(date2)); diff --git a/dspace/config/ehcache.xml b/dspace/config/ehcache.xml index 41508a5fa826..b5430d0723a2 100644 --- a/dspace/config/ehcache.xml +++ b/dspace/config/ehcache.xml @@ -44,10 +44,10 @@ 4 - + - org.dspace.app.sherpa.cache.SherpaCacheLogger + org.dspace.app.openpolicyfinder.cache.OpenPolicyFinderCacheLogger ASYNCHRONOUS UNORDERED CREATED @@ -64,6 +64,6 @@ - + \ No newline at end of file diff --git a/dspace/config/item-submission.xml b/dspace/config/item-submission.xml index 42b8c4f950d0..e0d2ebd3ce09 100644 --- a/dspace/config/item-submission.xml +++ b/dspace/config/item-submission.xml @@ -228,10 +228,10 @@ sample - - submit.progressbar.sherpapolicy - org.dspace.app.rest.submit.step.SherpaPolicyStep - sherpaPolicy + + submit.progressbar.opfpolicy + org.dspace.app.rest.submit.step.OpenPolicyFinderPolicyStep + opfPolicy @@ -288,8 +288,8 @@ - - + + - - - + + + + - + Journal - - - - + + + + @@ -247,10 +247,10 @@ - - - - + + + + diff --git a/dspace/config/spring/api/sherpa.xml b/dspace/config/spring/api/openpolicyfinder.xml similarity index 63% rename from dspace/config/spring/api/sherpa.xml rename to dspace/config/spring/api/openpolicyfinder.xml index b35a99874327..e8ce89affbcb 100644 --- a/dspace/config/spring/api/sherpa.xml +++ b/dspace/config/spring/api/openpolicyfinder.xml @@ -11,19 +11,19 @@ - + - + creativeworkseries.issn - @@ -42,8 +42,8 @@ - - + + diff --git a/dspace/config/submission-forms.xml b/dspace/config/submission-forms.xml index 102ff804568d..3074b3c3d02d 100644 --- a/dspace/config/submission-forms.xml +++ b/dspace/config/submission-forms.xml @@ -719,7 +719,7 @@ Select the journal related to this volume. - sherpaJournal + opfJournal From d112e02f6abcc1a65320f7608222f2c19ec4f267 Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Fri, 17 Apr 2026 19:16:01 +0200 Subject: [PATCH 095/283] Move Open Policy Finder config to external-providers.cfg Per review feedback on PR #12005: relocate openpolicyfinder.url and openpolicyfinder.apikey from dspace.cfg to dspace/config/modules/ external-providers.cfg, alongside Scopus, PubMed, CrossRef, DataCite, ROR and the other external-provider configuration blocks. No behaviour change: ConfigurationService loads both files. --- dspace/config/dspace.cfg | 11 ----------- dspace/config/modules/external-providers.cfg | 13 +++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index eee5d40ea817..d92a0e14feec 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -1439,17 +1439,6 @@ sitemap.dir = ${dspace.dir}/sitemaps # Keep in mind, changing the schedule requires rebooting your servlet container, e.g. Tomcat. sitemap.cron = 0 15 1 * * ? -##### Open Policy Finder Integration Settings #### -# (formerly SHERPA/RoMEO — legacy sherpa.romeo.* property names still work as fallback) - -# The Open Policy Finder API endpoint -openpolicyfinder.url = https://api.openpolicyfinder.jisc.ac.uk/retrieve - -# API key for the Open Policy Finder API -# Existing SHERPA/RoMEO API keys have been automatically migrated. -# For new keys, see: https://openpolicyfinder.jisc.ac.uk/help/developers -openpolicyfinder.apikey = - ##### Google Scholar Metadata Configuration ##### google-metadata.config = ${dspace.dir}/config/crosswalks/google-metadata.properties google-metadata.enable = true diff --git a/dspace/config/modules/external-providers.cfg b/dspace/config/modules/external-providers.cfg index cbb2b4ea0cbf..614527e7f61b 100644 --- a/dspace/config/modules/external-providers.cfg +++ b/dspace/config/modules/external-providers.cfg @@ -103,3 +103,16 @@ ror.orgunit-import.api-url = https://api.ror.org/v2/organizations # https://ror.readme.io/docs/client-id#how-to-register-a-client-id # ror.client-id = ################################################################# +#----------------- Jisc Open Policy Finder --------------------# +#---------------------------------------------------------------# +# (formerly SHERPA/RoMEO - legacy sherpa.romeo.* property names +# still work as fallback with a deprecation warning in the log) + +# The Open Policy Finder API endpoint +openpolicyfinder.url = https://api.openpolicyfinder.jisc.ac.uk/retrieve + +# API key for the Open Policy Finder API +# Existing SHERPA/RoMEO API keys have been automatically migrated. +# For new keys, see: https://openpolicyfinder.jisc.ac.uk/help/developers +openpolicyfinder.apikey = +################################################################# From a9d4f433d563fb0b41733790e2d0b401a98078b5 Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Fri, 13 Mar 2026 15:49:43 +0100 Subject: [PATCH 096/283] Fix race condition in LegacyPluginServiceImpl named plugin cache The namedPluginClasses HashMap was accessed concurrently without synchronization, causing spurious "Name collision in named plugin" errors and potential HashMap corruption under concurrent load. - Replace HashMap with ConcurrentHashMap for thread-safe reads - Add synchronized to configureNamedPlugin() to prevent double init - Use putIfAbsent() in installNamedConfigs() to eliminate check-then-put race Fixes: https://github.com/DSpace/DSpace/issues/12117 Co-Authored-By: Claude Opus 4.6 (cherry picked from commit 7bacc317d669f24e637dab624b1019d2b5a04a1b) --- .../java/org/dspace/core/LegacyPluginServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/core/LegacyPluginServiceImpl.java b/dspace-api/src/main/java/org/dspace/core/LegacyPluginServiceImpl.java index e92ea137f31f..e7c092e75c93 100644 --- a/dspace-api/src/main/java/org/dspace/core/LegacyPluginServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/core/LegacyPluginServiceImpl.java @@ -17,6 +17,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -219,10 +220,10 @@ private Object getAnonymousPlugin(String classname) // Map of named plugin classes, [intfc,name] -> class // Also contains intfc -> "marker" to mark when interface has been loaded. - private final Map namedPluginClasses = new HashMap<>(); + private final Map namedPluginClasses = new ConcurrentHashMap<>(); // load and cache configuration data for the given interface. - private void configureNamedPlugin(String iname) + private synchronized void configureNamedPlugin(String iname) throws ClassNotFoundException { int found = 0; @@ -307,11 +308,10 @@ private int installNamedConfigs(String iname, String classname, String names[]) int found = 0; for (int i = 0; i < names.length; ++i) { String key = iname + SEP + names[i]; - if (namedPluginClasses.containsKey(key)) { + String existing = namedPluginClasses.putIfAbsent(key, classname); + if (existing != null) { log.error("Name collision in named plugin, implementation class=\"" + classname + "\", name=\"" + names[i] + "\""); - } else { - namedPluginClasses.put(key, classname); } log.debug("Got Named Plugin, intfc=" + iname + ", name=" + names[i] + ", class=" + classname); ++found; From b0af037106020a8f46b0b5b7c2e8a4eab56de664 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 17 Apr 2026 16:32:32 -0500 Subject: [PATCH 097/283] Ensure docker-deploy waits for the backend to fully initialize before creating test content --- .github/workflows/docker.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 96a577bf3e3c..b1862ae2e209 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -204,8 +204,11 @@ jobs: sleep 10 docker container ls # Create a test admin account. Load test data from a simple set of AIPs as defined in cli.ingest.yml + # NOTE: Before creating test data, we wait for the backend to become responsive by requesting it every 10 sec. + # Timeout after 5 minutes. This is done to ensure the backend is fully initialized before we create test data. - name: Load test data into Backend run: | + timeout 5m wget --retry-connrefused -t 0 --waitretry=10 http://127.0.0.1:8080/server/api docker compose -f docker-compose-cli.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en docker compose -f docker-compose-cli.yml -f dspace/src/main/docker-compose/cli.ingest.yml run --rm dspace-cli # Verify backend started successfully. From 79a2de0a4c7e58147daa8caf2e15530fbed4ce34 Mon Sep 17 00:00:00 2001 From: Tina Schoenborn Date: Tue, 24 Feb 2026 17:34:22 +0100 Subject: [PATCH 098/283] add custom sql count query for signposting endpoint (cherry picked from commit e655bcf94746419288d97b50eebea1bdc6de66db) --- .../java/org/dspace/content/BundleServiceImpl.java | 4 ++++ .../main/java/org/dspace/content/dao/BundleDAO.java | 2 ++ .../org/dspace/content/dao/impl/BundleDAOImpl.java | 10 ++++++++++ .../java/org/dspace/content/service/BundleService.java | 8 ++++++++ .../signposting/service/impl/LinksetServiceImpl.java | 10 +++++++--- 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java index 3ba90c8cc2ae..8234846ed4f3 100644 --- a/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/BundleServiceImpl.java @@ -583,4 +583,8 @@ public Bundle findByLegacyId(Context context, int id) throws SQLException { public int countTotal(Context context) throws SQLException { return bundleDAO.countRows(context); } + + public int countBitstreams(Context context, Bundle bundle) throws SQLException { + return bundleDAO.countBitstreams(context, bundle); + } } diff --git a/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java b/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java index da7435d46643..99abd84eabc9 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/BundleDAO.java @@ -22,4 +22,6 @@ */ public interface BundleDAO extends DSpaceObjectLegacySupportDAO { int countRows(Context context) throws SQLException; + + int countBitstreams(Context context, Bundle bundle) throws SQLException; } diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java index 991636108495..ded13687aa7d 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java @@ -9,6 +9,7 @@ import java.sql.SQLException; +import jakarta.persistence.Query; import org.dspace.content.Bundle; import org.dspace.content.dao.BundleDAO; import org.dspace.core.AbstractHibernateDSODAO; @@ -31,4 +32,13 @@ protected BundleDAOImpl() { public int countRows(Context context) throws SQLException { return count(createQuery(context, "SELECT count(*) from Bundle")); } + + @Override + public int countBitstreams(Context context, Bundle bundle) throws SQLException { + Query query = createQuery( + context, "SELECT count(bi.id) from Bundle bu join bu.bitstreams bi where bu.id = :bundleID" + ); + query.setParameter("bundleID", bundle.getID()); + return count(query); + } } diff --git a/dspace-api/src/main/java/org/dspace/content/service/BundleService.java b/dspace-api/src/main/java/org/dspace/content/service/BundleService.java index 10d6613b2a22..31e0d79f4907 100644 --- a/dspace-api/src/main/java/org/dspace/content/service/BundleService.java +++ b/dspace-api/src/main/java/org/dspace/content/service/BundleService.java @@ -146,4 +146,12 @@ public void moveBitstreamToBundle(Context context, Bundle targetBundle, Bitstre public void setOrder(Context context, Bundle bundle, UUID bitstreamIds[]) throws AuthorizeException, SQLException; int countTotal(Context context) throws SQLException; + + /** + * Returns the count of bitstreams for the given bundle, performance optimized. + * + * @param context DSpace Context + * @param bundle the bitstream bundle + */ + int countBitstreams(Context context, Bundle bundle) throws SQLException; } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/service/impl/LinksetServiceImpl.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/service/impl/LinksetServiceImpl.java index 8ce992d1e883..a4434e14c369 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/service/impl/LinksetServiceImpl.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/signposting/service/impl/LinksetServiceImpl.java @@ -26,6 +26,7 @@ import org.dspace.content.Bundle; import org.dspace.content.DSpaceObject; import org.dspace.content.Item; +import org.dspace.content.service.BundleService; import org.dspace.content.service.ItemService; import org.dspace.core.Constants; import org.dspace.core.Context; @@ -48,6 +49,9 @@ public class LinksetServiceImpl implements LinksetService { @Autowired protected ItemService itemService; + @Autowired + protected BundleService bundleService; + @Autowired private BitstreamMetadataReadPermissionEvaluatorPlugin bitstreamMetadataReadPermissionEvaluatorPlugin; @@ -86,7 +90,7 @@ public List createLinksetNodesForSingleLinkset( List linksetNodes = new ArrayList<>(); if (object.getType() == Constants.ITEM) { - int itemBitstreamsCount = countItemBitstreams((Item) object); + int itemBitstreamsCount = countItemBitstreams(context, (Item) object); // Do not include individual bitstream typed links if their number exceeds // the limit in the configuration. @@ -170,12 +174,12 @@ private Iterator getItemBitstreams(Context context, Item item) { } } - private int countItemBitstreams(Item item) { + private int countItemBitstreams(Context context, Item item) { try { int countBitstreams = 0; List bundles = itemService.getBundles(item, Constants.DEFAULT_BUNDLE_NAME); for (Bundle bundle: bundles) { - countBitstreams += bundle.getBitstreams().size(); + countBitstreams += bundleService.countBitstreams(context, bundle); } return countBitstreams; } catch (SQLException e) { From 659e15545bfbeade13b1bb465e0fbf756f01b114 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 23 Apr 2026 14:02:54 -0500 Subject: [PATCH 099/283] Replace jakarta.persistence.Query with javax.persistence.Query --- .../main/java/org/dspace/content/dao/impl/BundleDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java index ded13687aa7d..08d6342e2671 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/BundleDAOImpl.java @@ -8,8 +8,8 @@ package org.dspace.content.dao.impl; import java.sql.SQLException; +import javax.persistence.Query; -import jakarta.persistence.Query; import org.dspace.content.Bundle; import org.dspace.content.dao.BundleDAO; import org.dspace.core.AbstractHibernateDSODAO; From 92b0bf8b17d9cfefadc7108de09a5532dd407c0c Mon Sep 17 00:00:00 2001 From: Francesco Pio Scognamiglio Date: Wed, 15 May 2024 10:39:44 +0200 Subject: [PATCH 100/283] [DURACOM-437] add the mime.types file due to a known issue on the external library iiif-apis (cherry picked from commit 99340f8a3f5d68605b026483811facd2c10f2ebf) (cherry picked from commit f30117ea76a2a12a34b5ad8fc02852dd5d04f225) --- .../additions/src/main/resources/mime.types | 1863 +++++++++++++++++ 1 file changed, 1863 insertions(+) create mode 100644 dspace/modules/additions/src/main/resources/mime.types diff --git a/dspace/modules/additions/src/main/resources/mime.types b/dspace/modules/additions/src/main/resources/mime.types new file mode 100644 index 000000000000..6707e7e794f4 --- /dev/null +++ b/dspace/modules/additions/src/main/resources/mime.types @@ -0,0 +1,1863 @@ +# The mime.types file comes from the iiif-apis library https://github.com/dbmdz/iiif-apis/blob/main/src/main/resources/mime.types. +# The mime.types file is protected by the MIT license defined here https://github.com/dbmdz/iiif-apis/blob/main/LICENSE. + +# Due to this issue https://github.com/dbmdz/iiif-apis/issues/270 +# The mime.types file has been added to the DSpace sources. +# The mime.types file can be removed as soon as the ticket is closed. + + +# This file maps Internet media types to unique file extension(s). +# Although created for httpd, this file is used by many software systems +# and has been placed in the public domain for unlimited redisribution. +# +# The table below contains both registered and (common) unregistered types. +# A type that has no unique extension can be ignored -- they are listed +# here to guide configurations toward known types and to make it easier to +# identify "new" types. File extensions are also commonly used to indicate +# content languages and encodings, so choose them carefully. +# +# Internet media types should be registered as described in RFC 4288. +# The registry is at . +# +# MIME type (lowercased) Extensions +# ============================================ ========== +# application/1d-interleaved-parityfec +# application/3gpdash-qoe-report+xml +# application/3gpp-ims+xml +# application/a2l +# application/activemessage +# application/alto-costmap+json +# application/alto-costmapfilter+json +# application/alto-directory+json +# application/alto-endpointcost+json +# application/alto-endpointcostparams+json +# application/alto-endpointprop+json +# application/alto-endpointpropparams+json +# application/alto-error+json +# application/alto-networkmap+json +# application/alto-networkmapfilter+json +# application/aml +application/andrew-inset ez +# application/applefile +application/applixware aw +# application/atf +# application/atfx +application/atom+xml atom +application/atomcat+xml atomcat +# application/atomdeleted+xml +# application/atomicmail +application/atomsvc+xml atomsvc +# application/atxml +# application/auth-policy+xml +# application/bacnet-xdd+zip +# application/batch-smtp +# application/beep+xml +# application/calendar+json +# application/calendar+xml +# application/call-completion +# application/cals-1840 +# application/cbor +# application/ccmp+xml +application/ccxml+xml ccxml +# application/cdfx+xml +application/cdmi-capability cdmia +application/cdmi-container cdmic +application/cdmi-domain cdmid +application/cdmi-object cdmio +application/cdmi-queue cdmiq +# application/cdni +# application/cea +# application/cea-2018+xml +# application/cellml+xml +# application/cfw +# application/cms +# application/cnrp+xml +# application/coap-group+json +# application/commonground +# application/conference-info+xml +# application/cpl+xml +# application/csrattrs +# application/csta+xml +# application/cstadata+xml +# application/csvm+json +application/cu-seeme cu +# application/cybercash +# application/dash+xml +# application/dashdelta +application/davmount+xml davmount +# application/dca-rft +# application/dcd +# application/dec-dx +# application/dialog-info+xml +# application/dicom +# application/dii +# application/dit +# application/dns +application/docbook+xml dbk +# application/dskpp+xml +application/dssc+der dssc +application/dssc+xml xdssc +# application/dvcs +application/ecmascript ecma +# application/edi-consent +# application/edi-x12 +# application/edifact +# application/efi +# application/emergencycalldata.comment+xml +# application/emergencycalldata.deviceinfo+xml +# application/emergencycalldata.providerinfo+xml +# application/emergencycalldata.serviceinfo+xml +# application/emergencycalldata.subscriberinfo+xml +application/emma+xml emma +# application/emotionml+xml +# application/encaprtp +# application/epp+xml +application/epub+zip epub +# application/eshop +# application/example +application/exi exi +# application/fastinfoset +# application/fastsoap +# application/fdt+xml +# application/fits +application/font-tdpfr pfr +# application/framework-attributes+xml +# application/geo+json +application/gml+xml gml +application/gpx+xml gpx +application/gxf gxf +# application/gzip +# application/h224 +# application/held+xml +# application/http +application/hyperstudio stk +# application/ibe-key-request+xml +# application/ibe-pkg-reply+xml +# application/ibe-pp-data +# application/iges +# application/im-iscomposing+xml +# application/index +# application/index.cmd +# application/index.obj +# application/index.response +# application/index.vnd +application/inkml+xml ink inkml +# application/iotp +application/ipfix ipfix +# application/ipp +# application/isup +# application/its+xml +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +# application/jose +# application/jose+json +# application/jrd+json +application/json json +# application/json-patch+json +# application/json-seq +application/jsonml+json jsonml +# application/jwk+json +# application/jwk-set+json +# application/jwt +# application/kpml-request+xml +# application/kpml-response+xml +# application/ld+json +# application/lgr+xml +# application/link-format +# application/load-control+xml +application/lost+xml lostxml +# application/lostsync+xml +# application/lxf +application/mac-binhex40 hqx +application/mac-compactpro cpt +# application/macwriteii +application/mads+xml mads +application/marc mrc +application/marcxml+xml mrcx +application/mathematica ma nb mb +application/mathml+xml mathml +# application/mathml-content+xml +# application/mathml-presentation+xml +# application/mbms-associated-procedure-description+xml +# application/mbms-deregister+xml +# application/mbms-envelope+xml +# application/mbms-msk+xml +# application/mbms-msk-response+xml +# application/mbms-protection-description+xml +# application/mbms-reception-report+xml +# application/mbms-register+xml +# application/mbms-register-response+xml +# application/mbms-schedule+xml +# application/mbms-user-service-description+xml +application/mbox mbox +# application/media-policy-dataset+xml +# application/media_control+xml +application/mediaservercontrol+xml mscml +# application/merge-patch+json +application/metalink+xml metalink +application/metalink4+xml meta4 +application/mets+xml mets +# application/mf4 +# application/mikey +application/mods+xml mods +# application/moss-keys +# application/moss-signature +# application/mosskey-data +# application/mosskey-request +application/mp21 m21 mp21 +application/mp4 mp4s +# application/mpeg4-generic +# application/mpeg4-iod +# application/mpeg4-iod-xmt +# application/mrb-consumer+xml +# application/mrb-publish+xml +# application/msc-ivr+xml +# application/msc-mixer+xml +application/msword doc dot +application/mxf mxf +# application/nasdata +# application/news-checkgroups +# application/news-groupinfo +# application/news-transmission +# application/nlsml+xml +# application/nss +# application/ocsp-request +# application/ocsp-response +application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy +application/oda oda +# application/odx +application/oebps-package+xml opf +application/ogg ogx +application/omdoc+xml omdoc +application/onenote onetoc onetoc2 onetmp onepkg +application/oxps oxps +# application/p2p-overlay+xml +# application/parityfec +application/patch-ops-error+xml xer +application/pdf pdf +# application/pdx +application/pgp-encrypted pgp +# application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +# application/pidf+xml +# application/pidf-diff+xml +application/pkcs10 p10 +# application/pkcs12 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkcs8 p8 +application/pkix-attr-cert ac +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +# application/poc-settings+xml +application/postscript ai eps ps +# application/ppsp-tracker+json +# application/problem+json +# application/problem+xml +# application/provenance+xml +# application/prs.alvestrand.titrax-sheet +application/prs.cww cww +# application/prs.hpub+zip +# application/prs.nprend +# application/prs.plucker +# application/prs.rdf-xml-crypt +# application/prs.xsf+xml +application/pskc+xml pskcxml +# application/qsig +# application/raptorfec +# application/rdap+json +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +# application/remote-printing +# application/reputon+json +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +# application/rfc+xml +# application/riscos +# application/rlmi+xml +application/rls-services+xml rs +application/rpki-ghostbusters gbr +application/rpki-manifest mft +application/rpki-roa roa +# application/rpki-updown +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +# application/rtploopback +# application/rtx +# application/samlassertion+xml +# application/samlmetadata+xml +application/sbml+xml sbml +# application/scaip+xml +# application/scim+json +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +# application/sep+xml +# application/sep-exi +# application/session-info +# application/set-payment +application/set-payment-initiation setpay +# application/set-registration +application/set-registration-initiation setreg +# application/sgml +# application/sgml-open-catalog +application/shf+xml shf +# application/sieve +# application/simple-filter+xml +# application/simple-message-summary +# application/simplesymbolcontainer +# application/slate +# application/smil +application/smil+xml smi smil +# application/smpte336m +# application/soap+fastinfoset +# application/soap+xml +application/sparql-query rq +application/sparql-results+xml srx +# application/spirits-event+xml +# application/sql +application/srgs gram +application/srgs+xml grxml +application/sru+xml sru +application/ssdl+xml ssdl +application/ssml+xml ssml +# application/tamp-apex-update +# application/tamp-apex-update-confirm +# application/tamp-community-update +# application/tamp-community-update-confirm +# application/tamp-error +# application/tamp-sequence-adjust +# application/tamp-sequence-adjust-confirm +# application/tamp-status-query +# application/tamp-status-response +# application/tamp-update +# application/tamp-update-confirm +application/tei+xml tei teicorpus +application/thraud+xml tfi +# application/timestamp-query +# application/timestamp-reply +application/timestamped-data tsd +# application/ttml+xml +# application/tve-trigger +# application/ulpfec +# application/urc-grpsheet+xml +# application/urc-ressheet+xml +# application/urc-targetdesc+xml +# application/urc-uisocketdesc+xml +# application/vcard+json +# application/vcard+xml +# application/vemmi +# application/vividence.scriptfile +# application/vnd.3gpp-prose+xml +# application/vnd.3gpp-prose-pc3ch+xml +# application/vnd.3gpp.access-transfer-events+xml +# application/vnd.3gpp.bsf+xml +# application/vnd.3gpp.mid-call+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +# application/vnd.3gpp.sms +# application/vnd.3gpp.sms+xml +# application/vnd.3gpp.srvcc-ext+xml +# application/vnd.3gpp.srvcc-info+xml +# application/vnd.3gpp.state-and-event-info+xml +# application/vnd.3gpp.ussd+xml +# application/vnd.3gpp2.bcmcsinfo+xml +# application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +# application/vnd.3lightssoftware.imagescal +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.air-application-installer-package+zip air +# application/vnd.adobe.flash.movie +application/vnd.adobe.formscentral.fcdt fcdt +application/vnd.adobe.fxp fxp fxpl +# application/vnd.adobe.partial-upload +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +# application/vnd.aether.imp +# application/vnd.ah-barcode +application/vnd.ahead.space ahead +application/vnd.airzip.filesecure.azf azf +application/vnd.airzip.filesecure.azs azs +application/vnd.amazon.ebook azw +# application/vnd.amazon.mobi8-ebook +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +# application/vnd.amundsen.maze+xml +application/vnd.android.package-archive apk +# application/vnd.anki +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +# application/vnd.apache.thrift.binary +# application/vnd.apache.thrift.compact +# application/vnd.apache.thrift.json +# application/vnd.api+json +application/vnd.apple.installer+xml mpkg +application/vnd.apple.mpegurl m3u8 +# application/vnd.arastra.swi +application/vnd.aristanetworks.swi swi +# application/vnd.artsquare +application/vnd.astraea-software.iota iota +application/vnd.audiograph aep +# application/vnd.autopackage +# application/vnd.avistar+xml +# application/vnd.balsamiq.bmml+xml +# application/vnd.balsamiq.bmpr +# application/vnd.bekitzur-stech+json +# application/vnd.biopax.rdf+xml +application/vnd.blueice.multipass mpm +# application/vnd.bluetooth.ep.oob +# application/vnd.bluetooth.le.oob +application/vnd.bmi bmi +application/vnd.businessobjects rep +# application/vnd.cab-jscript +# application/vnd.canon-cpdl +# application/vnd.canon-lips +# application/vnd.cendio.thinlinc.clientconf +# application/vnd.century-systems.tcp_stream +application/vnd.chemdraw+xml cdxml +# application/vnd.chess-pgn +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +# application/vnd.cirpack.isdn-ext +# application/vnd.citationstyles.style+xml +application/vnd.claymore cla +application/vnd.cloanto.rp9 rp9 +application/vnd.clonk.c4group c4g c4d c4f c4p c4u +application/vnd.cluetrust.cartomobile-config c11amc +application/vnd.cluetrust.cartomobile-config-pkg c11amz +# application/vnd.coffeescript +# application/vnd.collection+json +# application/vnd.collection.doc+json +# application/vnd.collection.next+json +# application/vnd.comicbook+zip +# application/vnd.commerce-battelle +application/vnd.commonspace csp +application/vnd.contact.cmsg cdbcmsg +# application/vnd.coreos.ignition+json +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +# application/vnd.ctct.ws+xml +# application/vnd.cups-pdf +# application/vnd.cups-postscript +application/vnd.cups-ppd ppd +# application/vnd.cups-raster +# application/vnd.cups-raw +# application/vnd.curl +application/vnd.curl.car car +application/vnd.curl.pcurl pcurl +# application/vnd.cyan.dean.root+xml +# application/vnd.cybank +application/vnd.dart dart +application/vnd.data-vision.rdz rdz +# application/vnd.debian.binary-package +application/vnd.dece.data uvf uvvf uvd uvvd +application/vnd.dece.ttml+xml uvt uvvt +application/vnd.dece.unspecified uvx uvvx +application/vnd.dece.zip uvz uvvz +application/vnd.denovo.fcselayout-link fe_launch +# application/vnd.desmume.movie +# application/vnd.dir-bi.plate-dl-nosuffix +# application/vnd.dm.delegation+xml +application/vnd.dna dna +# application/vnd.document+json +application/vnd.dolby.mlp mlp +# application/vnd.dolby.mobile.1 +# application/vnd.dolby.mobile.2 +# application/vnd.doremir.scorecloud-binary-document +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +# application/vnd.drive+json +application/vnd.ds-keypoint kpxx +# application/vnd.dtg.local +# application/vnd.dtg.local.flash +# application/vnd.dtg.local.html +application/vnd.dvb.ait ait +# application/vnd.dvb.dvbj +# application/vnd.dvb.esgcontainer +# application/vnd.dvb.ipdcdftnotifaccess +# application/vnd.dvb.ipdcesgaccess +# application/vnd.dvb.ipdcesgaccess2 +# application/vnd.dvb.ipdcesgpdd +# application/vnd.dvb.ipdcroaming +# application/vnd.dvb.iptv.alfec-base +# application/vnd.dvb.iptv.alfec-enhancement +# application/vnd.dvb.notif-aggregate-root+xml +# application/vnd.dvb.notif-container+xml +# application/vnd.dvb.notif-generic+xml +# application/vnd.dvb.notif-ia-msglist+xml +# application/vnd.dvb.notif-ia-registration-request+xml +# application/vnd.dvb.notif-ia-registration-response+xml +# application/vnd.dvb.notif-init+xml +# application/vnd.dvb.pfr +application/vnd.dvb.service svc +# application/vnd.dxr +application/vnd.dynageo geo +# application/vnd.dzr +# application/vnd.easykaraoke.cdgdownload +# application/vnd.ecdis-update +application/vnd.ecowin.chart mag +# application/vnd.ecowin.filerequest +# application/vnd.ecowin.fileupdate +# application/vnd.ecowin.series +# application/vnd.ecowin.seriesrequest +# application/vnd.ecowin.seriesupdate +# application/vnd.emclient.accessrequest+xml +application/vnd.enliven nml +# application/vnd.enphase.envoy +# application/vnd.eprints.data+xml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +# application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +# application/vnd.etsi.aoc+xml +# application/vnd.etsi.asic-e+zip +# application/vnd.etsi.asic-s+zip +# application/vnd.etsi.cug+xml +# application/vnd.etsi.iptvcommand+xml +# application/vnd.etsi.iptvdiscovery+xml +# application/vnd.etsi.iptvprofile+xml +# application/vnd.etsi.iptvsad-bc+xml +# application/vnd.etsi.iptvsad-cod+xml +# application/vnd.etsi.iptvsad-npvr+xml +# application/vnd.etsi.iptvservice+xml +# application/vnd.etsi.iptvsync+xml +# application/vnd.etsi.iptvueprofile+xml +# application/vnd.etsi.mcid+xml +# application/vnd.etsi.mheg5 +# application/vnd.etsi.overload-control-policy-dataset+xml +# application/vnd.etsi.pstn+xml +# application/vnd.etsi.sci+xml +# application/vnd.etsi.simservs+xml +# application/vnd.etsi.timestamp-token +# application/vnd.etsi.tsl+xml +# application/vnd.etsi.tsl.der +# application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +# application/vnd.f-secure.mobile +# application/vnd.fastcopy-disk-image +application/vnd.fdf fdf +application/vnd.fdsn.mseed mseed +application/vnd.fdsn.seed seed dataless +# application/vnd.ffsns +# application/vnd.filmit.zfc +# application/vnd.fints +# application/vnd.firemonkeys.cloudcell +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +# application/vnd.font-fontforge-sfd +application/vnd.framemaker fm frame maker book +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +# application/vnd.fujixerox.art-ex +# application/vnd.fujixerox.art4 +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +# application/vnd.fujixerox.docuworks.container +# application/vnd.fujixerox.hbpl +# application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +# application/vnd.geo+json +# application/vnd.geocube+xml +application/vnd.geogebra.file ggb +application/vnd.geogebra.tool ggt +application/vnd.geometry-explorer gex gre +application/vnd.geonext gxt +application/vnd.geoplan g2w +application/vnd.geospace g3w +# application/vnd.gerber +# application/vnd.globalplatform.card-content-mgt +# application/vnd.globalplatform.card-content-mgt-response +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +# application/vnd.gov.sk.e-form+xml +# application/vnd.gov.sk.e-form+zip +# application/vnd.gov.sk.xmldatacontainer+xml +application/vnd.grafeq gqf gqs +# application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +# application/vnd.hal+json +application/vnd.hal+xml hal +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +# application/vnd.hcl-bireports +# application/vnd.hdt +# application/vnd.heroku+json +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +# application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +# application/vnd.hyperdrive+json +# application/vnd.hzn-3d-crossword +# application/vnd.ibm.afplinedata +# application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp listafp list3820 +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +# application/vnd.ieee.1905 +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +# application/vnd.ims.imsccv1p1 +# application/vnd.ims.imsccv1p2 +# application/vnd.ims.imsccv1p3 +# application/vnd.ims.lis.v2.result+json +# application/vnd.ims.lti.v2.toolconsumerprofile+json +# application/vnd.ims.lti.v2.toolproxy+json +# application/vnd.ims.lti.v2.toolproxy.id+json +# application/vnd.ims.lti.v2.toolsettings+json +# application/vnd.ims.lti.v2.toolsettings.simple+json +# application/vnd.informedcontrol.rms+xml +# application/vnd.informix-visionary +# application/vnd.infotech.project +# application/vnd.infotech.project+xml +# application/vnd.innopath.wamp.notification +application/vnd.insors.igm igm +application/vnd.intercon.formnet xpw xpx +application/vnd.intergeo i2g +# application/vnd.intertrust.digibox +# application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +# application/vnd.iptc.g2.catalogitem+xml +# application/vnd.iptc.g2.conceptitem+xml +# application/vnd.iptc.g2.knowledgeitem+xml +# application/vnd.iptc.g2.newsitem+xml +# application/vnd.iptc.g2.newsmessage+xml +# application/vnd.iptc.g2.packageitem+xml +# application/vnd.iptc.g2.planningitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.isac.fcs fcs +application/vnd.jam jam +# application/vnd.japannet-directory-service +# application/vnd.japannet-jpnstore-wakeup +# application/vnd.japannet-payment-wakeup +# application/vnd.japannet-registration +# application/vnd.japannet-registration-wakeup +# application/vnd.japannet-setstore-wakeup +# application/vnd.japannet-verification +# application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +# application/vnd.jsk.isdn-ngn +application/vnd.kahootz ktz ktr +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skp skd skt skm +application/vnd.kodak-descriptor sse +application/vnd.las.las+xml lasxml +# application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +# application/vnd.mapbox-vector-tile +# application/vnd.marlin.drm.actiontoken+xml +# application/vnd.marlin.drm.conftoken+xml +# application/vnd.marlin.drm.license+xml +# application/vnd.marlin.drm.mdcf +# application/vnd.mason+json +# application/vnd.maxmind.maxmind-db +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +# application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +# application/vnd.micro+json +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +# application/vnd.microsoft.portable-executable +# application/vnd.miele+json +application/vnd.mif mif +# application/vnd.minisoft-hp3000-save +# application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +# application/vnd.motorola.flexsuite +# application/vnd.motorola.flexsuite.adsi +# application/vnd.motorola.flexsuite.fis +# application/vnd.motorola.flexsuite.gotap +# application/vnd.motorola.flexsuite.kmr +# application/vnd.motorola.flexsuite.ttc +# application/vnd.motorola.flexsuite.wem +# application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +# application/vnd.ms-3mfdocument +application/vnd.ms-artgalry cil +# application/vnd.ms-asf +application/vnd.ms-cab-compressed cab +# application/vnd.ms-color.iccprofile +application/vnd.ms-excel xls xlm xla xlc xlt xlw +application/vnd.ms-excel.addin.macroenabled.12 xlam +application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb +application/vnd.ms-excel.sheet.macroenabled.12 xlsm +application/vnd.ms-excel.template.macroenabled.12 xltm +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +# application/vnd.ms-office.activex+xml +application/vnd.ms-officetheme thmx +# application/vnd.ms-opentype +# application/vnd.ms-package.obfuscated-opentype +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +# application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-powerpoint.addin.macroenabled.12 ppam +application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm +application/vnd.ms-powerpoint.slide.macroenabled.12 sldm +application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm +application/vnd.ms-powerpoint.template.macroenabled.12 potm +# application/vnd.ms-printdevicecapabilities+xml +# application/vnd.ms-printing.printticket+xml +# application/vnd.ms-printschematicket+xml +application/vnd.ms-project mpp mpt +# application/vnd.ms-tnef +# application/vnd.ms-windows.devicepairing +# application/vnd.ms-windows.nwprinting.oob +# application/vnd.ms-windows.printerpairing +# application/vnd.ms-windows.wsd.oob +# application/vnd.ms-wmdrm.lic-chlg-req +# application/vnd.ms-wmdrm.lic-resp +# application/vnd.ms-wmdrm.meter-chlg-req +# application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-word.document.macroenabled.12 docm +application/vnd.ms-word.template.macroenabled.12 dotm +application/vnd.ms-works wps wks wcm wdb +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +# application/vnd.msa-disk-image +application/vnd.mseq mseq +# application/vnd.msign +# application/vnd.multiad.creator +# application/vnd.multiad.creator.cif +# application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +application/vnd.mynfc taglet +# application/vnd.ncd.control +# application/vnd.ncd.reference +# application/vnd.nervana +# application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +# application/vnd.nintendo.nitro.rom +# application/vnd.nintendo.snes.rom +application/vnd.nitf ntf nitf +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +# application/vnd.nokia.catalogs +# application/vnd.nokia.conml+wbxml +# application/vnd.nokia.conml+xml +# application/vnd.nokia.iptv.config+xml +# application/vnd.nokia.isds-radio-presets +# application/vnd.nokia.landmark+wbxml +# application/vnd.nokia.landmark+xml +# application/vnd.nokia.landmarkcollection+xml +# application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +# application/vnd.nokia.ncd +# application/vnd.nokia.pcd+wbxml +# application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +# application/vnd.ntt-local.content-share +# application/vnd.ntt-local.file-transfer +# application/vnd.ntt-local.ogw_remote-access +# application/vnd.ntt-local.sip-ta_remote +# application/vnd.ntt-local.sip-ta_tcp_stream +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template odft +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +# application/vnd.obn +# application/vnd.oftn.l10n+json +# application/vnd.oipf.contentaccessdownload+xml +# application/vnd.oipf.contentaccessstreaming+xml +# application/vnd.oipf.cspg-hexbinary +# application/vnd.oipf.dae.svg+xml +# application/vnd.oipf.dae.xhtml+xml +# application/vnd.oipf.mippvcontrolmessage+xml +# application/vnd.oipf.pae.gem +# application/vnd.oipf.spdiscovery+xml +# application/vnd.oipf.spdlist+xml +# application/vnd.oipf.ueprofile+xml +# application/vnd.oipf.userprofile+xml +application/vnd.olpc-sugar xo +# application/vnd.oma-scws-config +# application/vnd.oma-scws-http-request +# application/vnd.oma-scws-http-response +# application/vnd.oma.bcast.associated-procedure-parameter+xml +# application/vnd.oma.bcast.drm-trigger+xml +# application/vnd.oma.bcast.imd+xml +# application/vnd.oma.bcast.ltkm +# application/vnd.oma.bcast.notification+xml +# application/vnd.oma.bcast.provisioningtrigger +# application/vnd.oma.bcast.sgboot +# application/vnd.oma.bcast.sgdd+xml +# application/vnd.oma.bcast.sgdu +# application/vnd.oma.bcast.simple-symbol-container +# application/vnd.oma.bcast.smartcard-trigger+xml +# application/vnd.oma.bcast.sprov+xml +# application/vnd.oma.bcast.stkm +# application/vnd.oma.cab-address-book+xml +# application/vnd.oma.cab-feature-handler+xml +# application/vnd.oma.cab-pcc+xml +# application/vnd.oma.cab-subs-invite+xml +# application/vnd.oma.cab-user-prefs+xml +# application/vnd.oma.dcd +# application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +# application/vnd.oma.drm.risd+xml +# application/vnd.oma.group-usage-list+xml +# application/vnd.oma.lwm2m+json +# application/vnd.oma.lwm2m+tlv +# application/vnd.oma.pal+xml +# application/vnd.oma.poc.detailed-progress-report+xml +# application/vnd.oma.poc.final-report+xml +# application/vnd.oma.poc.groups+xml +# application/vnd.oma.poc.invocation-descriptor+xml +# application/vnd.oma.poc.optimized-progress-report+xml +# application/vnd.oma.push +# application/vnd.oma.scidm.messages+xml +# application/vnd.oma.xcap-directory+xml +# application/vnd.omads-email+xml +# application/vnd.omads-file+xml +# application/vnd.omads-folder+xml +# application/vnd.omaloc-supl-init +# application/vnd.onepager +# application/vnd.openblox.game+xml +# application/vnd.openblox.game-binary +# application/vnd.openeye.oeb +application/vnd.openofficeorg.extension oxt +# application/vnd.openxmlformats-officedocument.custom-properties+xml +# application/vnd.openxmlformats-officedocument.customxmlproperties+xml +# application/vnd.openxmlformats-officedocument.drawing+xml +# application/vnd.openxmlformats-officedocument.drawingml.chart+xml +# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml +# application/vnd.openxmlformats-officedocument.extended-properties+xml +# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml +# application/vnd.openxmlformats-officedocument.presentationml.comments+xml +# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml +application/vnd.openxmlformats-officedocument.presentationml.slide sldx +# application/vnd.openxmlformats-officedocument.presentationml.slide+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml +# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml +# application/vnd.openxmlformats-officedocument.presentationml.tags+xml +application/vnd.openxmlformats-officedocument.presentationml.template potx +# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml +# application/vnd.openxmlformats-officedocument.theme+xml +# application/vnd.openxmlformats-officedocument.themeoverride+xml +# application/vnd.openxmlformats-officedocument.vmldrawing +# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml +# application/vnd.openxmlformats-package.core-properties+xml +# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml +# application/vnd.openxmlformats-package.relationships+xml +# application/vnd.oracle.resource+json +# application/vnd.orange.indata +# application/vnd.osa.netdeploy +application/vnd.osgeo.mapguide.package mgp +# application/vnd.osgi.bundle +application/vnd.osgi.dp dp +application/vnd.osgi.subsystem esa +# application/vnd.otps.ct-kip+xml +# application/vnd.oxli.countgraph +# application/vnd.pagerduty+json +application/vnd.palm pdb pqa oprc +# application/vnd.panoply +# application/vnd.paos.xml +application/vnd.pawaafile paw +# application/vnd.pcos +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +# application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.pmi.widget wg +# application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +# application/vnd.powerbuilder6-s +# application/vnd.powerbuilder7 +# application/vnd.powerbuilder7-s +# application/vnd.powerbuilder75 +# application/vnd.powerbuilder75-s +# application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +# application/vnd.pwg-multiplexed +# application/vnd.pwg-xhtml-print+xml +# application/vnd.qualcomm.brew-app-res +# application/vnd.quarantainenet +application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb +# application/vnd.quobject-quoxdocument +# application/vnd.radisys.moml+xml +# application/vnd.radisys.msml+xml +# application/vnd.radisys.msml-audit+xml +# application/vnd.radisys.msml-audit-conf+xml +# application/vnd.radisys.msml-audit-conn+xml +# application/vnd.radisys.msml-audit-dialog+xml +# application/vnd.radisys.msml-audit-stream+xml +# application/vnd.radisys.msml-conf+xml +# application/vnd.radisys.msml-dialog+xml +# application/vnd.radisys.msml-dialog-base+xml +# application/vnd.radisys.msml-dialog-fax-detect+xml +# application/vnd.radisys.msml-dialog-fax-sendrecv+xml +# application/vnd.radisys.msml-dialog-group+xml +# application/vnd.radisys.msml-dialog-speech+xml +# application/vnd.radisys.msml-dialog-transform+xml +# application/vnd.rainstor.data +# application/vnd.rapid +# application/vnd.rar +application/vnd.realvnc.bed bed +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml musicxml +# application/vnd.renlearn.rlprint +application/vnd.rig.cryptonote cryptonote +application/vnd.rim.cod cod +application/vnd.rn-realmedia rm +application/vnd.rn-realmedia-vbr rmvb +application/vnd.route66.link66+xml link66 +# application/vnd.rs-274x +# application/vnd.ruckus.download +# application/vnd.s3sms +application/vnd.sailingtracker.track st +# application/vnd.sbm.cid +# application/vnd.sbm.mid2 +# application/vnd.scribus +# application/vnd.sealed.3df +# application/vnd.sealed.csf +# application/vnd.sealed.doc +# application/vnd.sealed.eml +# application/vnd.sealed.mht +# application/vnd.sealed.net +# application/vnd.sealed.ppt +# application/vnd.sealed.tiff +# application/vnd.sealed.xls +# application/vnd.sealedmedia.softseal.html +# application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +# application/vnd.siren+json +application/vnd.smaf mmf +# application/vnd.smart.notebook +application/vnd.smart.teacher teacher +# application/vnd.software602.filler.form+xml +# application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkm sdkd +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +# application/vnd.sss-cod +# application/vnd.sss-dtf +# application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math smf +application/vnd.stardivision.writer sdw vor +application/vnd.stardivision.writer-global sgl +application/vnd.stepmania.package smzip +application/vnd.stepmania.stepchart sm +# application/vnd.street-stream +# application/vnd.sun.wadl+xml +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +application/vnd.sus-calendar sus susp +application/vnd.svd svd +# application/vnd.swiftview-ics +application/vnd.symbian.install sis sisx +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +# application/vnd.syncml.dm.notification +# application/vnd.syncml.dmddf+wbxml +# application/vnd.syncml.dmddf+xml +# application/vnd.syncml.dmtnds+wbxml +# application/vnd.syncml.dmtnds+xml +# application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tcpdump.pcap pcap cap dmp +# application/vnd.tmd.mediaflex.api+xml +# application/vnd.tml +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +# application/vnd.truedoc +# application/vnd.ubisoft.webplayer +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +# application/vnd.uplanet.alert +# application/vnd.uplanet.alert-wbxml +# application/vnd.uplanet.bearer-choice +# application/vnd.uplanet.bearer-choice-wbxml +# application/vnd.uplanet.cacheop +# application/vnd.uplanet.cacheop-wbxml +# application/vnd.uplanet.channel +# application/vnd.uplanet.channel-wbxml +# application/vnd.uplanet.list +# application/vnd.uplanet.list-wbxml +# application/vnd.uplanet.listcmd +# application/vnd.uplanet.listcmd-wbxml +# application/vnd.uplanet.signal +# application/vnd.uri-map +# application/vnd.valve.source.material +application/vnd.vcx vcx +# application/vnd.vd-study +# application/vnd.vectorworks +# application/vnd.vel+json +# application/vnd.verimatrix.vcas +# application/vnd.vidsoft.vidconference +application/vnd.visio vsd vst vss vsw +application/vnd.visionary vis +# application/vnd.vividence.scriptfile +application/vnd.vsf vsf +# application/vnd.wap.sic +# application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +# application/vnd.wfa.p2p +# application/vnd.wfa.wsc +# application/vnd.windows.devicepairing +# application/vnd.wmc +# application/vnd.wmf.bootstrap +# application/vnd.wolfram.mathematica +# application/vnd.wolfram.mathematica.package +application/vnd.wolfram.player nbp +application/vnd.wordperfect wpd +application/vnd.wqd wqd +# application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +# application/vnd.wv.csp+wbxml +# application/vnd.wv.csp+xml +# application/vnd.wv.ssp+xml +# application/vnd.xacml+json +application/vnd.xara xar +application/vnd.xfdl xfdl +# application/vnd.xfdl.webform +# application/vnd.xmi+xml +# application/vnd.xmpie.cpkg +# application/vnd.xmpie.dpkg +# application/vnd.xmpie.plan +# application/vnd.xmpie.ppkg +# application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.openscoreformat osf +application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg +# application/vnd.yamaha.remote-setup +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +# application/vnd.yamaha.through-ngn +# application/vnd.yamaha.tunnel-udpencap +# application/vnd.yaoweme +application/vnd.yellowriver-custom-menu cmp +application/vnd.zul zir zirz +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +# application/vq-rtcpxr +# application/watcherinfo+xml +# application/whoispp-query +# application/whoispp-response +application/widget wgt +application/winhlp hlp +# application/wita +# application/wordperfect5.1 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-7z-compressed 7z +application/x-abiword abw +application/x-ace-compressed ace +# application/x-amf +application/x-apple-diskimage dmg +application/x-authorware-bin aab x32 u32 vox +application/x-authorware-map aam +application/x-authorware-seg aas +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-blorb blb blorb +application/x-bzip bz +application/x-bzip2 bz2 boz +application/x-cbr cbr cba cbt cbz cb7 +application/x-cdlink vcd +application/x-cfs-compressed cfs +application/x-chat chat +application/x-chess-pgn pgn +# application/x-compress +application/x-conference nsc +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-dgc-compressed dgc +application/x-director dir dcr dxr cst cct cxt w3d fgd swa +application/x-doom wad +application/x-dtbncx+xml ncx +application/x-dtbook+xml dtb +application/x-dtbresource+xml res +application/x-dvi dvi +application/x-envoy evy +application/x-eva eva +application/x-font-bdf bdf +# application/x-font-dos +# application/x-font-framemaker +application/x-font-ghostscript gsf +# application/x-font-libgrx +application/x-font-linux-psf psf +application/x-font-pcf pcf +application/x-font-snf snf +# application/x-font-speedo +# application/x-font-sunos-news +application/x-font-type1 pfa pfb pfm afm +# application/x-font-vfont +application/x-freearc arc +application/x-futuresplash spl +application/x-gca-compressed gca +application/x-glulx ulx +application/x-gnumeric gnumeric +application/x-gramps-xml gramps +application/x-gtar gtar +# application/x-gzip +application/x-hdf hdf +application/x-install-instructions install +application/x-iso9660-image iso +application/x-java-jnlp-file jnlp +application/x-latex latex +application/x-lzh-compressed lzh lha +application/x-mie mie +application/x-mobipocket-ebook prc mobi +application/x-ms-application application +application/x-ms-shortcut lnk +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-ms-xbap xbap +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdownload exe dll com bat msi +application/x-msmediaview mvb m13 m14 +application/x-msmetafile wmf wmz emf emz +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-nzb nzb +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-rar-compressed rar +application/x-research-info-systems ris +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-silverlight-app xap +application/x-sql sql +application/x-stuffit sit +application/x-stuffitx sitx +application/x-subrip srt +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-t3vm-image t3 +application/x-tads gam +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-tex-tfm tfm +application/x-texinfo texinfo texi +application/x-tgif obj +application/x-ustar ustar +application/x-wais-source src +# application/x-www-form-urlencoded +application/x-x509-ca-cert der crt +application/x-xfig fig +application/x-xliff+xml xlf +application/x-xpinstall xpi +application/x-xz xz +application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 +# application/x400-bp +# application/xacml+xml +application/xaml+xml xaml +# application/xcap-att+xml +# application/xcap-caps+xml +application/xcap-diff+xml xdf +# application/xcap-el+xml +# application/xcap-error+xml +# application/xcap-ns+xml +# application/xcon-conference-info+xml +# application/xcon-conference-info-diff+xml +application/xenc+xml xenc +application/xhtml+xml xhtml xht +# application/xhtml-voice+xml +application/xml xml xsl +application/xml-dtd dtd +# application/xml-external-parsed-entity +# application/xml-patch+xml +# application/xmpp+xml +application/xop+xml xop +application/xproc+xml xpl +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvml xvm +application/yang yang +application/yin+xml yin +application/zip zip +# application/zlib +# audio/1d-interleaved-parityfec +# audio/32kadpcm +# audio/3gpp +# audio/3gpp2 +# audio/ac3 +audio/adpcm adp +# audio/amr +# audio/amr-wb +# audio/amr-wb+ +# audio/aptx +# audio/asc +# audio/atrac-advanced-lossless +# audio/atrac-x +# audio/atrac3 +audio/basic au snd +# audio/bv16 +# audio/bv32 +# audio/clearmode +# audio/cn +# audio/dat12 +# audio/dls +# audio/dsr-es201108 +# audio/dsr-es202050 +# audio/dsr-es202211 +# audio/dsr-es202212 +# audio/dv +# audio/dvi4 +# audio/eac3 +# audio/encaprtp +# audio/evrc +# audio/evrc-qcp +# audio/evrc0 +# audio/evrc1 +# audio/evrcb +# audio/evrcb0 +# audio/evrcb1 +# audio/evrcnw +# audio/evrcnw0 +# audio/evrcnw1 +# audio/evrcwb +# audio/evrcwb0 +# audio/evrcwb1 +# audio/evs +# audio/example +# audio/fwdred +# audio/g711-0 +# audio/g719 +# audio/g722 +# audio/g7221 +# audio/g723 +# audio/g726-16 +# audio/g726-24 +# audio/g726-32 +# audio/g726-40 +# audio/g728 +# audio/g729 +# audio/g7291 +# audio/g729d +# audio/g729e +# audio/gsm +# audio/gsm-efr +# audio/gsm-hr-08 +# audio/ilbc +# audio/ip-mr_v2.5 +# audio/isac +# audio/l16 +# audio/l20 +# audio/l24 +# audio/l8 +# audio/lpc +audio/midi mid midi kar rmi +# audio/mobile-xmf +audio/mp4 m4a mp4a +# audio/mp4a-latm +# audio/mpa +# audio/mpa-robust +audio/mpeg mpga mp2 mp2a mp3 m2a m3a +# audio/mpeg4-generic +# audio/musepack +audio/ogg oga ogg spx +# audio/opus +# audio/parityfec +# audio/pcma +# audio/pcma-wb +# audio/pcmu +# audio/pcmu-wb +# audio/prs.sid +# audio/qcelp +# audio/raptorfec +# audio/red +# audio/rtp-enc-aescm128 +# audio/rtp-midi +# audio/rtploopback +# audio/rtx +audio/s3m s3m +audio/silk sil +# audio/smv +# audio/smv-qcp +# audio/smv0 +# audio/sp-midi +# audio/speex +# audio/t140c +# audio/t38 +# audio/telephone-event +# audio/tone +# audio/uemclip +# audio/ulpfec +# audio/vdvi +# audio/vmr-wb +# audio/vnd.3gpp.iufp +# audio/vnd.4sb +# audio/vnd.audiokoz +# audio/vnd.celp +# audio/vnd.cisco.nse +# audio/vnd.cmles.radio-events +# audio/vnd.cns.anp1 +# audio/vnd.cns.inf1 +audio/vnd.dece.audio uva uvva +audio/vnd.digital-winds eol +# audio/vnd.dlna.adts +# audio/vnd.dolby.heaac.1 +# audio/vnd.dolby.heaac.2 +# audio/vnd.dolby.mlp +# audio/vnd.dolby.mps +# audio/vnd.dolby.pl2 +# audio/vnd.dolby.pl2x +# audio/vnd.dolby.pl2z +# audio/vnd.dolby.pulse.1 +audio/vnd.dra dra +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +# audio/vnd.dvb.file +# audio/vnd.everad.plj +# audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +# audio/vnd.nokia.mobile-xmf +# audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +# audio/vnd.octel.sbc +# audio/vnd.qcelp +# audio/vnd.rhetorex.32kadpcm +audio/vnd.rip rip +# audio/vnd.sealedmedia.softseal.mpeg +# audio/vnd.vmx.cvsd +# audio/vorbis +# audio/vorbis-config +audio/webm weba +audio/x-aac aac +audio/x-aiff aif aiff aifc +audio/x-caf caf +audio/x-flac flac +audio/x-matroska mka +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin rmp +# audio/x-tta +audio/x-wav wav +audio/xm xm +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +# chemical/x-pdb +chemical/x-xyz xyz +font/collection ttc +font/otf otf +# font/sfnt +font/ttf ttf +font/woff woff +font/woff2 woff2 +image/bmp bmp +image/cgm cgm +# image/dicom-rle +# image/emf +# image/example +# image/fits +image/g3fax g3 +image/gif gif +image/ief ief +# image/jls +# image/jp2 +image/jpeg jpeg jpg jpe +# image/jpm +# image/jpx +image/ktx ktx +# image/naplps +image/png png +image/prs.btif btif +# image/prs.pti +# image/pwg-raster +image/sgi sgi +image/svg+xml svg svgz +# image/t38 +image/tiff tiff tif +# image/tiff-fx +image/vnd.adobe.photoshop psd +# image/vnd.airzip.accelerator.azv +# image/vnd.cns.inf2 +image/vnd.dece.graphic uvi uvvi uvg uvvg +image/vnd.djvu djvu djv +image/vnd.dvb.subtitle sub +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +# image/vnd.globalgraphics.pgb +# image/vnd.microsoft.icon +# image/vnd.mix +# image/vnd.mozilla.apng +image/vnd.ms-modi mdi +image/vnd.ms-photo wdp +image/vnd.net-fpx npx +# image/vnd.radiance +# image/vnd.sealed.png +# image/vnd.sealedmedia.softseal.gif +# image/vnd.sealedmedia.softseal.jpg +# image/vnd.svf +# image/vnd.tencent.tap +# image/vnd.valve.source.texture +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +# image/vnd.zbrush.pcx +image/webp webp +# image/wmf +image/x-3ds 3ds +image/x-cmu-raster ras +image/x-cmx cmx +image/x-freehand fh fhc fh4 fh5 fh7 +image/x-icon ico +image/x-mrsid-image sid +image/x-pcx pcx +image/x-pict pic pct +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-tga tga +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +# message/cpim +# message/delivery-status +# message/disposition-notification +# message/example +# message/external-body +# message/feedback-report +# message/global +# message/global-delivery-status +# message/global-disposition-notification +# message/global-headers +# message/http +# message/imdn+xml +# message/news +# message/partial +message/rfc822 eml mime +# message/s-http +# message/sip +# message/sipfrag +# message/tracking-status +# message/vnd.si.simp +# message/vnd.wfa.wsc +# model/example +# model/gltf+json +model/iges igs iges +model/mesh msh mesh silo +model/vnd.collada+xml dae +model/vnd.dwf dwf +# model/vnd.flatland.3dml +model/vnd.gdl gdl +# model/vnd.gs-gdl +# model/vnd.gs.gdl +model/vnd.gtw gtw +# model/vnd.moml+xml +model/vnd.mts mts +# model/vnd.opengex +# model/vnd.parasolid.transmit.binary +# model/vnd.parasolid.transmit.text +# model/vnd.rosette.annotated-data-model +# model/vnd.valve.source.compiled-map +model/vnd.vtu vtu +model/vrml wrl vrml +model/x3d+binary x3db x3dbz +# model/x3d+fastinfoset +model/x3d+vrml x3dv x3dvz +model/x3d+xml x3d x3dz +# model/x3d-vrml +# multipart/alternative +# multipart/appledouble +# multipart/byteranges +# multipart/digest +# multipart/encrypted +# multipart/example +# multipart/form-data +# multipart/header-set +# multipart/mixed +# multipart/parallel +# multipart/related +# multipart/report +# multipart/signed +# multipart/voice-message +# multipart/x-mixed-replace +# text/1d-interleaved-parityfec +text/cache-manifest appcache +text/calendar ics ifb +text/css css +text/csv csv +# text/csv-schema +# text/directory +# text/dns +# text/ecmascript +# text/encaprtp +# text/enriched +# text/example +# text/fwdred +# text/grammar-ref-list +text/html html htm +# text/javascript +# text/jcr-cnd +# text/markdown +# text/mizar +text/n3 n3 +# text/parameters +# text/parityfec +text/plain txt text conf def list log in +# text/provenance-notation +# text/prs.fallenstein.rst +text/prs.lines.tag dsc +# text/prs.prop.logic +# text/raptorfec +# text/red +# text/rfc822-headers +text/richtext rtx +# text/rtf +# text/rtp-enc-aescm128 +# text/rtploopback +# text/rtx +text/sgml sgml sgm +# text/t140 +text/tab-separated-values tsv +text/troff t tr roff man me ms +text/turtle ttl +# text/ulpfec +text/uri-list uri uris urls +text/vcard vcard +# text/vnd.a +# text/vnd.abc +text/vnd.curl curl +text/vnd.curl.dcurl dcurl +text/vnd.curl.mcurl mcurl +text/vnd.curl.scurl scurl +# text/vnd.debian.copyright +# text/vnd.dmclientscript +text/vnd.dvb.subtitle sub +# text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.graphviz gv +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +# text/vnd.iptc.newsml +# text/vnd.iptc.nitf +# text/vnd.latex-z +# text/vnd.motorola.reflex +# text/vnd.ms-mediapackage +# text/vnd.net2phone.commcenter.command +# text/vnd.radisys.msml-basic-layout +# text/vnd.si.uricatalogue +text/vnd.sun.j2me.app-descriptor jad +# text/vnd.trolltech.linguist +# text/vnd.wap.si +# text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm s asm +text/x-c c cc cxx cpp h hh dic +text/x-fortran f for f77 f90 +text/x-java-source java +text/x-nfo nfo +text/x-opml opml +text/x-pascal p pas +text/x-setext etx +text/x-sfv sfv +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +# text/xml +# text/xml-external-parsed-entity +# video/1d-interleaved-parityfec +video/3gpp 3gp +# video/3gpp-tt +video/3gpp2 3g2 +# video/bmpeg +# video/bt656 +# video/celb +# video/dv +# video/encaprtp +# video/example +video/h261 h261 +video/h263 h263 +# video/h263-1998 +# video/h263-2000 +video/h264 h264 +# video/h264-rcdo +# video/h264-svc +# video/h265 +# video/iso.segment +video/jpeg jpgv +# video/jpeg2000 +video/jpm jpm jpgm +video/mj2 mj2 mjp2 +# video/mp1s +# video/mp2p +# video/mp2t +video/mp4 mp4 mp4v mpg4 +# video/mp4v-es +video/mpeg mpeg mpg mpe m1v m2v +# video/mpeg4-generic +# video/mpv +# video/nv +video/ogg ogv +# video/parityfec +# video/pointer +video/quicktime qt mov +# video/raptorfec +# video/raw +# video/rtp-enc-aescm128 +# video/rtploopback +# video/rtx +# video/smpte292m +# video/ulpfec +# video/vc1 +# video/vnd.cctv +video/vnd.dece.hd uvh uvvh +video/vnd.dece.mobile uvm uvvm +# video/vnd.dece.mp4 +video/vnd.dece.pd uvp uvvp +video/vnd.dece.sd uvs uvvs +video/vnd.dece.video uvv uvvv +# video/vnd.directv.mpeg +# video/vnd.directv.mpeg-tts +# video/vnd.dlna.mpeg-tts +video/vnd.dvb.file dvb +video/vnd.fvt fvt +# video/vnd.hns.video +# video/vnd.iptvforum.1dparityfec-1010 +# video/vnd.iptvforum.1dparityfec-2005 +# video/vnd.iptvforum.2dparityfec-1010 +# video/vnd.iptvforum.2dparityfec-2005 +# video/vnd.iptvforum.ttsavc +# video/vnd.iptvforum.ttsmpeg2 +# video/vnd.motorola.video +# video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.ms-playready.media.pyv pyv +# video/vnd.nokia.interleaved-multimedia +# video/vnd.nokia.videovoip +# video/vnd.objectvideo +# video/vnd.radgamettools.bink +# video/vnd.radgamettools.smacker +# video/vnd.sealed.mpeg1 +# video/vnd.sealed.mpeg4 +# video/vnd.sealed.swf +# video/vnd.sealedmedia.softseal.mov +video/vnd.uvvu.mp4 uvu uvvu +video/vnd.vivo viv +# video/vp8 +video/webm webm +video/x-f4v f4v +video/x-fli fli +video/x-flv flv +video/x-m4v m4v +video/x-matroska mkv mk3d mks +video/x-mng mng +video/x-ms-asf asf asx +video/x-ms-vob vob +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +video/x-smv smv +x-conference/x-cooltalk ice From 0a08fd3853cb4dc294e408634428a349bad4a291 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:25:25 +0000 Subject: [PATCH 101/283] build(deps): bump the test-tools group with 7 updates Bumps the test-tools group with 7 updates: | Package | From | To | | --- | --- | --- | | [org.testcontainers:testcontainers-localstack](https://github.com/testcontainers/testcontainers-java) | `2.0.4` | `2.0.5` | | [io.netty:netty-buffer](https://github.com/netty/netty) | `4.2.11.Final` | `4.2.12.Final` | | [io.netty:netty-transport](https://github.com/netty/netty) | `4.2.11.Final` | `4.2.12.Final` | | [io.netty:netty-transport-native-unix-common](https://github.com/netty/netty) | `4.2.11.Final` | `4.2.12.Final` | | [io.netty:netty-common](https://github.com/netty/netty) | `4.2.11.Final` | `4.2.12.Final` | | [io.netty:netty-handler](https://github.com/netty/netty) | `4.2.11.Final` | `4.2.12.Final` | | [io.netty:netty-codec](https://github.com/netty/netty) | `4.2.11.Final` | `4.2.12.Final` | Updates `org.testcontainers:testcontainers-localstack` from 2.0.4 to 2.0.5 - [Release notes](https://github.com/testcontainers/testcontainers-java/releases) - [Changelog](https://github.com/testcontainers/testcontainers-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/testcontainers/testcontainers-java/compare/2.0.4...2.0.5) Updates `io.netty:netty-buffer` from 4.2.11.Final to 4.2.12.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.11.Final...netty-4.2.12.Final) Updates `io.netty:netty-transport` from 4.2.11.Final to 4.2.12.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.11.Final...netty-4.2.12.Final) Updates `io.netty:netty-transport-native-unix-common` from 4.2.11.Final to 4.2.12.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.11.Final...netty-4.2.12.Final) Updates `io.netty:netty-common` from 4.2.11.Final to 4.2.12.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.11.Final...netty-4.2.12.Final) Updates `io.netty:netty-handler` from 4.2.11.Final to 4.2.12.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.11.Final...netty-4.2.12.Final) Updates `io.netty:netty-codec` from 4.2.11.Final to 4.2.12.Final - [Release notes](https://github.com/netty/netty/releases) - [Commits](https://github.com/netty/netty/compare/netty-4.2.11.Final...netty-4.2.12.Final) --- updated-dependencies: - dependency-name: org.testcontainers:testcontainers-localstack dependency-version: 2.0.5 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-buffer dependency-version: 4.2.12.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport dependency-version: 4.2.12.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-transport-native-unix-common dependency-version: 4.2.12.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-common dependency-version: 4.2.12.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-handler dependency-version: 4.2.12.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: io.netty:netty-codec dependency-version: 4.2.12.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index fbb51d6b7e32..e54a3267e9c5 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -857,7 +857,7 @@ org.testcontainers testcontainers-localstack - 2.0.4 + 2.0.5 test @@ -877,32 +877,32 @@ io.netty netty-buffer - 4.2.11.Final + 4.2.12.Final io.netty netty-transport - 4.2.11.Final + 4.2.12.Final io.netty netty-transport-native-unix-common - 4.2.11.Final + 4.2.12.Final io.netty netty-common - 4.2.11.Final + 4.2.12.Final io.netty netty-handler - 4.2.11.Final + 4.2.12.Final io.netty netty-codec - 4.2.11.Final + 4.2.12.Final org.apache.velocity From f9468e6df913eed92e240d507fba97d3811b29b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:25:47 +0000 Subject: [PATCH 102/283] build(deps): bump the amazon-s3 group with 2 updates Bumps the amazon-s3 group with 2 updates: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.42.20 to 2.42.40 Updates `software.amazon.awssdk.crt:aws-crt` from 0.43.9 to 0.45.1 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.43.9...v0.45.1) --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.42.40 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.45.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index fbb51d6b7e32..f3b53bad28e8 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -739,7 +739,7 @@ software.amazon.awssdk s3 - 2.42.20 + 2.42.40 software.amazon.awssdk @@ -755,7 +755,7 @@ software.amazon.awssdk.crt aws-crt - 0.43.9 + 0.45.1 From f9f66549f72d0b4abe35182d4cfc7c87d39ab81f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:26:12 +0000 Subject: [PATCH 103/283] build(deps): bump the apache-commons group with 3 updates Bumps the apache-commons group with 3 updates: [commons-codec:commons-codec](https://github.com/apache/commons-codec), org.apache.commons:commons-configuration2 and commons-io:commons-io. Updates `commons-codec:commons-codec` from 1.21.0 to 1.22.0 - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.21.0...rel/commons-codec-1.22.0) Updates `org.apache.commons:commons-configuration2` from 2.13.0 to 2.14.0 Updates `commons-io:commons-io` from 2.21.0 to 2.22.0 --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-version: 1.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-configuration2 dependency-version: 2.14.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: commons-io:commons-io dependency-version: 2.22.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons ... Signed-off-by: dependabot[bot] --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..84b63ecc0b6a 100644 --- a/pom.xml +++ b/pom.xml @@ -1489,7 +1489,7 @@ commons-codec commons-codec - 1.21.0 + 1.22.0 org.apache.commons @@ -1499,7 +1499,7 @@ org.apache.commons commons-configuration2 - 2.13.0 + 2.14.0 org.apache.commons @@ -1509,7 +1509,7 @@ commons-io commons-io - 2.21.0 + 2.22.0 org.apache.commons From 1fb12c7c0ad50be7a33f657a5f050671ecffb89c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:28:45 +0000 Subject: [PATCH 104/283] build(deps): bump org.apache.james:apache-mime4j-core Bumps org.apache.james:apache-mime4j-core from 0.8.13 to 0.8.14. --- updated-dependencies: - dependency-name: org.apache.james:apache-mime4j-core dependency-version: 0.8.14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..474272eee1a9 100644 --- a/pom.xml +++ b/pom.xml @@ -1335,7 +1335,7 @@ org.apache.james apache-mime4j-core - 0.8.13 + 0.8.14 From f2a2bd4b6317e489d839d9cc75c6cfcfd930235a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:28:56 +0000 Subject: [PATCH 105/283] build(deps): bump github/codeql-action from 3 to 4 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v3...v4) --- updated-dependencies: - dependency-name: github/codeql-action dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/codescan.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index ba56b683a27d..327bcf7b9e39 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -47,7 +47,7 @@ jobs: # Initializes the CodeQL tools for scanning. # https://github.com/github/codeql-action - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: # Codescan Javascript as well since a few JS files exist in REST API's interface languages: java, javascript @@ -56,8 +56,8 @@ jobs: # NOTE: Based on testing, this autobuild process works well for DSpace. A custom # DSpace build w/caching (like in build.yml) was about the same speed as autobuild. - name: Autobuild - uses: github/codeql-action/autobuild@v3 + uses: github/codeql-action/autobuild@v4 # Perform GitHub Code Scanning. - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 From 3682abf5bd384b20007f7aa658ca591f3bf1b12d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:29:15 +0000 Subject: [PATCH 106/283] build(deps): bump com.github.spotbugs:spotbugs-maven-plugin Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.8.2 to 4.9.8.3. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.9.8.2...spotbugs-maven-plugin-4.9.8.3) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.9.8.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..d9fed393e9ee 100644 --- a/pom.xml +++ b/pom.xml @@ -296,7 +296,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.9.8.2 + 4.9.8.3 Max Low From 3e25875e9e6460dbed084d531adfa2d89d71f153 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:29:19 +0000 Subject: [PATCH 107/283] build(deps): bump xom:xom from 1.3.9 to 1.4.0 Bumps [xom:xom](https://github.com/elharo/xom) from 1.3.9 to 1.4.0. - [Release notes](https://github.com/elharo/xom/releases) - [Commits](https://github.com/elharo/xom/compare/v1.3.9...v1.4.0) --- updated-dependencies: - dependency-name: xom:xom dependency-version: 1.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- dspace-sword/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 7b43bd3765d8..3363a34e04e8 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -81,7 +81,7 @@ xom xom - 1.3.9 + 1.4.0 diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..384ac9479267 100644 --- a/pom.xml +++ b/pom.xml @@ -1814,7 +1814,7 @@ xom xom - 1.3.9 + 1.4.0 From 5ce08f392c9eafa4b257d98abbf8125f373ec884 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:29:26 +0000 Subject: [PATCH 108/283] build(deps): bump org.apache.ant:ant from 1.10.15 to 1.10.17 Bumps org.apache.ant:ant from 1.10.15 to 1.10.17. --- updated-dependencies: - dependency-name: org.apache.ant:ant dependency-version: 1.10.17 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..25e30e3e5634 100644 --- a/pom.xml +++ b/pom.xml @@ -1369,7 +1369,7 @@ org.apache.ant ant - 1.10.15 + 1.10.17 org.apache.jena From 9996db47c1155dbd9170bc335f5a792284665ec1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:30:04 +0000 Subject: [PATCH 109/283] build(deps): bump log4j.version from 2.25.3 to 2.25.4 Bumps `log4j.version` from 2.25.3 to 2.25.4. Updates `org.apache.logging.log4j:log4j-api` from 2.25.3 to 2.25.4 Updates `org.apache.logging.log4j:log4j-core` from 2.25.3 to 2.25.4 Updates `org.apache.logging.log4j:log4j-1.2-api` from 2.25.3 to 2.25.4 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-version: 2.25.4 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-core dependency-version: 2.25.4 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-1.2-api dependency-version: 2.25.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..aa08114d3b9e 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,7 @@ 1.1.1 9.4.58.v20250814 - 2.25.3 + 2.25.4 3.0.7 1.19.0 1.7.36 From 157e2a203f9c2e63761df448a16ae9e46d9c5df3 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 4 May 2026 16:46:07 +0300 Subject: [PATCH 110/283] pom.xml: bump com.google.guava:guava to 33.6.0-jre (cherry picked from commit f82f3f3aaea7dba9ff2186bb84391f9a2ec11323) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..995cb7f13a65 100644 --- a/pom.xml +++ b/pom.xml @@ -1802,7 +1802,7 @@ com.google.guava guava - 32.1.3-jre + 33.6.0-jre From 12b0d7e27498ae09e2754a61700a2faff2cf5d1e Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 6 May 2026 09:29:18 +0300 Subject: [PATCH 111/283] pom.xml: bump postgresql.driver.version to 42.7.11 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e7e7f1569e8f..8d354544f4d8 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 5.7.14 5.6.15.Final 6.2.5.Final - 42.7.10 + 42.7.11 8.11.4 3.11.1 From 882dfaf12e4fd0358bd3d8fc8d909448cb22161c Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 6 May 2026 09:30:36 +0300 Subject: [PATCH 112/283] pom.xml: update comment about org.checkerframework:checker-qual Both com.google.guava:guava and org.apache.solr:solr-core depend on org.checkerframework:checker-qual, but org.postgresql:postgresql no longer does. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8d354544f4d8..41bbde03a94d 100644 --- a/pom.xml +++ b/pom.xml @@ -1804,7 +1804,7 @@ guava 32.1.3-jre - + org.checkerframework checker-qual From 9eb9d88c9722f51ce714acfef056190ec0819c0d Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Thu, 7 May 2026 16:55:28 +0200 Subject: [PATCH 113/283] Address Open Policy Finder PR review feedback Configuration fixes (autavares-dev review on 2026-04-28): - item-submission.xml: in the traditional-edit submission process, update the disabled step from "sherpaPolicies" to "opfPolicies" (one occurrence the original rename commit missed). - external-providers.cfg: comment out the empty default "openpolicyfinder.apikey =" so the documented fallback to the legacy "sherpa.romeo.apikey" property keeps working. An empty value here was treated as set by ConfigurationService and overrode the fallback. - openpolicyfinder.xml: add "dc.identifier.issn" to issnItemExtractors, matching the bean definition in spring-dspace-addon-openpolicyfinder-services.xml and the test fixture. Without this, ISSNs entered in the standard dc.identifier.issn submission field were not picked up by the opfPolicies step. OpenPolicyFinderService bug fixes (Micheleboychuk review on 2026-04-17, all three predate this PR and were inherited from the legacy SHERPAService): - Add "continue" after the non-200 error log in performRequest and performPublisherRequest. The error body is read with IOUtils.toString, draining the response stream; falling through to the JSON parsing block then threw "Attempted read from closed stream". - Wrap Thread.sleep(sleepBetweenTimeouts) in "if (numberOfTries > 1)" so the configured inter-retry delay is no longer paid on the first attempt of every request. - Remove the local "int timeout = 5000" in constructHttpGet that shadowed the instance field and silently ignored setTimeout(). The configured "openpolicyfinder.timeout" property now takes effect. The further refactor suggestion (deduplicate performRequest / performPublisherRequest and inject LiveImportClient) is intentionally not part of this commit - it is a structural change to a hot path with broad test coverage, and the PR is already large. Tracked as a follow-up issue. --- .../OpenPolicyFinderService.java | 23 +++++++++++++------ dspace/config/modules/external-providers.cfg | 5 +++- dspace/config/spring/api/openpolicyfinder.xml | 1 + 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java index c3146f4b218c..ca88c082dc95 100644 --- a/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java +++ b/dspace-api/src/main/java/org/dspace/app/openpolicyfinder/OpenPolicyFinderService.java @@ -140,7 +140,9 @@ public OpenPolicyFinderPublisherResponse performPublisherRequest( sleepBetweenTimeouts)); try (CloseableHttpClient client = DSpaceHttpClientFactory.getInstance().buildWithoutAutomaticRetries(5)) { - Thread.sleep(sleepBetweenTimeouts); + if (numberOfTries > 1) { + Thread.sleep(sleepBetweenTimeouts); + } // Construct a default HTTP method (first result) method = constructHttpGet(type, field, predicate, value, start, limit); @@ -157,6 +159,9 @@ public OpenPolicyFinderPublisherResponse performPublisherRequest( "Open Policy Finder return not OK status: " + statusCode); String errorBody = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); log.error("Error from Open Policy Finder HTTP request: " + errorBody); + // The error body has consumed the response stream; skip the JSON parsing block + // below (which would otherwise throw "Attempted read from closed stream"). + continue; } HttpEntity responseBody = response.getEntity(); @@ -248,7 +253,9 @@ public OpenPolicyFinderResponse performRequest(String type, String field, String sleepBetweenTimeouts)); try (CloseableHttpClient client = DSpaceHttpClientFactory.getInstance().buildWithoutAutomaticRetries(5)) { - Thread.sleep(sleepBetweenTimeouts); + if (numberOfTries > 1) { + Thread.sleep(sleepBetweenTimeouts); + } // Construct a default HTTP method (first result) method = constructHttpGet(type, field, predicate, value, start, limit); @@ -265,6 +272,9 @@ public OpenPolicyFinderResponse performRequest(String type, String field, String "Open Policy Finder return not OK status: " + statusCode); String errorBody = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8); log.error("Error from Open Policy Finder HTTP request: " + errorBody); + // The error body has consumed the response stream; skip the JSON parsing block + // below (which would otherwise throw "Attempted read from closed stream"). + continue; } HttpEntity responseBody = response.getEntity(); @@ -378,12 +388,11 @@ public HttpGet constructHttpGet(String type, String field, String predicate, Str method.addHeader("x-api-key", apiKey); } - // Set connection parameters - int timeout = 5000; + // Set connection parameters (uses the configured timeout from the openpolicyfinder.timeout property) method.setConfig(RequestConfig.custom() - .setConnectionRequestTimeout(timeout) - .setConnectTimeout(timeout) - .setSocketTimeout(timeout) + .setConnectionRequestTimeout(this.timeout) + .setConnectTimeout(this.timeout) + .setSocketTimeout(this.timeout) .build()); return method; diff --git a/dspace/config/modules/external-providers.cfg b/dspace/config/modules/external-providers.cfg index 614527e7f61b..b1aed06b6797 100644 --- a/dspace/config/modules/external-providers.cfg +++ b/dspace/config/modules/external-providers.cfg @@ -114,5 +114,8 @@ openpolicyfinder.url = https://api.openpolicyfinder.jisc.ac.uk/retrieve # API key for the Open Policy Finder API # Existing SHERPA/RoMEO API keys have been automatically migrated. # For new keys, see: https://openpolicyfinder.jisc.ac.uk/help/developers -openpolicyfinder.apikey = +# Leave this property unset (commented out) so that, if a site still defines the +# legacy sherpa.romeo.apikey in local.cfg, the fallback in OpenPolicyFinderService +# can pick it up. An empty value here would override the legacy fallback. +# openpolicyfinder.apikey = ################################################################# diff --git a/dspace/config/spring/api/openpolicyfinder.xml b/dspace/config/spring/api/openpolicyfinder.xml index e8ce89affbcb..a30e0df20a9b 100644 --- a/dspace/config/spring/api/openpolicyfinder.xml +++ b/dspace/config/spring/api/openpolicyfinder.xml @@ -19,6 +19,7 @@ creativeworkseries.issn + dc.identifier.issn From 87eb14498e22432fe3fe1cf7863f9767cba12158 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 20:14:51 +0000 Subject: [PATCH 114/283] build(deps): bump jaxen:jaxen from 2.0.0 to 2.0.1 Bumps [jaxen:jaxen](https://github.com/jaxen-xpath/jaxen) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/jaxen-xpath/jaxen/releases) - [Commits](https://github.com/jaxen-xpath/jaxen/compare/v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: jaxen:jaxen dependency-version: 2.0.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8923ee7e0f0c..0ee4bc7f0d57 100644 --- a/pom.xml +++ b/pom.xml @@ -1563,7 +1563,7 @@ jaxen jaxen - 2.0.0 + 2.0.1 org.jdom From efae0ed8dc370256111682913a8922a0abd25c06 Mon Sep 17 00:00:00 2001 From: Stefano Maffei <48757042+steph-ieffam@users.noreply.github.com> Date: Fri, 8 May 2026 15:55:56 +0200 Subject: [PATCH 115/283] [DURACOM-477] Fix slow loading times when caching counts for items (#12344) * [CST-25040] make cache count for items in collections/communities Asynch * [CST-25040] fix cache implementation * [CST-25040] fix cache implementation * [DURACOM-477] cleanup (cherry picked from commit 36b3f5c6cc577a8d5e0c66dd4c0787e28849b689) --- .../org/dspace/browse/ItemCountDAOSolr.java | 119 +++++------------- dspace/config/spring/api/core-services.xml | 2 +- dspace/solr/search/conf/schema.xml | 2 +- 3 files changed, 32 insertions(+), 91 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java index e4d0079fe20b..723b49d63aea 100644 --- a/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java +++ b/dspace-api/src/main/java/org/dspace/browse/ItemCountDAOSolr.java @@ -7,121 +7,62 @@ */ package org.dspace.browse; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - +import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.solr.client.solrj.SolrClient; +import org.apache.solr.client.solrj.SolrQuery; +import org.apache.solr.client.solrj.response.QueryResponse; import org.dspace.content.Collection; import org.dspace.content.Community; import org.dspace.content.DSpaceObject; import org.dspace.core.Context; -import org.dspace.discovery.DiscoverFacetField; -import org.dspace.discovery.DiscoverQuery; -import org.dspace.discovery.DiscoverResult; -import org.dspace.discovery.DiscoverResult.FacetResult; -import org.dspace.discovery.SearchService; -import org.dspace.discovery.SearchServiceException; -import org.dspace.discovery.configuration.DiscoveryConfigurationParameters; +import org.dspace.discovery.SolrSearchCore; import org.dspace.discovery.indexobject.IndexableItem; import org.springframework.beans.factory.annotation.Autowired; /** * Discovery (Solr) driver implementing ItemCountDAO interface to look up item - * count information in communities and collections. Caching operations are - * intentionally not implemented because Solr already is our cache. + * count information in communities and collections. + *

    + * Counts are computed by querying Solr for archived, non-withdrawn, discoverable + * items using {@code location.comm} / {@code location.coll} filters. + * The query returns only {@code numFound} (rows=0), making it very fast. */ public class ItemCountDAOSolr implements ItemCountDAO { - /** - * Log4j logger - */ - private static Logger log = org.apache.logging.log4j.LogManager.getLogger(ItemCountDAOSolr.class); - - /** - * Hold the communities item count obtained from SOLR after the first query. This only works - * well if the ItemCountDAO lifecycle is bound to the request lifecycle as - * it is now. If we switch to a Spring-based instantiation we should mark - * this bean as prototype - **/ - private Map communitiesCount = null; - - /** - * Hold the collection item count obtained from SOLR after the first query - **/ - private Map collectionsCount = null; + private static final Logger log = LogManager.getLogger(ItemCountDAOSolr.class); - /** - * Solr search service - */ @Autowired - protected SearchService searchService; + private SolrSearchCore solrSearchCore; - /** - * Get the count of the items in the given container. - * - * @param context DSpace context - * @param dso DspaceObject - * @return count - */ @Override public int getCount(Context context, DSpaceObject dso) { - loadCount(context); - Integer val = null; + String locationFilter; if (dso instanceof Collection) { - val = collectionsCount.get(dso.getID().toString()); + locationFilter = "location.coll:" + dso.getID().toString(); } else if (dso instanceof Community) { - val = communitiesCount.get(dso.getID().toString()); - } - - if (val != null) { - return val; + locationFilter = "location.comm:" + dso.getID().toString(); } else { return 0; } - } - /** - * make sure that the counts are actually fetched from Solr (if haven't been - * cached in a Map yet) - * - * @param context DSpace Context - */ - private void loadCount(Context context) { - if (communitiesCount != null || collectionsCount != null) { - return; - } - - communitiesCount = new HashMap<>(); - collectionsCount = new HashMap<>(); - - DiscoverQuery query = new DiscoverQuery(); - query.setFacetMinCount(1); - query.addFacetField(new DiscoverFacetField("location.comm", - DiscoveryConfigurationParameters.TYPE_STANDARD, -1, - DiscoveryConfigurationParameters.SORT.COUNT)); - query.addFacetField(new DiscoverFacetField("location.coll", - DiscoveryConfigurationParameters.TYPE_STANDARD, -1, - DiscoveryConfigurationParameters.SORT.COUNT)); - query.addFilterQueries("search.resourcetype:" + IndexableItem.TYPE); // count only items - query.addFilterQueries("NOT(discoverable:false)"); // only discoverable - query.addFilterQueries("withdrawn:false"); // only not withdrawn - query.addFilterQueries("archived:true"); // only archived - query.setMaxResults(0); - - DiscoverResult sResponse; try { - sResponse = searchService.search(context, query); - List commCount = sResponse.getFacetResult("location.comm"); - List collCount = sResponse.getFacetResult("location.coll"); - for (FacetResult c : commCount) { - communitiesCount.put(c.getAsFilterQuery(), (int) c.getCount()); - } - for (FacetResult c : collCount) { - collectionsCount.put(c.getAsFilterQuery(), (int) c.getCount()); + SolrClient solr = solrSearchCore.getSolr(); + if (solr == null) { + return 0; } - } catch (SearchServiceException e) { - log.error("Could not initialize Community/Collection Item Counts from Solr: ", e); + SolrQuery query = new SolrQuery("*:*"); + query.addFilterQuery(locationFilter); + query.addFilterQuery("search.resourcetype:" + IndexableItem.TYPE); + query.addFilterQuery("NOT(discoverable:false)"); + query.addFilterQuery("withdrawn:false"); + query.addFilterQuery("archived:true"); + query.setRows(0); + QueryResponse response = solr.query(query, solrSearchCore.REQUEST_METHOD); + return (int) response.getResults().getNumFound(); + } catch (Exception e) { + log.error("Error counting items in Solr for {}: ", dso.getID(), e); } + return 0; } } diff --git a/dspace/config/spring/api/core-services.xml b/dspace/config/spring/api/core-services.xml index be0e5977ede4..3bde95cc07fe 100644 --- a/dspace/config/spring/api/core-services.xml +++ b/dspace/config/spring/api/core-services.xml @@ -32,7 +32,7 @@ - + diff --git a/dspace/solr/search/conf/schema.xml b/dspace/solr/search/conf/schema.xml index 5c79519159a4..1caaf1efe1ad 100644 --- a/dspace/solr/search/conf/schema.xml +++ b/dspace/solr/search/conf/schema.xml @@ -276,7 +276,7 @@ - + From cf1a2d7b3c828add6208e1e5772363a471c8e4d1 Mon Sep 17 00:00:00 2001 From: milanmajchrak Date: Thu, 16 Apr 2026 14:06:28 +0200 Subject: [PATCH 116/283] Fix SWORDv2 deposit with embargo for non-admin submitters (cherry picked from commit cf6e027e0314bc6b11f3796e360ecd4415749b54) --- .../packager/AbstractMETSIngester.java | 20 +++++++++ .../java/org/dspace/app/sword2/Swordv2IT.java | 42 ++++++++++++++++++ .../org/dspace/app/sword2/example-embargo.zip | Bin 0 -> 11982 bytes .../CollectionDepositManagerDSpace.java | 3 ++ .../sword2/SwordMETSContentIngester.java | 9 ++++ 5 files changed, 74 insertions(+) create mode 100644 dspace-server-webapp/src/test/resources/org/dspace/app/sword2/example-embargo.zip diff --git a/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java b/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java index 0ab5ac71cda5..68383f1d9e74 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java @@ -25,6 +25,9 @@ import org.apache.logging.log4j.Logger; import org.dspace.app.client.DSpaceHttpClientFactory; import org.dspace.authorize.AuthorizeException; +import org.dspace.authorize.ResourcePolicy; +import org.dspace.authorize.factory.AuthorizeServiceFactory; +import org.dspace.authorize.service.AuthorizeService; import org.dspace.content.Bitstream; import org.dspace.content.BitstreamFormat; import org.dspace.content.Bundle; @@ -127,6 +130,10 @@ public abstract class AbstractMETSIngester extends AbstractPackageIngester { protected final ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); + + protected final AuthorizeService authorizeService = AuthorizeServiceFactory.getInstance().getAuthorizeService(); + + /** *

    * An instance of ZipMdrefManager holds the state needed to retrieve the @@ -763,11 +770,24 @@ protected void addBitstreams(Context context, Item item, bitstream.setSequenceID(Integer.parseInt(seqID)); } + // Get TYPE_SUBMISSION policies before removing them in the `manifest.crosswalkBitstream` method. + List bitstreamPolicies = + authorizeService.findPoliciesByDSOAndType(context, bitstream, ResourcePolicy.TYPE_SUBMISSION); + // crosswalk this bitstream's administrative metadata located in // METS manifest (or referenced externally) manifest.crosswalkBitstream(context, params, bitstream, mfileID, mdRefCallback); + // Only add the saved TYPE_SUBMISSION policies if the crosswalk actually removed them to prevent duplicates. + if (!bitstreamPolicies.isEmpty()) { + List remainingSubmissionPolicies = + authorizeService.findPoliciesByDSOAndType(context, bitstream, ResourcePolicy.TYPE_SUBMISSION); + if (remainingSubmissionPolicies.isEmpty()) { + authorizeService.addPolicies(context, bitstreamPolicies, bitstream); + } + } + // is this the primary bitstream? if (primaryID != null && mfileID.equals(primaryID)) { bundle.setPrimaryBitstreamID(bitstream); diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java b/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java index f24a09c8e563..ba9f6c40520e 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/sword2/Swordv2IT.java @@ -190,6 +190,48 @@ public void mediaResourceUnauthorizedTest() throws Exception { assertEquals(response.getStatusCode(), HttpStatus.UNAUTHORIZED); } + /** + * There should not be any Internal Server/Authorization error when uploading a new Item with embargo + * The embargo is defined in the `mets.xml` of the `example-embargo.zip` file + */ + @Test + public void depositItemWithEmbargo() throws Exception { + context.turnOffAuthorisationSystem(); + // Create a top level community and one Collection + parentCommunity = CommunityBuilder.createCommunity(context) + .withName("Parent Community") + .build(); + // Make sure our Collection allows the "eperson" user to submit into it + Collection collection = CollectionBuilder.createCollection(context, parentCommunity) + .withName("Test SWORDv2 Collection") + .withSubmitterGroup(eperson) + .build(); + // Above changes MUST be committed to the database for SWORDv2 to see them. + context.commit(); + context.restoreAuthSystemState(); + + // Add file + LinkedMultiValueMap multipart = new LinkedMultiValueMap<>(); + multipart.add("file", new FileSystemResource(Path.of("src", "test", "resources", + "org", "dspace", "app", "sword2", "example-embargo.zip"))); + // Add required headers + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.MULTIPART_FORM_DATA); + headers.setContentDisposition(ContentDisposition.attachment().filename("example-embargo.zip").build()); + headers.set("Packaging", "http://purl.org/net/sword/package/METSDSpaceSIP"); + headers.setAccept(List.of(MediaType.APPLICATION_ATOM_XML)); + + + // Send POST to upload Zip file via SWORD + ResponseEntity response = postResponseAsString(COLLECTION_PATH + "/" + collection.getHandle(), + eperson.getEmail(), password, + new HttpEntity<>(multipart, headers)); + + // Expect a 201 CREATED response with ATOM "entry" content returned + assertEquals(HttpStatus.CREATED, response.getStatusCode()); + assertEquals(ATOM_ENTRY_CONTENT_TYPE, response.getHeaders().getContentType().toString()); + } + /** * This tests four different SWORDv2 actions, as these all require starting with a new deposit. * 1. Depositing a new item via SWORD (via POST /collections/[collection-uuid]) diff --git a/dspace-server-webapp/src/test/resources/org/dspace/app/sword2/example-embargo.zip b/dspace-server-webapp/src/test/resources/org/dspace/app/sword2/example-embargo.zip new file mode 100644 index 0000000000000000000000000000000000000000..ff1273679b88fb5292974a21d6a35b74ec0d42b7 GIT binary patch literal 11982 zcmZ{~V{jz^6Qv#Acw*bOor!JRwsm7pjEQaAoH&`-$;7su+$8(H-&eJ}RlD0=)u+0< z&j0h{QI>;*!TINT>tnS0q&IK}&(GqrM(|`Nr`rD^8&_>`KP0JV0T;>BQ$s~UW!Qn) zlaSC88gjNk1YtGk0hU-etiIYQv4X05&?k(WY&R=ErMbFd5PB6w$!fKF6mSVInYaD3 z4t#gcry8Md1{Pb(Gd!j)@0#dm(ci3Jm+I<=LExb##d($zrIu#7tN3n;hjD1P0HiuEQ7?-W94JP`1tsCUnKEiW*`wC zAN!daSVOSU>Cw^2$)#KNK?^=}dOM1lyUt@^O%8mVzld=OR0TUS$ zfANF-vUYzgh?`=lvA-lJ5E&s2%8L&U&P&=$U*27$x#j&cKI#5ik}ULqDo35B_T~TA zi@4Vklby!yu>W5SwpJ&hb3&ZK?kVfQ0a~)^0$Wp+?KxhS?!Oae96Vejj!yUK^LHe> z?CiD~raH%KqCCUkp97?YCVO7j!clQCO49Papu_g^S++bY%U+-C^zXV|;9jIs{v!}b=UX<5)9Kho1!cAM;>;5oLXR` zXyyJU0l8jz&3@&Xy?o^he3YAg-`gSXnioJ~Cj?^$L8RI_C6@$$pL!(nzN|DKbaBbG z+3w^Wb#QBHjcKMqx9Q>Jn*~GH@$$`q{fJ0Aa~KB$FpEL{o5Lex6n9E;MwkTquAB%R z=U6|vL8_}*y~MjmXE|IHkV+IBujVKy3<3~D&TNzQsbkpj=FJqbtBBQFmuSu|1dV)! zZs(YsB!#NIs1pEhS#s!fTW4ztia8r(y(J-=CY#i}w6D>XEX_MezI( zvPHr#IT_|F_SMPS4VKpg4@(Y_d{bG-Q@3#<4iYY`NRm5-p(uY2;~!M_N*7sPX`+vO zJ1V15OO6C&6MplDSwNsjW8#a|Z_!H!BDt|xozsj}w({S=%@>Nr<9cRS&a z^YGGF$2awm1WUJ#vttzG; z`Hiq?pI1=EBBI(@kPX!lbrBY_>l%c#3oG-Xog;1rV69)#1B6BFwCY9Qyi4#AC#IW|P_ScSmiVvDpRkj! zN;pNGmb+#nNWsjh(X!|8NQp(@u@}?rtt9)ueSMsg4?T}ZMZC)sehxefdk!KQW$^m5fI?(!GuK(Q&Vfak6GEL2u;xQ`h^m!1#X6M9-M76(%2*ToK?#XXBndmD@+x}p zUrY#rmR=!o0B29A5Pol{XzVg@D0=hed-L&IyYXwjyjdJSvHb^gV{OgQ31l<$qN0FJ=DKq&!d3m2AyUUYg~9nzp1sX@zi?Ng znF1EsDSGTpS`G`#g)fj~yNP;oDs)l`9{Iy{l95a*`)apg$nc-%6@;r%qOB&s718TY zD@C)r3hsAz%qq|_~EDJ5>-dM6XHD~RaY9Ax?= zzn5~UBnZP!kO|)018%PM6<~0`rZsclQyAI?;dpVLI&$I6V`}381s^P{3yHH`#s_G-l0GeH z9{gq(;xU=90$9in2O%v<*BcxN$U6P7f(}UHX#J4_Jt?My9aLOzSG4A$&OCB zazwHsAEB$c1qVAu(0nldv^v-iaLLbc8^bsm%m z7W$^ndvQZsGaB`r8`O#SOTmA*AE#o^tyQ2{cJi8onozjj#r?S7nrPBQ+XPX7HlHbo zN!h;zjp9`l+ARmG8OKAlF+5L7Nb{k$b}ku^D+S{(@2~_Vao&;Rxshdl0e*FFZZTsF zc}Xy_46Rb_S^k)zda?*^TyAVu4RL6u9b&8uk*wPv9QaTGnlMMy4uxD~PA_(>M%jlZXQdcK z0gG@yNrJ@FCH-T;6cL2+r3Y5gvyMu94B{Jh= z_o{(O9Q4q%hTRUJ*#kqZX&~f65%>ip`qWPWY+CHR(EbyrZ^MDc=0i%zGBGsiLvvT{ zQ9$@og?1mOK!&Vu#3Y{y@MXaSy=n9a`1(o(JuxAipo^G?@ zys~3;8DS(TT>H;_zGRXbXO+K@@^x{5MMyDiNwydJMp@CS(U2Yc2bvw)un;H*IfV8H zt3JxSKC0scLPtgw<3_4*f_!W4)^J&;gCwx(FO$r+IDM4@rCTkZ7J^PFn|*IYMb5=@ zUs*{$+2pnC&-UGIM1WR`?Co6JJ{ zSC4o>hd0A;$25;9F zoy}t9P?Tsuik+GNwnjt>vLvP5STt|0K;I-%1yRr|WcdF|a9_r{f4aAUyOYiRXs(Em z0KJ_5Q%#K@MeR;Mh?q)W+2B};17^d~Xjcn-KQ~U2<>)J~zAjnCV4MGI`pZ~$QQzZ} zP1yF#x5>$);Jf>vV*+-X2r?agzyXdL26Rx;dGow12+jczPi576Je(|1zxM=2 z9)BL7flz@~$&yPejdy4@nn?^;3_eWRY7qKT3Ao8#IK3HdIF#}vJdOR!TxP|Oj0EIv zH0)Dvz=dVUH_S|A5tt?U_^a_Ns;B4TB=Af^9p8dCqd(j`$S;e?%~Bztces^rKbS4S zUmh}M{BPB&axl2pm%`b~E^N|Gy1CXW2ZP;3a^;x9Puq-(MTK=nDX#1w3cu`XfcP6J z%YBWHS%vgvMACuwOxoJ5EWd7~G+Gjy??TT~zkU;z=~)d_0t(0b4RCDIB9BSDB?N=?T0(6n{@KtxGQ`lFrsUp7uc*8L{JXDz|q z=={6^#lqi{iz5mYn7*=@8=6?fY=W?|uH_v(VS{8JVRKX6ENJF_r!DS|L^1429zds; z$5!}Izp`0uZPJn5M&W5TEZH|<dD zHTO@%u^`m(@%F@Ol3pyo^ca1B4Y7<)wt0|CzQiShF-$XdJj#;^-%{V%G&+fY4WemV ztIXJUT+2(_q5WUXd9cK-LwjnQWy2#p=$A5HP0kYfG zs*(oW!q^sUQjh?Lrj8q_U4lB-Gfp`3gH1dfR|&}+L*h(yKs6IVgacO2sIi9%-(=~kH zMuo{a6tzKA*ZL0f5JD!u*jL0~b-vUKJm;J!BCzmA85<<8sm^BQ&is^BTiIDK?!ebH zl!#}RO7=v>aCEn49cl5Ix;j`OqU|uJ^r{h;^4#WW@6|qPy0ubt@pqCIq2$xRtrK?s z&dXcEf7F`mD-K*6LvZ+8Kok<3R38Z`Z->tmvR#BrqoqvJW-0HUZ_p>{k@wK?NjzF!;U;Sql*ct0ReCT)u?{J3Ewt&3C(n>`LMICgVj!vHxD59=gdf~Wx?4xM5;xMp#fqE%!ZjW$sjUz9xy zJP-S*nxobWw(KmBjGL2il9PsgoB++PB8Yop~Vl3{e@qsr4`pwQu0qwG(dMk_nx#Ol>7TyMo;aTYD_4&2au(Mi#E zFcb;yfhRtAcJf73VMSswF!RJb$a8b z1b%rBXaaGHyfw!C&l zL?rq-lW*eAW~L6fB0h(-eLfj%IpSB5uv!^A2=kT%ZgGt3_o{t4o@IY0f>h*B$vj}9 zoL|i}2WTG0TJmJ5$xuKf?kqv`U4&wu9bY6>LoBMH0O#6077DP~jSndsk^Ag&)<%h5 zp?O3TVrel^xP*Qa3!O`9(cxjbK`9kXbBFKE{EXbz;w2p3!Bl1H0FL71r7)Gm`U)sD zxyF^UZT0S25<&bB7d1ZSJK2QLA?qTg#olR`C&Gu`^G*haJ~|mv)tXn(2WpEqd}pr( zqj#^iqsL>b&0q#re=%TD0Y6;~b>)g9NJ&an$~^uc=D0!0CMtE0$0sgq)>i_tR7`-swIzpfOIw zg>eHg`ZL#vcg>u7I&p_d=O~CY&?wFwI!#;`dmL*cFrrS12$vzqmo2&!jsMvEk;I&G za2`sfQ1yoMfqMNVR*9&{l}q{U<)+J*%!Lx1fD4<=HeVG_HNmk$NXU;~SHKF^Eb0!g zy^efgPx3e;51(8Sg4A<1|D=VO8vQnE*k6E5hx6&jMf2_b-OI&n2}dX6O`Ajqu~;Uo zd;inGrZ1)g)hWG9Vqj&i^|xs4y*m>vNCHG98t;Zev zos1x)ih`YRE#j`FvR}CQC!`P=h~u%COOAUb#`|1m1$wfL^bRWTSgAM#?RQ1b#0z@n zCM_LuvE3_y=^|;W`gycX(ceo1<|~+dwB-iRWyTd+&Q!@ z3EO=_SDpN0V^+)3A2NK8q@;qs0K;&oSQCf&8NCj8DELBKwnQn6QUc7XJDNx29H#Ym z3%mqQJN>-c*Mq99#B-js)SMlrleCY^seQtJ7n3 z(gGkaKWx@3fxF#w`Y!&incT;n-}R=7y_PE%o#)Jhm!r_zQ#IuFmdupVCH_aGbnEsN zr%uC%53JwC+pKLJlBqvz?Dz;>6#b(*@Ok3v@rbAxv(PhbW`DHAPenmPcz05OoUWGR zPxNj?X06K+iuaX)g$mUA3x<7}UjH_@L4P4C`t*hh+E%b8uJ3MKVimjKty297vta$5 zS&T1`=&v*Y4y#(Uns@cr`a}tBq3a?~((3rw@!_s|_G7T(8FzkZE+|2`TOshJu@l=T zIXO}@mt+G)w?EvT7G119Y}4+*t4?5SIy#qu-1S~Rbf6MAuc{=%CenvB;C*9Xu^Hg z_UBAp$)k?#$d9ohggr6<2Z_K;M&Pv6g0sopF5f`82Fbn@gB#P)cB#|=R} zq;(2;VBl8LdcD2?6{{yXH*=1xfSj*Akuh1G8>VCLww8lf0M3c=KX)rydj{E|s>_iN z;2njS!B&_WPO~-EeJ5g$Uo-A-VHy078=j?etr~C8;Cl8@s+EKEUZN@cArrw(UYO7m zX1nLnhWHEZ1mtgb8FZ{NREqixm^L(_-R9?GHx0b%jOh#YP_-f?tSPV^qTba$jNiHO zfT&}Z;1XU436nI+xWa)~ATwZ{X*p^$Q@0TOT_yp#eJb0P$lOGiwhzCo*GI#qqcIw8 zDkE_$qrk)0?lKpmY2TC&q4US)lDM;)*xwF2_$cWdmGJEi=eiw?``<@>oaf{%BMW{J zV~MXyN%y;YTHZe@*x^a6b?D;VrUFeP21|$y&My~A?d`-Cnf{h}<+_GHivMgZ_r3C!v<^0#Jei+JBVsQkN!NQ%l&YwUQy)Kx z3p*uuwi|7Xuh7qhX`AfPN1{P6$@>Se+L~3vQM)1?%Mn!)9O)xY_#i8)zYkvzSj}8I)pr!N9WO|US=osEyUX_J z{VenNVl0_^a`Pi!UVX0JD4XQOYnijBhmdq#v?DXc$`OkBibk}e;ye}r3OZ`pY51$kedm5V;P4(lCW*^qh8MpaeQNybixA?My zdV*AcWt0_w8Q$6e!g_Ne$t1|*JYo$z3ge?5B@=OkiI^l24knU_&si%1$38Ev-^klh zsC!;_yS|?sHVioHgCr~Ej!NB$=G|4~MIePdGw;MPB_l1u9DN~gn`vkW7_3j`DgKt( z+<2ovVA&LdyhR#naL{16idCfErs?(ja~Pe!iL=0}K9VjPx;GYf{!}WR)@isGQ_X#c z;KtZ6G_KQlj)S**tn$puEHT^lzT#0$!`HqAQ2&H4p?#M&BD}e9K~4ruqId-Ja+#bA zdZbvS5at%H#Q59V87@w@Cf5tgYsPO(gy*}2*Y)`TrX@U5dGwYMZ!i?_rmWV1I?=Oz zY~QwraI_c3X6-SF7+5@uoKI*Pou=8qXH!V^-tq|?U!A6W+33UkxUSmCx#T0*IwUv;TIqqA0Hv%Sku80v7gJ8Z(eB4U;Ju z)jaIbs4j6g;6deA18P5(4IChm*bH;z-w<;3>4*I3WbAO~#pcM0S3_1UY!}6!=bN9# zSVK8An`ov`%QX%;;)2lqDj$OAUjsj~>$Ap%NxiCQdblY^*S^NTZYw^fMz_3O%iAC@ z|ERvzQZ_zdvL2{xkLMFx2eoa+%X27YL?PYO2<#O8$w| zZd+>I`nA99Ooaw+!rRE*cduhvG;H#FSqBUOb}M(wQxa?ectR|A zs^7m;95b2C9fnwqU`pSCrB}H`q&5czZD;Ym=XXism3G+vQKHjq%>p^ad4{>!fXrFM zgu9#^C8JAXll-RT{t!HdOQqjwPu(W25Akaa(P45t?h0`Q_Czp8BB^y}Ek6pnr2L0x z-w-rnR!^z4Tf}$gio}ryB@tpJ;-=dagvq}B3Jl}(Wo+LKL3swx=ED%99oNS-br8=y ztLnaY+F!c%i~1p;{#&}(w{w&f=W>>~9+ibl zVSgosxJ~4Rd`_&$pS{h&C-8!aw>im;7nU;O%a5#wYwuOKPZ-d)XP$JY%uj|NIPJ?5 zU^#)B^?yi_?dmls6{^sr7Up-dWAVIn*lk2Io~$Puumb9T;;$fD^mn?0LaGy#vTIc~ z`UEXdQBO%+?mqetN|7=u?BV?(9)gX&&+(1x)RcU$3G086X7l*LTQV{m*2SfaZo|s- zq;KEDrqv?peai4KxY{`P*wi;mYs#pWN~ugIn{;!@ynoi)!ba$v@>I3H@v*Y*h@BPH z)|q>m&sS_XxtOXKDZJzqllJ)mvcuAZQ}`)Cv<}<+XvNw2XNU!>u0Ri(PoR-2T6t!r z>9EA+JX9-E5veWqu{GI`{6N)8_DO;#e8Nk*R90m90otaz@K(NxSgMY-*9UaVn?LMuZfDZ6=LprX!04#rayJE;)h>*m-{0w>bNH zx8&RPKZ_bR_L-Ib!aYB4G*kFJVo{gNAtup80x&<^wWZ!3i_bCqt-xkO zHa+jdy9i>oO?MWOYi91&;3x{tSc0zf z6eTLcbz00y*yjZyzOnqMnYeac)XRX8AM1~~dF0s|LxU*7uQN7^c6@`MnU&syKp^;4 zjagJmteG0)ob!)E4?^sc8kxUBlZfuqn9)vssrD@DWI`prte4lt88vX@4CLFovT83i z9yV(+TN)s9o8yVRt0J;r0i#5lfr}N!x0A&V7=k8Ftj@hrYqhmX6lGA`L(?GTFivBYQG)}bj`@EUztMw`&I8VGT-TX%#kTY-AVZ* zhiZOeYNlbEEm5VXQ8aHcL_9m!DNAZuZa3Eq1;WM`lsXPCm|sZFtui}dk=@oJ7S?Vr zq=~|Yqk*?P*KE(jZIku+%QRu@WrZIws?SBcSmqw#x33q7bUJa9cYg%N*c>{6mo538 zq-M3gV6Gt$Mye!aECR;9M(R;HRCNrZ(Ta6BUaA+l{mHynkbq-3wk>cgwHn{TgYO}qQC=E8f`&s64>Ax|@L+;MSg_GfzhGT*Ye zDIbnjFKUqU5}=oyT@9{P{ZXv%MDm(1=1eT{#eScc!S_vP;I}VzSTRRu$2l*o8fI(G zD=!eXSf`FB@elu1hSbkikNQ%AT>duQCDs5I^B+{z86D*OS$@hd0yF4#_3C?eqfERO$p8c{}%j)taiBlE+;+!V4;VPAhE`2OamF-3V$Zs@VCi+@3qkurc+ zC}74d-bj%@P-p~ISCtf3sY|nay$MA@R8gDlMmIBy^Q$3IorjcXAMQ#QuKf%2_@I=V zK^Oh*xSFhA5fSiFCd|O`?r--?OFvQ4ki%KXFSPCmK>LFho=CDU=Ka?w7T!m3_1B+` zC8S=NppY+|IOzPwD6-nQSz%Idky&xi+HlpgQipoYYRloF;~Zv(t%+?%k2j3Q!^Q>A zr^1PmO~*jc>pWNM@^dnwEpXem^@@4uCkm5wEIz}$NZ69-+?Q(BAUJX(+Z>@9B4Nci zIHveNJd%fb|Kwo^W4Bhs9&Yi1yc=Hh+3=k@=yTAvHPF80UyA0%0_c>e!kf=q5j`A~ zG}`P%EHCM})7dR`+1z=U_@SqxNZa((e}TUn+HF|>!>+;FsquMXP;KC_DY zL>DAmk(B^dS=%aWvfiSkGZ@1F(}y5IOo39-+MCa>FLxR1#qpLj&+hfMWj^SF`*=A5 zi$~*n*Xw9gTftx^F5_u(hN7qcU|eaR+q!I+^XUa^c;i!K$_2MQWuXBC(7L54nV3>x zba-?W6=?c!Ipe8vWsDlkfFg8vDL5lrR#eXCBlbh_Opf3Bj1?8>Vi{2C6qE%LvaF}! zm?1@p)7nuacx=Op$}j-27=}@}5R_pvUC5kI!SUa<+yJ2820fjr%|Rs;eb~9d<@GgK zoNQlVA~lJ57A<^E1$HWAto&SN6D$Z)VHKZAgjN309Nq%%Qz?Rcj`r{_m6FP`kXD0U zRtZJLxh$HBpp67q2cImFvqqjFH7ntk$!@KHm_=E-wB#PKHb}-BPW3cd(wHlRf&>vC z>1C!88{;7=0=H$9c6=Bmrd_aBq|$H-AbEh?p$-lr^{V%U+l@lef`cSWj*G;zv4wtb zSdWEg3G6KxglXSG5J3N9UDWS93@bGK?-A~F%yo1E+9+6aluJ)!83E1*D+z7NAvXD( z;DT}*3I(~X5%H28n!jGT`$_I#UkggNC{a?S*>DtT3gUUh$~sFTp#U;|B^h^RdLZ8f z!3W|lVBQe-+t!lA2hkYMUM?yby+brT_K!SGmP_GP%D^9*8DqHuF85TcC)WkoND+2r zXp71SQd3qnUq1X2rQ&T%K@<_8&@oNF$RKC9>P@q4`ps7&?*b9NYy5v2>3=3p-ryuQl;Pl=3 z$|C9~`vxlm_(T%&V{e9w-!LWQvx(Gu#rqSuuGy>K1@4EPrR>_0D}N}Ee+&#$h=VEERR)h$g2m zSI(cQDmSr)iQF?gnNq!|U3@C%=8rlN>u3GpKp6P?E)g`hcUK5;!m>_-I#3dry4jW_3g-)M|4FZ z3wpU~P#X!qQ`OJ&eVagLU1v_*m`W;NsgA|@L;1;9-tLu%?WsQ=Z&sXQ-@7xe`4<|O zOB*(m148h*mpwrQ({zkug8VcJrocKxmzx1>EnG4+wDYKmq5zwECf> zjsB2!-1w5ZCqSNJ!cjf5Byu<3P_d%hCIw9Ii8Gze7;hV;)}i}7Pp`18(F`(SqX5N*+b7$^BK}J97G_wa({WJWpIf8h1Y`e2GL0%md5SBM7F{3>nRmQ*(j{dgjC5hlO=OgKKdx0H?u zQhW_P`%ELb%W`$9pccO2T-NkIz(UsG17>gj44~148s=3+)_+4Q%Yj2+fc?KQ^8X}> u{}jppH~$Z){C_w9-!jO5UEu$}nd*Nf5@k7Pz<)mw|7o}Xs07o0xBme$gFCqZ literal 0 HcmV?d00001 diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/CollectionDepositManagerDSpace.java b/dspace-swordv2/src/main/java/org/dspace/sword2/CollectionDepositManagerDSpace.java index 7f77c00f0d9b..afc35cfaa11c 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/CollectionDepositManagerDSpace.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/CollectionDepositManagerDSpace.java @@ -151,6 +151,9 @@ public DepositReceipt createNew(String collectionUri, Deposit deposit, sc.commit(); return receipt; + } catch (SwordAuthException e) { + log.error("caught exception:", e); + throw e; } catch (DSpaceSwordException e) { log.error("caught exception:", e); throw new SwordServerException( diff --git a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java index a77caa655b5d..45f0f315aa28 100644 --- a/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java +++ b/dspace-swordv2/src/main/java/org/dspace/sword2/SwordMETSContentIngester.java @@ -10,10 +10,12 @@ import java.io.File; import org.apache.logging.log4j.Logger; +import org.dspace.authorize.AuthorizeException; import org.dspace.content.Collection; import org.dspace.content.DSpaceObject; import org.dspace.content.Item; import org.dspace.content.WorkspaceItem; +import org.dspace.content.crosswalk.CrosswalkException; import org.dspace.content.factory.ContentServiceFactory; import org.dspace.content.packager.PackageIngester; import org.dspace.content.packager.PackageParameters; @@ -28,6 +30,7 @@ import org.swordapp.server.SwordAuthException; import org.swordapp.server.SwordError; import org.swordapp.server.SwordServerException; +import org.swordapp.server.UriRegistry; public class SwordMETSContentIngester extends AbstractSwordContentIngester { /** @@ -181,6 +184,12 @@ public DepositResult ingestToCollection(Context context, Deposit deposit, } catch (RuntimeException re) { log.error("caught exception: ", re); throw re; + } catch (AuthorizeException e) { + log.error("caught exception: ", e); + throw new SwordAuthException(e); + } catch (CrosswalkException e) { + log.error("caught exception: ", e); + throw new SwordError(UriRegistry.ERROR_BAD_REQUEST, e.getMessage(), e); } catch (Exception e) { log.error("caught exception: ", e); throw new DSpaceSwordException(e); From 993801ab69ddab3d657d921bae725daecccddd1e Mon Sep 17 00:00:00 2001 From: Toni Prieto Date: Sat, 7 Mar 2026 09:37:39 +0100 Subject: [PATCH 117/283] Avoid exception during OAI update caused by uncached entities (cherry picked from commit c3ac49dc64135ab48b34ef3766fcb5981cd94fbb) --- .../main/java/org/dspace/xoai/app/XOAI.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/xoai/app/XOAI.java b/dspace-oai/src/main/java/org/dspace/xoai/app/XOAI.java index 16c16b0115b6..0c6d3e64c385 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/app/XOAI.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/app/XOAI.java @@ -190,9 +190,9 @@ private int index(Date last) throws DSpaceSolrIndexerException, IOException { .findInArchiveOrWithdrawnDiscoverableModifiedSince(context, last); Iterator nonDiscoverableChangedItems = itemService .findInArchiveOrWithdrawnNonDiscoverableModifiedSince(context, last); + int total = this.index(discoverableChangedItems, true) + this.index(nonDiscoverableChangedItems, true); Iterator possiblyChangedItems = getItemsWithPossibleChangesBefore(last); - return this.index(discoverableChangedItems) + this.index(nonDiscoverableChangedItems) - + this.index(possiblyChangedItems); + return total + this.index(possiblyChangedItems, false); } catch (SQLException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } @@ -262,7 +262,7 @@ private int indexAll() throws DSpaceSolrIndexerException { null); Iterator nonDiscoverableItems = itemService .findInArchiveOrWithdrawnNonDiscoverableModifiedSince(context, null); - return this.index(discoverableItems) + this.index(nonDiscoverableItems); + return this.index(discoverableItems, true) + this.index(nonDiscoverableItems, true); } catch (SQLException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } @@ -305,7 +305,7 @@ private boolean checkIfVisibleInOAI(Item item) throws IOException { } } - private int index(Iterator iterator) throws DSpaceSolrIndexerException { + private int index(Iterator iterator, boolean uncacheEntities) throws DSpaceSolrIndexerException { try { int i = 0; int batchSize = configurationService.getIntProperty("oai.import.batch.size", 1000); @@ -334,10 +334,12 @@ private int index(Iterator iterator) throws DSpaceSolrIndexerException { server.add(list); server.commit(); list.clear(); - try { - context.uncacheEntities(); - } catch (SQLException ex) { - log.error("Error uncaching entities", ex); + if (uncacheEntities) { + try { + context.uncacheEntities(); + } catch (SQLException ex) { + log.error("Error uncaching entities", ex); + } } } } From 949c36ee65c44c67594fe0088508899f5f0650f7 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 24 Apr 2026 16:05:51 -0500 Subject: [PATCH 118/283] Bug Fix: Add missing Entity-related metadata fields required by virtual-metadata.xml --- dspace/config/dspace.cfg | 2 +- dspace/config/registries/journal-types.xml | 37 +++++++++++++++++++ .../config/registries/schema-person-types.xml | 9 +++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 dspace/config/registries/journal-types.xml diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index beb985eb4729..7e45645983b8 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -944,7 +944,7 @@ registry.metadata.load = schema-publicationVolume-types.xml registry.metadata.load = openaire4-types.xml registry.metadata.load = dspace-types.xml registry.metadata.load = iiif-types.xml - +registry.metadata.load = journal-types.xml #---------------------------------------------------------------# #-----------------UI-Related CONFIGURATIONS---------------------# diff --git a/dspace/config/registries/journal-types.xml b/dspace/config/registries/journal-types.xml new file mode 100644 index 000000000000..c68bee1ce6c1 --- /dev/null +++ b/dspace/config/registries/journal-types.xml @@ -0,0 +1,37 @@ + + + + + + DSpace Journal Types + + + + + + journal + http://dspace.org/journal + + + + journal + title + + The title of the Journal related to this object + + + + + journalvolume + http://dspace.org/journalvolume + + + + journalvolume + identifier + name + The identifier name for the Journal Volume related to this object + + + diff --git a/dspace/config/registries/schema-person-types.xml b/dspace/config/registries/schema-person-types.xml index 3a8f79732d41..9a3c494de497 100644 --- a/dspace/config/registries/schema-person-types.xml +++ b/dspace/config/registries/schema-person-types.xml @@ -156,4 +156,13 @@ Full name variant + + + person + contributor + other + + + \ No newline at end of file From 69c66944daee5ae742a922ffac3e4bdb74b0b2f5 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 24 Apr 2026 16:07:16 -0500 Subject: [PATCH 119/283] Bug Fix: RoleDisseminator must add EPerson email to "Name" attribute in METS because that's what RoleIngester.ingestDocument() expects to be in the "Name" --- .../java/org/dspace/content/packager/RoleDisseminator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/packager/RoleDisseminator.java b/dspace-api/src/main/java/org/dspace/content/packager/RoleDisseminator.java index 15e9f1b14494..48901b5ce5c4 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/RoleDisseminator.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/RoleDisseminator.java @@ -310,8 +310,8 @@ protected void writeGroup(Context context, DSpaceObject relatedObject, Group gro for (EPerson member : group.getMembers()) { writer.writeEmptyElement(MEMBER); writer.writeAttribute(ID, String.valueOf(member.getID())); - if (null != member.getName()) { - writer.writeAttribute(NAME, member.getName()); + if (null != member.getEmail()) { + writer.writeAttribute(NAME, member.getEmail()); } } writer.writeEndElement(); From 4024e719539fa4b456b3191ebe0ae7b389657b9f Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 24 Apr 2026 16:13:53 -0500 Subject: [PATCH 120/283] Bug Fix: Improve handling of missing or empty Bitstreams. While this shouldn't happen much in production, it may happen in dev/test environments. Ensure entire export and import doesn't fail when a single empty/missing Bitstream is encountered. Instead of an exception, log a warning. --- .../LicenseStreamDisseminationCrosswalk.java | 8 +++- .../packager/AbstractMETSDisseminator.java | 43 +++++++++++++++---- .../packager/AbstractMETSIngester.java | 20 ++++++--- 3 files changed, 57 insertions(+), 14 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/LicenseStreamDisseminationCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/LicenseStreamDisseminationCrosswalk.java index 46858747870d..b1854bfd85ae 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/LicenseStreamDisseminationCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/LicenseStreamDisseminationCrosswalk.java @@ -8,6 +8,7 @@ package org.dspace.content.crosswalk; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; import java.sql.SQLException; @@ -56,7 +57,12 @@ public void disseminate(Context context, DSpaceObject dso, OutputStream out) Bitstream licenseBs = PackageUtils.findDepositLicense(context, (Item) dso); if (licenseBs != null) { - Utils.copy(bitstreamService.retrieve(context, licenseBs), out); + try (final InputStream bitInputStream = bitstreamService.retrieve(context, licenseBs)) { + Utils.copy(bitInputStream, out); + } catch (Exception e) { + log.warn("Could not retrieve license file for Item with UUID={}. " + + "Leaving it out of generated package. Error{}", dso.getID(), e.getMessage()); + } } } } diff --git a/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSDisseminator.java b/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSDisseminator.java index fd50ec8023e2..2161a222e1f2 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSDisseminator.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSDisseminator.java @@ -456,17 +456,37 @@ protected void addBitstreamsToZip(Context context, DSpaceObject dso, // contents are unchanged ze.setTime(DEFAULT_MODIFIED_DATE); } - ze.setSize(auth ? bitstream.getSizeBytes() : 0); - zip.putNextEntry(ze); + + long bitstreamSize = 0; + // If user is authorized to read this bitstream, attempt to retrieve it. if (auth) { - InputStream input = bitstreamService.retrieve(context, bitstream); - Utils.copy(input, zip); - input.close(); + try (final InputStream bitstreamInput = bitstreamService.retrieve(context, bitstream)) { + // Save bitstream size into Zip entry & put entry in Zip file. + bitstreamSize = bitstream.getSizeBytes(); + ze.setSize(bitstreamSize); + zip.putNextEntry(ze); + + // Copy bitstream contents to Zip file + Utils.copy(bitstreamInput, zip); + } catch (Exception e) { + log.warn("Adding zero-length file for Bitstream, uuid={}." + + " Bitstream is unable to be retrieved from assetstore." + + " Error={}", bitstream.getID(), e.getMessage()); + } } else { - log.warn("Adding zero-length file for Bitstream, uuid=" - + String.valueOf(bitstream.getID()) - + ", not authorized for READ."); + log.warn("Adding zero-length file for Bitstream, uuid={}" + + ", not authorized for READ.", bitstream.getID()); + } + + // If bitstreamSize is still zero, that means either we didn't have READ privileges + // or the bitstream could not be retrieved from storage. Either way, write a zero-length + // file into our Zip entry in place of the bitstream. + if (bitstreamSize == 0) { + ze.setSize(0); + zip.putNextEntry(ze); } + + // Close our zip entry zip.closeEntry(); } else if (unauth != null && unauth.equalsIgnoreCase("skip")) { log.warn("Skipping Bitstream, uuid=" + String @@ -629,6 +649,13 @@ protected MdSec makeMdSec(Context context, DSpaceObject dso, Class mdSecClass, ByteArrayOutputStream disseminateOutput = new ByteArrayOutputStream(); sxwalk.disseminate(context, dso, disseminateOutput); disseminateOutput.close(); + + // If our disseminated output has zero size, exit immediately (i.e. return a null mdSec). + // Likely, the outputstream failed to be created, so we cannot include it in this package. + if (disseminateOutput.size() == 0) { + return null; + } + // Convert output to an inputstream, so we can write to manifest or Zip file ByteArrayInputStream crosswalkedStream = new ByteArrayInputStream( disseminateOutput.toByteArray()); diff --git a/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java b/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java index 68383f1d9e74..122f13992087 100644 --- a/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java +++ b/dspace-api/src/main/java/org/dspace/content/packager/AbstractMETSIngester.java @@ -19,6 +19,7 @@ import java.util.zip.ZipFile; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.io.input.NullInputStream; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; @@ -748,6 +749,14 @@ protected void addBitstreams(Context context, Item item, // externally, if it is an externally referenced file) InputStream fileStream = getFileInputStream(pkgFile, params, path); + // Before proceeding we must ensure we have a non-empty input stream + // NOTE: If getFileInputStream encounters a zero-sized file, then it returns NullInputStream + if (fileStream == null || fileStream instanceof NullInputStream) { + log.warn("Empty InputStream encountered for Bitstream with ID={} in zip file={}. " + + "Skipping adding this empty bitstream to Item={}", mfileID, pkgFile, item.getID()); + continue; + } + // retrieve bundle name from manifest String bundleName = METSManifest.getBundleName(mfile); @@ -1324,7 +1333,7 @@ public String getObjectHandle(METSManifest manifest) * zip) * @param params Parameters passed to METSIngester * @param path the File path (either path in Zip package or a URL) - * @return the InputStream for the file + * @return the InputStream for the file, or NullInputStream if a zero-sized entry is encountered * @throws MetadataValidationException if validation error * @throws IOException if IO error */ @@ -1357,12 +1366,13 @@ protected static InputStream getFileInputStream(File pkgFile, // Retrieve the manifest file entry by name ZipEntry manifestEntry = zipPackage.getEntry(path); - // Get inputStream associated with this file - if (manifestEntry != null) { + if (manifestEntry.getSize() > 0) { + // Get inputStream associated with this file return zipPackage.getInputStream(manifestEntry); } else { - throw new MetadataValidationException("Manifest file references file '" - + path + "' not included in the zip."); + log.warn("Zero-sized file entry={} found in zip file={}. Returning empty InputStream.", + path, pkgFile); + return new NullInputStream(); } } } From 1fa3696aa9c75944023bc0032689d5e4f2ad44ec Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 24 Apr 2026 16:15:34 -0500 Subject: [PATCH 121/283] Minor fix to exception message. Include the metadata schema name in the message text. --- .../content/crosswalk/CrosswalkMetadataValidator.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java index b1be458a255e..1bcc1c9ba9fb 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/CrosswalkMetadataValidator.java @@ -107,9 +107,12 @@ public MetadataField checkMetadata(Context context, String schema, String elemen e.printStackTrace(); } } else if (!fieldChoice.equals("ignore")) { - throw new CrosswalkException( - "The '" + element + "." + qualifier + "' element has not been defined in this DSpace " + - "instance. "); + throw new CrosswalkException(String.format( + "The '%s.%s%s' element has not been defined in this DSpace instance.", + mdSchema.getName(), + element, + qualifier == null ? "" : ("." + qualifier) + )); } } } From 5b66f8743f817703427731a2311aa5e47141bae4 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 12 May 2026 12:20:48 +0200 Subject: [PATCH 122/283] DSpace#12470 Force each JWT handler to fall back to documented defaults (cherry picked from commit 54b7b574416ac3bbf6791dfd2ee653f35939ea4e) --- .../app/rest/security/jwt/JWTTokenHandler.java | 13 ++++++++----- .../app/rest/security/jwt/LoginJWTTokenHandler.java | 11 +++++++++++ .../security/jwt/ShortLivedJWTTokenHandler.java | 10 ++++++++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/JWTTokenHandler.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/JWTTokenHandler.java index 6beab1aa853d..5ea9af25dacb 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/JWTTokenHandler.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/JWTTokenHandler.java @@ -65,7 +65,7 @@ public abstract class JWTTokenHandler { private List jwtClaimProviders; @Autowired - private ConfigurationService configurationService; + protected ConfigurationService configurationService; @Autowired private EPersonClaimProvider ePersonClaimProvider; @@ -79,6 +79,13 @@ public abstract class JWTTokenHandler { private String generatedJwtKey; private String generatedEncryptionKey; + /** + * Get the default expiration period for this handler if not + * defined in configuration. + * @return default expiration period if not explicitly defined in configuration + */ + public abstract long getExpirationPeriod(); + /** * Get the configuration property key for the token secret. * @return the configuration property key @@ -219,10 +226,6 @@ public String getJwtKey() { return secret; } - public long getExpirationPeriod() { - return configurationService.getLongProperty(getTokenExpirationConfigurationKey(), 1800000); - } - public boolean isEncryptionEnabled() { return configurationService.getBooleanProperty(getEncryptionEnabledConfigurationKey(), false); } diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/LoginJWTTokenHandler.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/LoginJWTTokenHandler.java index 1fad84165809..46877b03c3ca 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/LoginJWTTokenHandler.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/LoginJWTTokenHandler.java @@ -15,6 +15,17 @@ */ @Component public class LoginJWTTokenHandler extends JWTTokenHandler { + + /** + * Default expiration period for login tokens in milliseconds + */ + private static final long DEFAULT_EXPIRATION_PERIOD = 1800000; + + @Override + public long getExpirationPeriod() { + return configurationService.getLongProperty(getTokenExpirationConfigurationKey(), DEFAULT_EXPIRATION_PERIOD); + } + @Override protected String getTokenSecretConfigurationKey() { return "jwt.login.token.secret"; diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandler.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandler.java index fc4ab39407a4..177e84ed5a8f 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandler.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandler.java @@ -28,6 +28,11 @@ @Component public class ShortLivedJWTTokenHandler extends JWTTokenHandler { + /** + * Default expiration period for short-lived tokens in milliseconds + */ + private static final long DEFAULT_EXPIRATION_PERIOD = 2000; + /** * Determine if current JWT is valid for the given EPerson object. * To be valid, current JWT *must* have been signed by the EPerson and not be expired. @@ -67,6 +72,11 @@ protected EPerson updateSessionSalt(final Context context, final Date previousLo return context.getCurrentUser(); } + @Override + public long getExpirationPeriod() { + return configurationService.getLongProperty(getTokenExpirationConfigurationKey(), DEFAULT_EXPIRATION_PERIOD); + } + @Override protected String getTokenSecretConfigurationKey() { return "jwt.shortLived.token.secret"; From 158e511c60b8c6ff5548906e4c269ed9def44527 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 12 May 2026 12:28:56 +0200 Subject: [PATCH 123/283] DSpace#12470 Doc and comment default expiration periods in authentication.cfg This further proves the forcing of each handler to set an expiration period is working and sets accurate expectations for implementers. (cherry picked from commit d4cb66f1c6f83c3998aefd4db76677e25f846294) --- dspace/config/modules/authentication.cfg | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dspace/config/modules/authentication.cfg b/dspace/config/modules/authentication.cfg index 41c28df1d7c9..253035fe3e52 100644 --- a/dspace/config/modules/authentication.cfg +++ b/dspace/config/modules/authentication.cfg @@ -78,8 +78,9 @@ jwt.login.encryption.enabled = false # of some performance, this setting WILL ONLY BE used when encrypting the jwt. jwt.login.compression.enabled = true -# Expiration time of a token in milliseconds -jwt.login.token.expiration = 1800000 +# Expiration time of a login token in milliseconds +# Default: 1800000 (30 minutes) +#jwt.login.token.expiration = 1800000 #---------------------------------------------------------------# #---Stateless JWT Authentication for downloads of bitstreams----# @@ -103,5 +104,6 @@ jwt.shortLived.encryption.enabled = false # of some performance, this setting WILL ONLY BE used when encrypting the jwt. jwt.shortLived.compression.enabled = true -# Expiration time of a token in milliseconds -jwt.shortLived.token.expiration = 2000 +# Expiration time of a short-lived token in milliseconds +# Default: 2000 (2 seconds) +#jwt.shortLived.token.expiration = 2000 From 6a193db82583a1f4f3149d1153dba782833ef97e Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 12 May 2026 13:08:13 +0200 Subject: [PATCH 124/283] DSpace#12470 Remove unnecessary stubbing in short lived JWT test (cherry picked from commit ae45cecee456be71ae2e89220803e918d76ce682) --- .../app/rest/security/jwt/ShortLivedJWTTokenHandlerTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandlerTest.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandlerTest.java index 70497218652e..ab3307fdaf98 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandlerTest.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/security/jwt/ShortLivedJWTTokenHandlerTest.java @@ -76,8 +76,7 @@ public void testJWTEncrypted() throws Exception { //temporary set a negative expiration time so the token is invalid immediately @Test public void testExpiredToken() throws Exception { - when(configurationService.getLongProperty("jwt.shortLived.token.expiration", 1800000)) - .thenReturn(-99999999L); + when(shortLivedJWTTokenHandler.getExpirationPeriod()).thenReturn(-99999999L); when(ePersonClaimProvider.getEPerson(any(Context.class), any(JWTClaimsSet.class))).thenReturn(ePerson); Date previous = new Date(new Date().getTime() - 10000000000L); String token = shortLivedJWTTokenHandler From af5a8fba7f5b07ffd1dc78823cab8add3d7e403c Mon Sep 17 00:00:00 2001 From: Mark Patton Date: Mon, 17 Nov 2025 10:58:43 -0500 Subject: [PATCH 125/283] Handle creation of thumbnails for multi-image TIFF files (cherry picked from commit f28641d910e1133fbbdeb528491c70594f9190ea) --- .../org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java b/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java index 7543410a7968..28bfc72dc110 100644 --- a/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java +++ b/dspace-api/src/main/java/org/dspace/app/mediafilter/ImageMagickThumbnailFilter.java @@ -105,7 +105,7 @@ public File getThumbnailFile(File f, boolean verbose) ConvertCmd cmd = new ConvertCmd(); IMOperation op = new IMOperation(); op.autoOrient(); - op.addImage(f.getAbsolutePath()); + op.addImage(f.getAbsolutePath() + "[0]"); op.thumbnail(configurationService.getIntProperty("thumbnail.maxwidth", DEFAULT_WIDTH), configurationService.getIntProperty("thumbnail.maxheight", DEFAULT_HEIGHT)); op.addImage(f2.getAbsolutePath()); From 93b4b10a315a2c71bee9e4c5a7453dc1e46c45ea Mon Sep 17 00:00:00 2001 From: Istvan Vig Date: Mon, 9 Mar 2026 16:13:33 +0100 Subject: [PATCH 126/283] Controlled vocabulary for accented characters (cherry picked from commit e346526f3a5d0a2be4cb10c2f16cd07c2bd67f9b) --- .../dspace/content/authority/DSpaceControlledVocabulary.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java index 3f7f926c07a4..f31d0c3bc518 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java @@ -60,8 +60,9 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements HierarchicalAuthority { private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(); - protected static String xpathTemplate = "//node[contains(translate(@label,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'," + - "'abcdefghijklmnopqrstuvwxyz'),%s)]"; + protected static String xpathTemplate = "//node[contains(translate(@label," + + "'ABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÂÄÃÅĄĂĆČÇĎĐÉÈÊËĘĚÍÌÎÏŁĽŃŇÑÓÒÔÖÕŐŔŘŚŠŞŤŢÚÙÛÜŮŰÝŸŹŽŻ'," + + "'abcdefghijklmnopqrstuvwxyzáàâäãåąăćčçďđéèêëęěíìîïłľńňñóòôöõőŕřśšşťţúùûüůűýÿźžż'),%s)]"; protected static String idTemplate = "//node[@id = %s]"; protected static String idTemplateQuoted = "//node[@id = '%s']"; protected static String labelTemplate = "//node[@label = %s]"; From 633c194ac1e8765e5afb8ca12042fdcc0bdbcf96 Mon Sep 17 00:00:00 2001 From: Istvan Vig Date: Wed, 11 Mar 2026 16:07:35 +0100 Subject: [PATCH 127/283] Fixes https://github.com/bme-omikk/repozitorium-config/issues/214 The fix is in the dspace/modules/additions folder. (cherry picked from commit c40868bdf9489fae34c3c4358876a0d1832daac7) --- .../authority/DSpaceControlledVocabulary.java | 5 +- .../authority/DSpaceControlledVocabulary.java | 496 ++++++++++++++++++ .../modules/server/src/main/webapp/.gitignore | 0 3 files changed, 498 insertions(+), 3 deletions(-) create mode 100644 dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java delete mode 100644 dspace/modules/server/src/main/webapp/.gitignore diff --git a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java index f31d0c3bc518..3f7f926c07a4 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java @@ -60,9 +60,8 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements HierarchicalAuthority { private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(); - protected static String xpathTemplate = "//node[contains(translate(@label," + - "'ABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÂÄÃÅĄĂĆČÇĎĐÉÈÊËĘĚÍÌÎÏŁĽŃŇÑÓÒÔÖÕŐŔŘŚŠŞŤŢÚÙÛÜŮŰÝŸŹŽŻ'," + - "'abcdefghijklmnopqrstuvwxyzáàâäãåąăćčçďđéèêëęěíìîïłľńňñóòôöõőŕřśšşťţúùûüůűýÿźžż'),%s)]"; + protected static String xpathTemplate = "//node[contains(translate(@label,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'," + + "'abcdefghijklmnopqrstuvwxyz'),%s)]"; protected static String idTemplate = "//node[@id = %s]"; protected static String idTemplateQuoted = "//node[@id = '%s']"; protected static String labelTemplate = "//node[@label = %s]"; diff --git a/dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java b/dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java new file mode 100644 index 000000000000..36ac58f4b66f --- /dev/null +++ b/dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java @@ -0,0 +1,496 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.content.authority; + +import java.io.File; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.Logger; +import org.dspace.core.SelfNamedPlugin; +import org.dspace.services.ConfigurationService; +import org.dspace.services.factory.DSpaceServicesFactory; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/** + * ChoiceAuthority source that reads the hierarchical vocabularies + * from {@code ${dspace.dir}/config/controlled-vocabularies/*.xml} and turns + * them into autocompleting authorities. + * + *

    Configuration: This MUST be configured as a self-named plugin, e.g.: {@code + * plugin.selfnamed.org.dspace.content.authority.ChoiceAuthority = + * org.dspace.content.authority.DSpaceControlledVocabulary + * } + * + *

    It AUTOMATICALLY configures a plugin instance for each XML file in the + * controlled vocabularies directory. The name of the plugin is the basename of + * the file; e.g., {@code ${dspace.dir}/config/controlled-vocabularies/nsi.xml} + * would generate a plugin called "nsi". + * + *

    Each configured plugin comes with three configuration options: + *

      + *
    • {@code vocabulary.plugin._plugin_.hierarchy.store = + * # Store entire hierarchy along with selected value. Default: TRUE}
    • + *
    • {@code vocabulary.plugin._plugin_.hierarchy.suggest = + * # Display entire hierarchy in the suggestion list. Default: TRUE}
    • + *
    • {@code vocabulary.plugin._plugin_.delimiter = "" + * # Delimiter to use when building hierarchy strings. Default: "::"}
    • + *
    + * } + * + * @author Michael B. Klein + */ + +public class DSpaceControlledVocabulary extends SelfNamedPlugin implements HierarchicalAuthority { + + private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(); + protected static String xpathTemplate = "//node[contains(translate(@label," + + "'ABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÂÄÃÅĄĂĆČÇĎĐÉÈÊËĘĚÍÌÎÏŁĽŃŇÑÓÒÔÖÕŐŔŘŚŠŞŤŢÚÙÛÜŮŰÝŸŹŽŻ'," + + "'abcdefghijklmnopqrstuvwxyzáàâäãåąăćčçďđéèêëęěíìîïłľńňñóòôöõőŕřśšşťţúùûüůűýÿźžż'),%s)]"; + protected static String idTemplate = "//node[@id = %s]"; + protected static String idTemplateQuoted = "//node[@id = '%s']"; + protected static String labelTemplate = "//node[@label = %s]"; + protected static String idParentTemplate = "//node[@id = '%s']/parent::isComposedBy/parent::node"; + protected static String rootTemplate = "/node"; + protected static String idAttribute = "id"; + protected static String labelAttribute = "label"; + protected static String[] pluginNames = null; + protected String vocabularyName = null; + protected InputSource vocabulary = null; + protected Boolean suggestHierarchy = false; + protected Boolean storeHierarchy = true; + protected String hierarchyDelimiter = "::"; + protected Integer preloadLevel = 1; + protected String valueAttribute = labelAttribute; + protected String valueTemplate = labelTemplate; + + public DSpaceControlledVocabulary() { + super(); + } + + @Override + public boolean storeAuthorityInMetadata() { + // For backward compatibility controlled vocabularies don't store the node id in + // the metadatavalue + return false; + } + + public static String[] getPluginNames() { + if (pluginNames == null) { + initPluginNames(); + } + + return ArrayUtils.clone(pluginNames); + } + + private static synchronized void initPluginNames() { + if (pluginNames == null) { + class xmlFilter implements java.io.FilenameFilter { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".xml"); + } + } + String vocabulariesPath = DSpaceServicesFactory.getInstance().getConfigurationService() + .getProperty("dspace.dir") + + File.separator + "config" + + File.separator + "controlled-vocabularies"; + String[] xmlFiles = (new File(vocabulariesPath)).list(new xmlFilter()); + List names = new ArrayList<>(); + for (String filename : xmlFiles) { + names.add((new File(filename)).getName().replace(".xml", "")); + } + pluginNames = names.toArray(new String[names.size()]); + log.info("Got plugin names = " + Arrays.deepToString(pluginNames)); + } + } + + protected void init(String locale) { + if (vocabulary == null) { + ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService(); + + log.info("Initializing " + this.getClass().getName()); + vocabularyName = this.getPluginInstanceName(); + String vocabulariesPath = config.getProperty("dspace.dir") + File.separator + "config" + + File.separator + "controlled-vocabularies" + File.separator; + String configurationPrefix = "vocabulary.plugin." + vocabularyName; + storeHierarchy = config.getBooleanProperty(configurationPrefix + ".hierarchy.store", storeHierarchy); + boolean storeIDs = config.getBooleanProperty(configurationPrefix + ".storeIDs", false); + suggestHierarchy = config.getBooleanProperty(configurationPrefix + ".hierarchy.suggest", suggestHierarchy); + preloadLevel = config.getIntProperty(configurationPrefix + ".hierarchy.preloadLevel", preloadLevel); + String configuredDelimiter = config.getProperty(configurationPrefix + ".delimiter"); + if (configuredDelimiter != null) { + hierarchyDelimiter = configuredDelimiter.replaceAll("(^\"|\"$)", ""); + } + if (storeIDs) { + valueAttribute = idAttribute; + valueTemplate = idTemplate; + } + + String filename = vocabulariesPath + vocabularyName + ".xml"; + if (StringUtils.isNotEmpty(locale)) { + String localizedFilename = vocabulariesPath + vocabularyName + "_" + locale + ".xml"; + if (Paths.get(localizedFilename).toFile().exists()) { + filename = localizedFilename; + } + } + log.info("Loading " + filename); + vocabulary = new InputSource(filename); + } + } + + protected String buildString(Node node) { + if (node.getNodeType() == Node.DOCUMENT_NODE || ( + node.getParentNode() != null && + node.getParentNode().getNodeType() == Node.DOCUMENT_NODE)) { + return (""); + } else { + String parentValue = buildString(node.getParentNode()); + Node currentNodeValue = node.getAttributes().getNamedItem(valueAttribute); + if (currentNodeValue != null) { + String currentValue = currentNodeValue.getNodeValue(); + if (parentValue.equals("")) { + return currentValue; + } else { + return (parentValue + this.hierarchyDelimiter + currentValue); + } + } else { + return (parentValue); + } + } + } + + @Override + public Choices getMatches(String text, int start, int limit, String locale) { + init(locale); + log.debug("Getting matches for '" + text + "'"); + String[] textHierarchy = text.split(hierarchyDelimiter, -1); + StringBuilder xpathExpressionBuilder = new StringBuilder(); + for (int i = 0; i < textHierarchy.length; i++) { + xpathExpressionBuilder.append(String.format(xpathTemplate, "$var" + i)); + } + String xpathExpression = xpathExpressionBuilder.toString(); + XPath xpath = XPathFactory.newInstance().newXPath(); + xpath.setXPathVariableResolver(variableName -> { + String varName = variableName.getLocalPart(); + if (varName.startsWith("var")) { + int index = Integer.parseInt(varName.substring(3)); + return textHierarchy[index].toLowerCase(); + } + throw new IllegalArgumentException("Unexpected variable: " + varName); + }); + int total; + List choices; + try { + NodeList results = (NodeList) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODESET); + total = results.getLength(); + choices = getChoicesFromNodeList(results, start, limit); + } catch (XPathExpressionException e) { + log.warn(e.getMessage(), e); + return new Choices(true); + } + return new Choices(choices.toArray(new Choice[choices.size()]), start, total, Choices.CF_AMBIGUOUS, + total > start + limit); + } + + @Override + public Choices getBestMatch(String text, String locale) { + init(locale); + log.debug("Getting best matches for {}'", text); + String[] textHierarchy = text.split(hierarchyDelimiter, -1); + StringBuilder xpathExpressionBuilder = new StringBuilder(); + for (int i = 0; i < textHierarchy.length; i++) { + xpathExpressionBuilder.append(String.format(valueTemplate, "$var" + i)); + } + String xpathExpression = xpathExpressionBuilder.toString(); + XPath xpath = XPathFactory.newInstance().newXPath(); + xpath.setXPathVariableResolver(variableName -> { + String varName = variableName.getLocalPart(); + if (varName.startsWith("var")) { + int index = Integer.parseInt(varName.substring(3)); + return textHierarchy[index]; + } + throw new IllegalArgumentException("Unexpected variable: " + varName); + }); + List choices; + try { + NodeList results = (NodeList) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODESET); + choices = getChoicesFromNodeList(results, 0, 1); + } catch (XPathExpressionException e) { + log.warn(e.getMessage(), e); + return new Choices(true); + } + return new Choices(choices.toArray(new Choice[choices.size()]), 0, choices.size(), Choices.CF_AMBIGUOUS, false); + } + + @Override + public String getLabel(String key, String locale) { + return getNodeValue(key, locale, this.suggestHierarchy); + } + + @Override + public String getValue(String key, String locale) { + return getNodeValue(key, locale, this.storeHierarchy); + } + + @Override + public Choice getChoice(String authKey, String locale) { + Node node; + try { + node = getNode(authKey, locale); + } catch (XPathExpressionException e) { + return null; + } + return createChoiceFromNode(node); + } + + @Override + public boolean isHierarchical() { + init(null); + return true; + } + + @Override + public Choices getTopChoices(String authorityName, int start, int limit, String locale) { + init(locale); + String xpathExpression = rootTemplate; + return getChoicesByXpath(xpathExpression, start, limit); + } + + @Override + public Choices getChoicesByParent(String authorityName, String parentId, int start, int limit, String locale) { + init(locale); + String xpathExpression = String.format(idTemplateQuoted, parentId); + return getChoicesByXpath(xpathExpression, start, limit); + } + + @Override + public Choice getParentChoice(String authorityName, String childId, String locale) { + init(locale); + try { + String xpathExpression = String.format(idParentTemplate, childId); + Choice choice = createChoiceFromNode(getNodeFromXPath(xpathExpression)); + return choice; + } catch (XPathExpressionException e) { + log.error(e.getMessage(), e); + return null; + } + } + + @Override + public Integer getPreloadLevel() { + init(null); + return preloadLevel; + } + + private boolean isRootElement(Node node) { + return node != null && node.getOwnerDocument().getDocumentElement().equals(node); + } + + private Node getNode(String key, String locale) throws XPathExpressionException { + init(locale); + String xpathExpression = String.format(idTemplateQuoted, key); + Node node = getNodeFromXPath(xpathExpression); + return node; + } + + private Node getNodeFromXPath(String xpathExpression) throws XPathExpressionException { + XPath xpath = XPathFactory.newInstance().newXPath(); + Node node = (Node) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODE); + return node; + } + + private List getChoicesFromNodeList(NodeList results, int start, int limit) { + List choices = new ArrayList<>(); + for (int i = 0; i < results.getLength(); i++) { + if (i < start) { + continue; + } + if (choices.size() == limit) { + break; + } + Node node = results.item(i); + Choice choice = new Choice(getAuthority(node), getLabel(node), getValue(node), + isSelectable(node)); + choice.extras = addOtherInformation(getParent(node), getNote(node), getChildren(node), getAuthority(node)); + choices.add(choice); + } + return choices; + } + + private Map addOtherInformation(String parentCurr, String noteCurr, + List childrenCurr, String authorityCurr) { + Map extras = new HashMap<>(); + if (StringUtils.isNotBlank(parentCurr)) { + extras.put("parent", parentCurr); + } + if (StringUtils.isNotBlank(noteCurr)) { + extras.put("note", noteCurr); + } + if (childrenCurr.isEmpty()) { + extras.put("hasChildren", "false"); + } else { + extras.put("hasChildren", "true"); + } + extras.put("id", authorityCurr); + return extras; + } + + private String getNodeValue(String key, String locale, boolean useHierarchy) { + try { + Node node = getNode(key, locale); + if (Objects.isNull(node)) { + return null; + } + if (useHierarchy) { + return this.buildString(node); + } else { + return node.getAttributes().getNamedItem(valueAttribute).getNodeValue(); + } + } catch (XPathExpressionException e) { + return (""); + } + } + + private String getLabel(Node node) { + String hierarchy = this.buildString(node); + if (this.suggestHierarchy) { + return hierarchy; + } else { + return node.getAttributes().getNamedItem("label").getNodeValue(); + } + } + + private String getValue(Node node) { + String hierarchy = this.buildString(node); + if (this.storeHierarchy) { + return hierarchy; + } else { + return node.getAttributes().getNamedItem(valueAttribute).getNodeValue(); + } + } + + private String getNote(Node node) { + NodeList childNodes = node.getChildNodes(); + for (int ci = 0; ci < childNodes.getLength(); ci++) { + Node firstChild = childNodes.item(ci); + if (firstChild != null && "hasNote".equals(firstChild.getNodeName())) { + String nodeValue = firstChild.getTextContent(); + if (StringUtils.isNotBlank(nodeValue)) { + return nodeValue; + } + } + } + return null; + } + + private List getChildren(Node node) { + List children = new ArrayList<>(); + NodeList childNodes = node.getChildNodes(); + for (int ci = 0; ci < childNodes.getLength(); ci++) { + Node firstChild = childNodes.item(ci); + if (firstChild != null && "isComposedBy".equals(firstChild.getNodeName())) { + for (int cii = 0; cii < firstChild.getChildNodes().getLength(); cii++) { + Node childN = firstChild.getChildNodes().item(cii); + if (childN != null && "node".equals(childN.getNodeName())) { + Node childIdAttr = childN.getAttributes().getNamedItem("id"); + if (null != childIdAttr) { + children.add(childIdAttr.getNodeValue()); + } + } + } + break; + } + } + return children; + } + + private boolean isSelectable(Node node) { + Node selectableAttr = node.getAttributes().getNamedItem("selectable"); + if (null != selectableAttr) { + return Boolean.parseBoolean(selectableAttr.getNodeValue()); + } else { // Default is true + return true; + } + } + + private String getParent(Node node) { + Node parentN = node.getParentNode(); + if (parentN != null) { + parentN = parentN.getParentNode(); + if (parentN != null && !isRootElement(parentN)) { + return buildString(parentN); + } + } + return null; + } + + private String getAuthority(Node node) { + Node idAttr = node.getAttributes().getNamedItem("id"); + if (null != idAttr) { // 'id' is optional + return idAttr.getNodeValue(); + } else { + return null; + } + } + + private Choices getChoicesByXpath(String xpathExpression, int start, int limit) { + List choices = new ArrayList<>(); + XPath xpath = XPathFactory.newInstance().newXPath(); + try { + Node parentNode = (Node) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODE); + int count = 0; + if (parentNode != null) { + NodeList childNodes = (NodeList) xpath.evaluate(".//isComposedBy", parentNode, XPathConstants.NODE); + if (null != childNodes) { + for (int i = 0; i < childNodes.getLength(); i++) { + Node childNode = childNodes.item(i); + if (childNode != null && "node".equals(childNode.getNodeName())) { + if (count < start || choices.size() >= limit) { + count++; + continue; + } + count++; + choices.add(createChoiceFromNode(childNode)); + } + } + } + return new Choices(choices.toArray(new Choice[choices.size()]), start, count, + Choices.CF_AMBIGUOUS, false); + } + } catch (XPathExpressionException e) { + log.warn(e.getMessage(), e); + return new Choices(true); + } + return new Choices(false); + } + + private Choice createChoiceFromNode(Node node) { + if (node != null && !isRootElement(node)) { + Choice choice = new Choice(getAuthority(node), getLabel(node), getValue(node), + isSelectable(node)); + choice.extras = addOtherInformation(getParent(node), getNote(node),getChildren(node), getAuthority(node)); + return choice; + } + return null; + } + +} diff --git a/dspace/modules/server/src/main/webapp/.gitignore b/dspace/modules/server/src/main/webapp/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 From 7e4fda2c5a5c1ba4f8614fd29b6c0e464e6cbf1a Mon Sep 17 00:00:00 2001 From: Istvan Vig Date: Tue, 24 Mar 2026 19:45:22 +0100 Subject: [PATCH 128/283] rebase on current main; refactor to use all unicode characters (cherry picked from commit 18427d009156f67251c692dab35d321ec337ed84) --- .../authority/DSpaceControlledVocabulary.java | 15 +- .../authority/DSpaceControlledVocabulary.java | 496 ------------------ .../modules/server/src/main/webapp/.gitignore | 0 3 files changed, 13 insertions(+), 498 deletions(-) delete mode 100644 dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java create mode 100644 dspace/modules/server/src/main/webapp/.gitignore diff --git a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java index 3f7f926c07a4..746e0579dcfb 100644 --- a/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java +++ b/dspace-api/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java @@ -60,8 +60,19 @@ public class DSpaceControlledVocabulary extends SelfNamedPlugin implements HierarchicalAuthority { private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(); - protected static String xpathTemplate = "//node[contains(translate(@label,'ABCDEFGHIJKLMNOPQRSTUVWXYZ'," + - "'abcdefghijklmnopqrstuvwxyz'),%s)]"; + protected static final String xpathTemplate; + static { + StringBuilder upper = new StringBuilder(); + StringBuilder lower = new StringBuilder(); + for (int cp = 'A'; cp <= Character.MAX_CODE_POINT; cp++) { + if (Character.isLetter(cp) && Character.isUpperCase(cp)) { + int lcp = Character.toLowerCase(cp); + upper.appendCodePoint(cp); + lower.appendCodePoint(lcp); + } + } + xpathTemplate = "//node[contains(translate(@label,'" + upper + "','" + lower + "'),%s)]"; + } protected static String idTemplate = "//node[@id = %s]"; protected static String idTemplateQuoted = "//node[@id = '%s']"; protected static String labelTemplate = "//node[@label = %s]"; diff --git a/dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java b/dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java deleted file mode 100644 index 36ac58f4b66f..000000000000 --- a/dspace/modules/additions/src/main/java/org/dspace/content/authority/DSpaceControlledVocabulary.java +++ /dev/null @@ -1,496 +0,0 @@ -/** - * The contents of this file are subject to the license and copyright - * detailed in the LICENSE and NOTICE files at the root of the source - * tree and available online at - * - * http://www.dspace.org/license/ - */ -package org.dspace.content.authority; - -import java.io.File; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.apache.commons.lang3.ArrayUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.Logger; -import org.dspace.core.SelfNamedPlugin; -import org.dspace.services.ConfigurationService; -import org.dspace.services.factory.DSpaceServicesFactory; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; - -/** - * ChoiceAuthority source that reads the hierarchical vocabularies - * from {@code ${dspace.dir}/config/controlled-vocabularies/*.xml} and turns - * them into autocompleting authorities. - * - *

    Configuration: This MUST be configured as a self-named plugin, e.g.: {@code - * plugin.selfnamed.org.dspace.content.authority.ChoiceAuthority = - * org.dspace.content.authority.DSpaceControlledVocabulary - * } - * - *

    It AUTOMATICALLY configures a plugin instance for each XML file in the - * controlled vocabularies directory. The name of the plugin is the basename of - * the file; e.g., {@code ${dspace.dir}/config/controlled-vocabularies/nsi.xml} - * would generate a plugin called "nsi". - * - *

    Each configured plugin comes with three configuration options: - *

      - *
    • {@code vocabulary.plugin._plugin_.hierarchy.store = - * # Store entire hierarchy along with selected value. Default: TRUE}
    • - *
    • {@code vocabulary.plugin._plugin_.hierarchy.suggest = - * # Display entire hierarchy in the suggestion list. Default: TRUE}
    • - *
    • {@code vocabulary.plugin._plugin_.delimiter = "" - * # Delimiter to use when building hierarchy strings. Default: "::"}
    • - *
    - * } - * - * @author Michael B. Klein - */ - -public class DSpaceControlledVocabulary extends SelfNamedPlugin implements HierarchicalAuthority { - - private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(); - protected static String xpathTemplate = "//node[contains(translate(@label," + - "'ABCDEFGHIJKLMNOPQRSTUVWXYZÁÀÂÄÃÅĄĂĆČÇĎĐÉÈÊËĘĚÍÌÎÏŁĽŃŇÑÓÒÔÖÕŐŔŘŚŠŞŤŢÚÙÛÜŮŰÝŸŹŽŻ'," + - "'abcdefghijklmnopqrstuvwxyzáàâäãåąăćčçďđéèêëęěíìîïłľńňñóòôöõőŕřśšşťţúùûüůűýÿźžż'),%s)]"; - protected static String idTemplate = "//node[@id = %s]"; - protected static String idTemplateQuoted = "//node[@id = '%s']"; - protected static String labelTemplate = "//node[@label = %s]"; - protected static String idParentTemplate = "//node[@id = '%s']/parent::isComposedBy/parent::node"; - protected static String rootTemplate = "/node"; - protected static String idAttribute = "id"; - protected static String labelAttribute = "label"; - protected static String[] pluginNames = null; - protected String vocabularyName = null; - protected InputSource vocabulary = null; - protected Boolean suggestHierarchy = false; - protected Boolean storeHierarchy = true; - protected String hierarchyDelimiter = "::"; - protected Integer preloadLevel = 1; - protected String valueAttribute = labelAttribute; - protected String valueTemplate = labelTemplate; - - public DSpaceControlledVocabulary() { - super(); - } - - @Override - public boolean storeAuthorityInMetadata() { - // For backward compatibility controlled vocabularies don't store the node id in - // the metadatavalue - return false; - } - - public static String[] getPluginNames() { - if (pluginNames == null) { - initPluginNames(); - } - - return ArrayUtils.clone(pluginNames); - } - - private static synchronized void initPluginNames() { - if (pluginNames == null) { - class xmlFilter implements java.io.FilenameFilter { - @Override - public boolean accept(File dir, String name) { - return name.endsWith(".xml"); - } - } - String vocabulariesPath = DSpaceServicesFactory.getInstance().getConfigurationService() - .getProperty("dspace.dir") + - File.separator + "config" + - File.separator + "controlled-vocabularies"; - String[] xmlFiles = (new File(vocabulariesPath)).list(new xmlFilter()); - List names = new ArrayList<>(); - for (String filename : xmlFiles) { - names.add((new File(filename)).getName().replace(".xml", "")); - } - pluginNames = names.toArray(new String[names.size()]); - log.info("Got plugin names = " + Arrays.deepToString(pluginNames)); - } - } - - protected void init(String locale) { - if (vocabulary == null) { - ConfigurationService config = DSpaceServicesFactory.getInstance().getConfigurationService(); - - log.info("Initializing " + this.getClass().getName()); - vocabularyName = this.getPluginInstanceName(); - String vocabulariesPath = config.getProperty("dspace.dir") + File.separator + "config" + - File.separator + "controlled-vocabularies" + File.separator; - String configurationPrefix = "vocabulary.plugin." + vocabularyName; - storeHierarchy = config.getBooleanProperty(configurationPrefix + ".hierarchy.store", storeHierarchy); - boolean storeIDs = config.getBooleanProperty(configurationPrefix + ".storeIDs", false); - suggestHierarchy = config.getBooleanProperty(configurationPrefix + ".hierarchy.suggest", suggestHierarchy); - preloadLevel = config.getIntProperty(configurationPrefix + ".hierarchy.preloadLevel", preloadLevel); - String configuredDelimiter = config.getProperty(configurationPrefix + ".delimiter"); - if (configuredDelimiter != null) { - hierarchyDelimiter = configuredDelimiter.replaceAll("(^\"|\"$)", ""); - } - if (storeIDs) { - valueAttribute = idAttribute; - valueTemplate = idTemplate; - } - - String filename = vocabulariesPath + vocabularyName + ".xml"; - if (StringUtils.isNotEmpty(locale)) { - String localizedFilename = vocabulariesPath + vocabularyName + "_" + locale + ".xml"; - if (Paths.get(localizedFilename).toFile().exists()) { - filename = localizedFilename; - } - } - log.info("Loading " + filename); - vocabulary = new InputSource(filename); - } - } - - protected String buildString(Node node) { - if (node.getNodeType() == Node.DOCUMENT_NODE || ( - node.getParentNode() != null && - node.getParentNode().getNodeType() == Node.DOCUMENT_NODE)) { - return (""); - } else { - String parentValue = buildString(node.getParentNode()); - Node currentNodeValue = node.getAttributes().getNamedItem(valueAttribute); - if (currentNodeValue != null) { - String currentValue = currentNodeValue.getNodeValue(); - if (parentValue.equals("")) { - return currentValue; - } else { - return (parentValue + this.hierarchyDelimiter + currentValue); - } - } else { - return (parentValue); - } - } - } - - @Override - public Choices getMatches(String text, int start, int limit, String locale) { - init(locale); - log.debug("Getting matches for '" + text + "'"); - String[] textHierarchy = text.split(hierarchyDelimiter, -1); - StringBuilder xpathExpressionBuilder = new StringBuilder(); - for (int i = 0; i < textHierarchy.length; i++) { - xpathExpressionBuilder.append(String.format(xpathTemplate, "$var" + i)); - } - String xpathExpression = xpathExpressionBuilder.toString(); - XPath xpath = XPathFactory.newInstance().newXPath(); - xpath.setXPathVariableResolver(variableName -> { - String varName = variableName.getLocalPart(); - if (varName.startsWith("var")) { - int index = Integer.parseInt(varName.substring(3)); - return textHierarchy[index].toLowerCase(); - } - throw new IllegalArgumentException("Unexpected variable: " + varName); - }); - int total; - List choices; - try { - NodeList results = (NodeList) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODESET); - total = results.getLength(); - choices = getChoicesFromNodeList(results, start, limit); - } catch (XPathExpressionException e) { - log.warn(e.getMessage(), e); - return new Choices(true); - } - return new Choices(choices.toArray(new Choice[choices.size()]), start, total, Choices.CF_AMBIGUOUS, - total > start + limit); - } - - @Override - public Choices getBestMatch(String text, String locale) { - init(locale); - log.debug("Getting best matches for {}'", text); - String[] textHierarchy = text.split(hierarchyDelimiter, -1); - StringBuilder xpathExpressionBuilder = new StringBuilder(); - for (int i = 0; i < textHierarchy.length; i++) { - xpathExpressionBuilder.append(String.format(valueTemplate, "$var" + i)); - } - String xpathExpression = xpathExpressionBuilder.toString(); - XPath xpath = XPathFactory.newInstance().newXPath(); - xpath.setXPathVariableResolver(variableName -> { - String varName = variableName.getLocalPart(); - if (varName.startsWith("var")) { - int index = Integer.parseInt(varName.substring(3)); - return textHierarchy[index]; - } - throw new IllegalArgumentException("Unexpected variable: " + varName); - }); - List choices; - try { - NodeList results = (NodeList) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODESET); - choices = getChoicesFromNodeList(results, 0, 1); - } catch (XPathExpressionException e) { - log.warn(e.getMessage(), e); - return new Choices(true); - } - return new Choices(choices.toArray(new Choice[choices.size()]), 0, choices.size(), Choices.CF_AMBIGUOUS, false); - } - - @Override - public String getLabel(String key, String locale) { - return getNodeValue(key, locale, this.suggestHierarchy); - } - - @Override - public String getValue(String key, String locale) { - return getNodeValue(key, locale, this.storeHierarchy); - } - - @Override - public Choice getChoice(String authKey, String locale) { - Node node; - try { - node = getNode(authKey, locale); - } catch (XPathExpressionException e) { - return null; - } - return createChoiceFromNode(node); - } - - @Override - public boolean isHierarchical() { - init(null); - return true; - } - - @Override - public Choices getTopChoices(String authorityName, int start, int limit, String locale) { - init(locale); - String xpathExpression = rootTemplate; - return getChoicesByXpath(xpathExpression, start, limit); - } - - @Override - public Choices getChoicesByParent(String authorityName, String parentId, int start, int limit, String locale) { - init(locale); - String xpathExpression = String.format(idTemplateQuoted, parentId); - return getChoicesByXpath(xpathExpression, start, limit); - } - - @Override - public Choice getParentChoice(String authorityName, String childId, String locale) { - init(locale); - try { - String xpathExpression = String.format(idParentTemplate, childId); - Choice choice = createChoiceFromNode(getNodeFromXPath(xpathExpression)); - return choice; - } catch (XPathExpressionException e) { - log.error(e.getMessage(), e); - return null; - } - } - - @Override - public Integer getPreloadLevel() { - init(null); - return preloadLevel; - } - - private boolean isRootElement(Node node) { - return node != null && node.getOwnerDocument().getDocumentElement().equals(node); - } - - private Node getNode(String key, String locale) throws XPathExpressionException { - init(locale); - String xpathExpression = String.format(idTemplateQuoted, key); - Node node = getNodeFromXPath(xpathExpression); - return node; - } - - private Node getNodeFromXPath(String xpathExpression) throws XPathExpressionException { - XPath xpath = XPathFactory.newInstance().newXPath(); - Node node = (Node) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODE); - return node; - } - - private List getChoicesFromNodeList(NodeList results, int start, int limit) { - List choices = new ArrayList<>(); - for (int i = 0; i < results.getLength(); i++) { - if (i < start) { - continue; - } - if (choices.size() == limit) { - break; - } - Node node = results.item(i); - Choice choice = new Choice(getAuthority(node), getLabel(node), getValue(node), - isSelectable(node)); - choice.extras = addOtherInformation(getParent(node), getNote(node), getChildren(node), getAuthority(node)); - choices.add(choice); - } - return choices; - } - - private Map addOtherInformation(String parentCurr, String noteCurr, - List childrenCurr, String authorityCurr) { - Map extras = new HashMap<>(); - if (StringUtils.isNotBlank(parentCurr)) { - extras.put("parent", parentCurr); - } - if (StringUtils.isNotBlank(noteCurr)) { - extras.put("note", noteCurr); - } - if (childrenCurr.isEmpty()) { - extras.put("hasChildren", "false"); - } else { - extras.put("hasChildren", "true"); - } - extras.put("id", authorityCurr); - return extras; - } - - private String getNodeValue(String key, String locale, boolean useHierarchy) { - try { - Node node = getNode(key, locale); - if (Objects.isNull(node)) { - return null; - } - if (useHierarchy) { - return this.buildString(node); - } else { - return node.getAttributes().getNamedItem(valueAttribute).getNodeValue(); - } - } catch (XPathExpressionException e) { - return (""); - } - } - - private String getLabel(Node node) { - String hierarchy = this.buildString(node); - if (this.suggestHierarchy) { - return hierarchy; - } else { - return node.getAttributes().getNamedItem("label").getNodeValue(); - } - } - - private String getValue(Node node) { - String hierarchy = this.buildString(node); - if (this.storeHierarchy) { - return hierarchy; - } else { - return node.getAttributes().getNamedItem(valueAttribute).getNodeValue(); - } - } - - private String getNote(Node node) { - NodeList childNodes = node.getChildNodes(); - for (int ci = 0; ci < childNodes.getLength(); ci++) { - Node firstChild = childNodes.item(ci); - if (firstChild != null && "hasNote".equals(firstChild.getNodeName())) { - String nodeValue = firstChild.getTextContent(); - if (StringUtils.isNotBlank(nodeValue)) { - return nodeValue; - } - } - } - return null; - } - - private List getChildren(Node node) { - List children = new ArrayList<>(); - NodeList childNodes = node.getChildNodes(); - for (int ci = 0; ci < childNodes.getLength(); ci++) { - Node firstChild = childNodes.item(ci); - if (firstChild != null && "isComposedBy".equals(firstChild.getNodeName())) { - for (int cii = 0; cii < firstChild.getChildNodes().getLength(); cii++) { - Node childN = firstChild.getChildNodes().item(cii); - if (childN != null && "node".equals(childN.getNodeName())) { - Node childIdAttr = childN.getAttributes().getNamedItem("id"); - if (null != childIdAttr) { - children.add(childIdAttr.getNodeValue()); - } - } - } - break; - } - } - return children; - } - - private boolean isSelectable(Node node) { - Node selectableAttr = node.getAttributes().getNamedItem("selectable"); - if (null != selectableAttr) { - return Boolean.parseBoolean(selectableAttr.getNodeValue()); - } else { // Default is true - return true; - } - } - - private String getParent(Node node) { - Node parentN = node.getParentNode(); - if (parentN != null) { - parentN = parentN.getParentNode(); - if (parentN != null && !isRootElement(parentN)) { - return buildString(parentN); - } - } - return null; - } - - private String getAuthority(Node node) { - Node idAttr = node.getAttributes().getNamedItem("id"); - if (null != idAttr) { // 'id' is optional - return idAttr.getNodeValue(); - } else { - return null; - } - } - - private Choices getChoicesByXpath(String xpathExpression, int start, int limit) { - List choices = new ArrayList<>(); - XPath xpath = XPathFactory.newInstance().newXPath(); - try { - Node parentNode = (Node) xpath.evaluate(xpathExpression, vocabulary, XPathConstants.NODE); - int count = 0; - if (parentNode != null) { - NodeList childNodes = (NodeList) xpath.evaluate(".//isComposedBy", parentNode, XPathConstants.NODE); - if (null != childNodes) { - for (int i = 0; i < childNodes.getLength(); i++) { - Node childNode = childNodes.item(i); - if (childNode != null && "node".equals(childNode.getNodeName())) { - if (count < start || choices.size() >= limit) { - count++; - continue; - } - count++; - choices.add(createChoiceFromNode(childNode)); - } - } - } - return new Choices(choices.toArray(new Choice[choices.size()]), start, count, - Choices.CF_AMBIGUOUS, false); - } - } catch (XPathExpressionException e) { - log.warn(e.getMessage(), e); - return new Choices(true); - } - return new Choices(false); - } - - private Choice createChoiceFromNode(Node node) { - if (node != null && !isRootElement(node)) { - Choice choice = new Choice(getAuthority(node), getLabel(node), getValue(node), - isSelectable(node)); - choice.extras = addOtherInformation(getParent(node), getNote(node),getChildren(node), getAuthority(node)); - return choice; - } - return null; - } - -} diff --git a/dspace/modules/server/src/main/webapp/.gitignore b/dspace/modules/server/src/main/webapp/.gitignore new file mode 100644 index 000000000000..e69de29bb2d1 From 8cba843b9204a7ae4ec6f061d5ca61f600e6457d Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 25 Mar 2026 17:39:47 +0100 Subject: [PATCH 129/283] requestItemService.findbyBitstream for more efficient bitstream deletion (cherry picked from commit 85e76a9193f835824775778bad216ac10ad5c555) stripped out the new 'requestitem access token' feature, kept some small improvements (interface method scope, DAO findByItem query) --- .../requestitem/RequestItemServiceImpl.java | 7 +++ .../app/requestitem/dao/RequestItemDAO.java | 16 ++++++- .../dao/impl/RequestItemDAOImpl.java | 17 +++++++- .../service/RequestItemService.java | 43 +++++++++++++------ .../dspace/content/BitstreamServiceImpl.java | 8 ++-- 5 files changed, 70 insertions(+), 21 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java index b915cfedd346..009bbde79572 100644 --- a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java @@ -11,6 +11,8 @@ import java.util.Date; import java.util.Iterator; import java.util.List; +import java.util.TimeZone; +import java.util.UUID; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -96,6 +98,11 @@ public Iterator findByItem(Context context, Item item) throws SQLEx return requestItemDAO.findByItem(context, item); } + @Override + public Iterator findByBitstreamId(Context context, UUID bitstreamId) throws SQLException { + return requestItemDAO.findByBitstreamId(context, bitstreamId); + } + @Override public void update(Context context, RequestItem requestItem) { try { diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java b/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java index b36ae58e0ca1..9c6954fe6be1 100644 --- a/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java +++ b/dspace-api/src/main/java/org/dspace/app/requestitem/dao/RequestItemDAO.java @@ -9,6 +9,7 @@ import java.sql.SQLException; import java.util.Iterator; +import java.util.UUID; import org.dspace.app.requestitem.RequestItem; import org.dspace.content.Item; @@ -26,7 +27,7 @@ */ public interface RequestItemDAO extends GenericDAO { /** - * Fetch a request named by its unique token (passed in emails). + * Fetch a request named by its unique approval token (passed in emails). * * @param context the current DSpace context. * @param token uniquely identifies the request. @@ -36,4 +37,17 @@ public interface RequestItemDAO extends GenericDAO { public RequestItem findByToken(Context context, String token) throws SQLException; public Iterator findByItem(Context context, Item item) throws SQLException; + + /** + * Retrieve all requests (as iterator) for a given bitstream UUID + * A UUID parameter is used here rather than Bitstream object, to make it usable + * in situations even when a bitstream object no longer exists, but orphaned + * entries need to be found by their (previous) bitstream UUID. + * + * @param context current DSpace context + * @param bitstreamId the bitstream UUID to search for + * @return the matching requests (or empty iterator) + */ + public Iterator findByBitstreamId(Context context, UUID bitstreamId) throws SQLException; + } diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/dao/impl/RequestItemDAOImpl.java b/dspace-api/src/main/java/org/dspace/app/requestitem/dao/impl/RequestItemDAOImpl.java index 008174ded88c..b1ef405f5e10 100644 --- a/dspace-api/src/main/java/org/dspace/app/requestitem/dao/impl/RequestItemDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/requestitem/dao/impl/RequestItemDAOImpl.java @@ -9,6 +9,7 @@ import java.sql.SQLException; import java.util.Iterator; +import java.util.UUID; import javax.persistence.Query; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; @@ -42,10 +43,22 @@ public RequestItem findByToken(Context context, String token) throws SQLExceptio criteriaQuery.where(criteriaBuilder.equal(requestItemRoot.get(RequestItem_.token), token)); return uniqueResult(context, criteriaQuery, false, RequestItem.class); } + @Override public Iterator findByItem(Context context, Item item) throws SQLException { - Query query = createQuery(context, "FROM RequestItem WHERE item_id= :uuid"); - query.setParameter("uuid", item.getID()); + CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context); + CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, RequestItem.class); + Root requestItemRoot = criteriaQuery.from(RequestItem.class); + criteriaQuery.select(requestItemRoot); + criteriaQuery.where(criteriaBuilder.equal(requestItemRoot.get(RequestItem_.item), item)); + Query query = createQuery(context, criteriaQuery); + return iterate(query); + } + + @Override + public Iterator findByBitstreamId(Context context, UUID bitstreamId) throws SQLException { + Query query = createQuery(context, "FROM RequestItem WHERE bitstream.id = :bitstreamId"); + query.setParameter("bitstreamId", bitstreamId); return iterate(query); } } diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java b/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java index efac3b18bc7c..5c27ba9acb55 100644 --- a/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java +++ b/dspace-api/src/main/java/org/dspace/app/requestitem/service/RequestItemService.java @@ -10,6 +10,7 @@ import java.sql.SQLException; import java.util.Iterator; import java.util.List; +import java.util.UUID; import org.dspace.app.requestitem.RequestItem; import org.dspace.content.Bitstream; @@ -40,7 +41,7 @@ public interface RequestItemService { * @return the token of the request item * @throws SQLException if database error */ - public String createRequest(Context context, Bitstream bitstream, Item item, + String createRequest(Context context, Bitstream bitstream, Item item, boolean allFiles, String reqEmail, String reqName, String reqMessage) throws SQLException; @@ -49,35 +50,51 @@ public String createRequest(Context context, Bitstream bitstream, Item item, * * @param context current DSpace session. * @return all item requests. - * @throws java.sql.SQLException passed through. + * @throws SQLException passed through. */ - public List findAll(Context context) + List findAll(Context context) throws SQLException; /** - * Retrieve a request by its token. + * Retrieve a request by its approver token. * * @param context current DSpace session. - * @param token the token identifying the request. + * @param token the token identifying the request to be approved. * @return the matching request, or null if not found. */ - public RequestItem findByToken(Context context, String token); + RequestItem findByToken(Context context, String token); /** - * Retrieve a request based on the item. + * Retrieve all requests (as iterator) for a given item * @param context current DSpace session. * @param item the item to find requests for. - * @return the matching requests, or null if not found. + * @return the matching requests (or empty iterator) */ - public Iterator findByItem(Context context, Item item) throws SQLException; + Iterator findByItem(Context context, Item item) throws SQLException; + /** - * Save updates to the record. Only accept_request, and decision_date are set-able. + * Retrieve all requests (as iterator) for a given bitstream UUID + * A UUID parameter is used here rather than Bitstream object, to make it usable + * in situations even when a bitstream object no longer exists, but orphaned + * entries need to be found by their (previous) bitstream UUID. + * + * @param context current DSpace context + * @param bitstreamId the bitstream UUID to search for + * @return the matching requests (or empty iterator) + */ + Iterator findByBitstreamId(Context context, UUID bitstreamId) throws SQLException; + + /** + * Save updates to the record. Only accept_request, decision_date, access_period are settable. + * + * Note: the "is settable" rules mentioned here are enforced in RequestItemRest with annotations meaning that + * these JSON properties are considered READ-ONLY by the core DSpaceRestRepository methods * * @param context The relevant DSpace Context. * @param requestItem requested item */ - public void update(Context context, RequestItem requestItem); + void update(Context context, RequestItem requestItem); /** * Remove the record from the database. @@ -85,7 +102,7 @@ public List findAll(Context context) * @param context current DSpace context. * @param request record to be removed. */ - public void delete(Context context, RequestItem request); + void delete(Context context, RequestItem request); /** * Is there at least one valid READ resource policy for this object? @@ -94,6 +111,6 @@ public List findAll(Context context) * @return true if a READ policy applies. * @throws SQLException passed through. */ - public boolean isRestricted(Context context, DSpaceObject o) + boolean isRestricted(Context context, DSpaceObject o) throws SQLException; } diff --git a/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java b/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java index c19b87089e64..a9f509d1c3bb 100644 --- a/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/BitstreamServiceImpl.java @@ -293,11 +293,9 @@ public void delete(Context context, Bitstream bitstream) throws SQLException, Au // Remove any RequestItem entities associated with this bitstream ensuring there are no requests referencing // a deleted bitstream - List requestItems = requestItemService.findAll(context); - for (RequestItem requestItem : requestItems) { - if (bitstream.equals(requestItem.getBitstream())) { - requestItemService.delete(context, requestItem); - } + Iterator requestItems = requestItemService.findByBitstreamId(context, bitstream.getID()); + while (requestItems.hasNext()) { + requestItemService.delete(context, requestItems.next()); } // Remove policies only after the bitstream has been updated (otherwise the current user has not WRITE rights) From 32f2d6adc648405c0580dcc9f6f25bcafc5d3547 Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Wed, 25 Mar 2026 20:19:09 +0100 Subject: [PATCH 130/283] Add IT coverage for findByBitstreamId and bitstream deletion cleanup - Add testFindByBitstreamId: verifies the new findByBitstreamId method returns matching requests, returns empty for bitstreams without requests, and returns empty for nonexistent UUIDs. - Enhance testDeleteBitstreamRemovesRequestItem: also verify via findByBitstreamId both before and after deletion. (cherry picked from commit 11165705b9982498c1672f95968e79317c2fd8d2) --- .../requestitem/RequestItemServiceImpl.java | 1 - .../app/rest/RequestItemRepositoryIT.java | 45 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java index 009bbde79572..d6d0225655e0 100644 --- a/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/requestitem/RequestItemServiceImpl.java @@ -11,7 +11,6 @@ import java.util.Date; import java.util.Iterator; import java.util.List; -import java.util.TimeZone; import java.util.UUID; import org.apache.logging.log4j.LogManager; diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java index 8495399169f9..8b3e858500b3 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RequestItemRepositoryIT.java @@ -684,11 +684,56 @@ public void testDeleteBitstreamRemovesRequestItem() throws Exception { // verify the body is empty .andExpect(jsonPath("$").doesNotExist()); + // Verify the request item exists via findByBitstreamId before deletion + Iterator bitstreamRequests = requestItemService.findByBitstreamId(context, bitstream.getID()); + assertTrue("Request item should exist before bitstream deletion", bitstreamRequests.hasNext()); + // Delete associated Bitstream ContentServiceFactory.getInstance().getBitstreamService().delete(context, bitstream); // Verify that all RequestItems related to this bitstream have been removed Iterator itemRequests = requestItemService.findByItem(context, item); assertFalse(itemRequests.hasNext()); + + // Also verify via findByBitstreamId + Iterator remaining = requestItemService.findByBitstreamId(context, bitstream.getID()); + assertFalse("Request items should be removed after bitstream deletion", remaining.hasNext()); + } + + /** + * Test that findByBitstreamId returns matching request items and does not return items for other bitstreams. + */ + @Test + public void testFindByBitstreamId() throws Exception { + context.turnOffAuthorisationSystem(); + + // Create a request item for the existing bitstream + RequestItemBuilder.createRequestItem(context, item, bitstream) + .build(); + + // Create a second bitstream with no request items + InputStream is2 = new ByteArrayInputStream("other content".getBytes()); + Bitstream bitstream2 = BitstreamBuilder + .createBitstream(context, item, is2) + .withName("Other Bitstream") + .build(); + + context.restoreAuthSystemState(); + + // findByBitstreamId should return the request for the first bitstream + Iterator results = requestItemService.findByBitstreamId(context, bitstream.getID()); + assertTrue("Should find request item for bitstream", results.hasNext()); + RequestItem found = results.next(); + assertEquals("Request item should reference correct bitstream", + bitstream.getID(), found.getBitstream().getID()); + assertFalse("Should only find one request item", results.hasNext()); + + // findByBitstreamId should return nothing for the second bitstream + Iterator noResults = requestItemService.findByBitstreamId(context, bitstream2.getID()); + assertFalse("Should find no request items for bitstream without requests", noResults.hasNext()); + + // findByBitstreamId should return nothing for a random UUID + Iterator randomResults = requestItemService.findByBitstreamId(context, UUID.randomUUID()); + assertFalse("Should find no request items for nonexistent bitstream", randomResults.hasNext()); } } From f3846c4f38862783ddd05269f0010e524ea87c9b Mon Sep 17 00:00:00 2001 From: abhinav Date: Tue, 20 May 2025 17:14:36 +0200 Subject: [PATCH 131/283] Improve caching for entities and relationship types (cherry picked from commit 11c06f21e694af5c7d7f630c2033fb2256f1a646) --- .../main/java/org/dspace/content/EntityType.java | 5 +++++ .../java/org/dspace/content/RelationshipType.java | 5 +++++ .../dspace/content/dao/impl/EntityTypeDAOImpl.java | 2 +- .../content/dao/impl/RelationshipTypeDAOImpl.java | 6 +++--- .../h2/V7.6_2025.05.20__entity_types_caching.sql | 9 +++++++++ .../V7.6_2025.05.20__entity_types_caching.sql | 9 +++++++++ dspace/config/hibernate-ehcache-config.xml | 14 ++++++++++++++ 7 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql create mode 100644 dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.05.20__entity_types_caching.sql diff --git a/dspace-api/src/main/java/org/dspace/content/EntityType.java b/dspace-api/src/main/java/org/dspace/content/EntityType.java index 20ab758a0b76..a70825e5a239 100644 --- a/dspace-api/src/main/java/org/dspace/content/EntityType.java +++ b/dspace-api/src/main/java/org/dspace/content/EntityType.java @@ -8,6 +8,7 @@ package org.dspace.content; import java.util.Objects; +import javax.persistence.Cacheable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -19,6 +20,8 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.dspace.core.ReloadableEntity; +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; /** * Class representing an EntityType @@ -26,6 +29,8 @@ * This also has a label that will be used to identify what kind of EntityType this object is */ @Entity +@Cacheable +@Cache(usage = CacheConcurrencyStrategy.READ_ONLY) @Table(name = "entity_type") public class EntityType implements ReloadableEntity { diff --git a/dspace-api/src/main/java/org/dspace/content/RelationshipType.java b/dspace-api/src/main/java/org/dspace/content/RelationshipType.java index 5e6941052b83..3e8227c88f4b 100644 --- a/dspace-api/src/main/java/org/dspace/content/RelationshipType.java +++ b/dspace-api/src/main/java/org/dspace/content/RelationshipType.java @@ -7,6 +7,7 @@ */ package org.dspace.content; +import javax.persistence.Cacheable; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -21,6 +22,8 @@ import org.dspace.core.Context; import org.dspace.core.ReloadableEntity; +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; /** * Class representing a RelationshipType @@ -31,6 +34,8 @@ * The cardinality properties describe how many of each relations this relationshipType can support */ @Entity +@Cacheable +@Cache(usage = CacheConcurrencyStrategy.READ_ONLY) @Table(name = "relationship_type") public class RelationshipType implements ReloadableEntity { diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/EntityTypeDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/EntityTypeDAOImpl.java index 489f4cd0667d..957cbdbb1576 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/EntityTypeDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/EntityTypeDAOImpl.java @@ -53,7 +53,7 @@ public List getEntityTypesByNames(Context context, List name orderList.add(criteriaBuilder.desc(entityTypeRoot.get(EntityType_.label))); criteriaQuery.select(entityTypeRoot).orderBy(orderList); criteriaQuery.where(entityTypeRoot.get(EntityType_.LABEL).in(names)); - return list(context, criteriaQuery, false, EntityType.class, limit, offset); + return list(context, criteriaQuery, true, EntityType.class, limit, offset); } @Override diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipTypeDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipTypeDAOImpl.java index 7fff2a1f57da..2d31707e6eb3 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipTypeDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipTypeDAOImpl.java @@ -46,7 +46,7 @@ public RelationshipType findbyTypesAndTypeName(Context context, EntityType leftT criteriaBuilder.equal(relationshipTypeRoot.get(RelationshipType_.rightType), rightType), criteriaBuilder.equal(relationshipTypeRoot.get(RelationshipType_.leftwardType), leftwardType), criteriaBuilder.equal(relationshipTypeRoot.get(RelationshipType_.rightwardType), rightwardType))); - return uniqueResult(context, criteriaQuery, false, RelationshipType.class); + return uniqueResult(context, criteriaQuery, true, RelationshipType.class); } @Override @@ -96,7 +96,7 @@ public List findByEntityType(Context context, EntityType entit List orderList = new LinkedList<>(); orderList.add(criteriaBuilder.asc(relationshipTypeRoot.get(RelationshipType_.ID))); criteriaQuery.orderBy(orderList); - return list(context, criteriaQuery, false, RelationshipType.class, limit, offset); + return list(context, criteriaQuery, true, RelationshipType.class, limit, offset); } @Override @@ -122,7 +122,7 @@ public List findByEntityType(Context context, EntityType entit criteriaBuilder.equal(relationshipTypeRoot.get(RelationshipType_.rightType), entityType) ); } - return list(context, criteriaQuery, false, RelationshipType.class, limit, offset); + return list(context, criteriaQuery, true, RelationshipType.class, limit, offset); } @Override diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql new file mode 100644 index 000000000000..2a1510ff6f04 --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql @@ -0,0 +1,9 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +CREATE INDEX entity_type_label_upper_idx ON entity_type (UPPER(label)); diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.05.20__entity_types_caching.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.05.20__entity_types_caching.sql new file mode 100644 index 000000000000..2a1510ff6f04 --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.05.20__entity_types_caching.sql @@ -0,0 +1,9 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +CREATE INDEX entity_type_label_upper_idx ON entity_type (UPPER(label)); diff --git a/dspace/config/hibernate-ehcache-config.xml b/dspace/config/hibernate-ehcache-config.xml index e2edf67b602e..c88f03135603 100644 --- a/dspace/config/hibernate-ehcache-config.xml +++ b/dspace/config/hibernate-ehcache-config.xml @@ -145,4 +145,18 @@ + + + 500 + + + + + + 100 + + + From 895870e347e09050303e9486f09f8e8a1c27d72c Mon Sep 17 00:00:00 2001 From: abhinav Date: Wed, 21 May 2025 14:54:44 +0200 Subject: [PATCH 132/283] add expiry to ehcache-config (cherry picked from commit e6dec51c34915ddbeb83f1b09f87b41c0e777eea) --- dspace/config/hibernate-ehcache-config.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dspace/config/hibernate-ehcache-config.xml b/dspace/config/hibernate-ehcache-config.xml index c88f03135603..63c4a5ad1435 100644 --- a/dspace/config/hibernate-ehcache-config.xml +++ b/dspace/config/hibernate-ehcache-config.xml @@ -147,6 +147,9 @@ + + + 500 @@ -154,6 +157,9 @@ + + + 100 From 28fd1e5084934e470673bd51730b3b2a0dee4187 Mon Sep 17 00:00:00 2001 From: abhinav Date: Thu, 22 May 2025 10:55:54 +0200 Subject: [PATCH 133/283] remove unsupported upper() from H2 migration (cherry picked from commit 11af1788712d3b9ec78ea2aee46bbe198efa8a65) --- .../sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql index 2a1510ff6f04..c712cfa51713 100644 --- a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql @@ -6,4 +6,4 @@ -- http://www.dspace.org/license/ -- -CREATE INDEX entity_type_label_upper_idx ON entity_type (UPPER(label)); +CREATE INDEX entity_type_label_upper_idx ON entity_type (label); From 55f721b166988984a0518c5ba600910224408efd Mon Sep 17 00:00:00 2001 From: abhinav Date: Thu, 22 May 2025 13:13:21 +0200 Subject: [PATCH 134/283] fix cache concurrency strategy (cherry picked from commit 2091b2aa940176a4bfa5f144c72346981719bbe4) --- dspace-api/src/main/java/org/dspace/content/EntityType.java | 2 +- .../src/main/java/org/dspace/content/RelationshipType.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/EntityType.java b/dspace-api/src/main/java/org/dspace/content/EntityType.java index a70825e5a239..1c041e776e70 100644 --- a/dspace-api/src/main/java/org/dspace/content/EntityType.java +++ b/dspace-api/src/main/java/org/dspace/content/EntityType.java @@ -30,7 +30,7 @@ */ @Entity @Cacheable -@Cache(usage = CacheConcurrencyStrategy.READ_ONLY) +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name = "entity_type") public class EntityType implements ReloadableEntity { diff --git a/dspace-api/src/main/java/org/dspace/content/RelationshipType.java b/dspace-api/src/main/java/org/dspace/content/RelationshipType.java index 3e8227c88f4b..5b89911e1f72 100644 --- a/dspace-api/src/main/java/org/dspace/content/RelationshipType.java +++ b/dspace-api/src/main/java/org/dspace/content/RelationshipType.java @@ -35,7 +35,7 @@ */ @Entity @Cacheable -@Cache(usage = CacheConcurrencyStrategy.READ_ONLY) +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) @Table(name = "relationship_type") public class RelationshipType implements ReloadableEntity { From 1e0ae3bc9a85ab4a9cfd345de737c83f0ecbbda4 Mon Sep 17 00:00:00 2001 From: abhinav Date: Fri, 30 May 2025 12:20:25 +0200 Subject: [PATCH 135/283] add cache expiry time (cherry picked from commit 894ffbf68704f8b89279f01bafa55db55dee6cf9) --- dspace/config/hibernate-ehcache-config.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace/config/hibernate-ehcache-config.xml b/dspace/config/hibernate-ehcache-config.xml index 63c4a5ad1435..80ba1717fe33 100644 --- a/dspace/config/hibernate-ehcache-config.xml +++ b/dspace/config/hibernate-ehcache-config.xml @@ -148,7 +148,7 @@ - + 1 500 @@ -158,7 +158,7 @@ - + 1 100 From 482fe4880e4867641a63a34bc40cec7dd015e770 Mon Sep 17 00:00:00 2001 From: abhinav Date: Mon, 2 Jun 2025 15:29:04 +0200 Subject: [PATCH 136/283] cache RelationshipDAO#findByItem as well (cherry picked from commit 8c0f5bfc566ffca00e4dc15c21de7eafe36d4e8c) --- .../java/org/dspace/content/dao/impl/RelationshipDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java index e2f84bc1cb64..ac626cf9267f 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java @@ -57,7 +57,7 @@ public List findByItem( ) ); - return list(context, criteriaQuery, false, Relationship.class, limit, offset); + return list(context, criteriaQuery, true, Relationship.class, limit, offset); } /** From 1a782f9dceeae76ccba4997a0a3afe7152e08672 Mon Sep 17 00:00:00 2001 From: abhinav Date: Wed, 25 Mar 2026 18:42:51 +0100 Subject: [PATCH 137/283] update date on migration files (cherry picked from commit e7d1e269748f322bd0672bbd2e651d5a80ec0bdd) --- ...ypes_caching.sql => V7.6_2026.03.25__entity_types_caching.sql} | 0 ...ypes_caching.sql => V7.6_2026.03.25__entity_types_caching.sql} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/{V7.6_2025.05.20__entity_types_caching.sql => V7.6_2026.03.25__entity_types_caching.sql} (100%) rename dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/{V7.6_2025.05.20__entity_types_caching.sql => V7.6_2026.03.25__entity_types_caching.sql} (100%) diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql similarity index 100% rename from dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2025.05.20__entity_types_caching.sql rename to dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.05.20__entity_types_caching.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2026.03.25__entity_types_caching.sql similarity index 100% rename from dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2025.05.20__entity_types_caching.sql rename to dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V7.6_2026.03.25__entity_types_caching.sql From 5846b13fcc08fdff467ba72c2b60cf3fb53779d0 Mon Sep 17 00:00:00 2001 From: abhinav Date: Wed, 20 May 2026 11:27:00 +0200 Subject: [PATCH 138/283] undo cache findByItem query in RelationshipDAOImpl (cherry picked from commit 9c57f390753a369dde30c6b1f6aaab5b7fa36335) --- .../java/org/dspace/content/dao/impl/RelationshipDAOImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java b/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java index ac626cf9267f..e2f84bc1cb64 100644 --- a/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java +++ b/dspace-api/src/main/java/org/dspace/content/dao/impl/RelationshipDAOImpl.java @@ -57,7 +57,7 @@ public List findByItem( ) ); - return list(context, criteriaQuery, true, Relationship.class, limit, offset); + return list(context, criteriaQuery, false, Relationship.class, limit, offset); } /** From 0ca2c2f56e040d8cffe42ae7fd3e2317e5813bc7 Mon Sep 17 00:00:00 2001 From: abhinav Date: Wed, 20 May 2026 11:34:09 +0200 Subject: [PATCH 139/283] add comments to cache configs (cherry picked from commit 50737b1b24bf2207059b0300329cf065ee21c05d) --- dspace/config/hibernate-ehcache-config.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace/config/hibernate-ehcache-config.xml b/dspace/config/hibernate-ehcache-config.xml index 80ba1717fe33..680211a9acdc 100644 --- a/dspace/config/hibernate-ehcache-config.xml +++ b/dspace/config/hibernate-ehcache-config.xml @@ -145,6 +145,8 @@ + @@ -155,6 +157,7 @@ + From e59dd8452c5007f2e81aaf955c8f151ad424f28f Mon Sep 17 00:00:00 2001 From: abhinav Date: Wed, 20 May 2026 16:20:18 +0200 Subject: [PATCH 140/283] add comments to h2 migration (cherry picked from commit b49536bd8eb2b5e0209530a1ba0b78ad4e534f7c) --- .../sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql index c712cfa51713..1b6db9f52847 100644 --- a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V7.6_2026.03.25__entity_types_caching.sql @@ -6,4 +6,6 @@ -- http://www.dspace.org/license/ -- +-- H2 does not support upper and hence the migration differs slightly from the postgres version +-- In a test environment this will not make a meaningful impact CREATE INDEX entity_type_label_upper_idx ON entity_type (label); From 3185a1c8d435f0a5f834b466732a8d5b75a13f83 Mon Sep 17 00:00:00 2001 From: Yury Bondarenko Date: Tue, 19 May 2026 12:57:22 +0200 Subject: [PATCH 141/283] Fix missing OAI identifier interpolation on config change When dspace.cfg is updated while Tomcat is running, the oai.identifier.prefix fallback from dspace-oai's DSpaceConfigurationService gets cleared out. If the cached Identify request gets invalidated after this, it will be regenerated with ${oai.identifier.prefix} in place We re-initialize this fallback when re-creating the Identify content to account for this. This is the only place where setProperty is used outside of tests. (cherry picked from commit 263513bcbaffae00d1cbaf1f5237b0f05738a76d) --- .../api/config/ConfigurationService.java | 2 ++ .../impl/config/DSpaceConfigurationService.java | 16 +++++++++++----- .../impl/xoai/DSpaceRepositoryConfiguration.java | 1 + .../dspace/services/ConfigurationService.java | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/api/config/ConfigurationService.java b/dspace-oai/src/main/java/org/dspace/xoai/services/api/config/ConfigurationService.java index bc6083166baf..997e08adec83 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/api/config/ConfigurationService.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/api/config/ConfigurationService.java @@ -15,4 +15,6 @@ public interface ConfigurationService { boolean getBooleanProperty(String module, String key, boolean defaultValue); boolean getBooleanProperty(String key, boolean defaultValue); + + void ensureRequiredConfiguration(); } diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/config/DSpaceConfigurationService.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/config/DSpaceConfigurationService.java index 67d4f09f5c88..0fb0c51defd3 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/config/DSpaceConfigurationService.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/config/DSpaceConfigurationService.java @@ -20,12 +20,18 @@ public class DSpaceConfigurationService implements ConfigurationService { * Initialize the OAI Configuration Service */ public DSpaceConfigurationService() { - // Check the DSpace ConfigurationService for required OAI-PMH settings. - // If they do not exist, set sane defaults as needed. + ensureRequiredConfiguration(); + } - // Per OAI Spec, "oai.identifier.prefix" should be the hostname / domain name of the site. - // This configuration is needed by the [dspace]/config/crosswalks/oai/description.xml template, so if - // unspecified we will dynamically set it to the hostname of the "dspace.ui.url" configuration. + /** + * Check the DSpace ConfigurationService for required OAI-PMH settings. + * If they do not exist, set sane defaults as needed. + *
    + * Per OAI Spec, "oai.identifier.prefix" should be the hostname / domain name of the site. + * This configuration is needed by the [dspace]/config/crosswalks/oai/description.xml template, so if + * unspecified we will dynamically set it to the hostname of the "dspace.ui.url" configuration. + */ + public void ensureRequiredConfiguration() { if (!configurationService.hasProperty("oai.identifier.prefix")) { configurationService.setProperty("oai.identifier.prefix", Utils.getHostName(configurationService.getProperty("dspace.ui.url"))); diff --git a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/xoai/DSpaceRepositoryConfiguration.java b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/xoai/DSpaceRepositoryConfiguration.java index 2a000f43ea06..79b04094740b 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/services/impl/xoai/DSpaceRepositoryConfiguration.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/services/impl/xoai/DSpaceRepositoryConfiguration.java @@ -133,6 +133,7 @@ public String getRepositoryName() { @Override public List getDescription() { + configurationService.ensureRequiredConfiguration(); List result = new ArrayList(); String descriptionFile = configurationService.getProperty("oai.description.file"); if (descriptionFile == null) { diff --git a/dspace-services/src/main/java/org/dspace/services/ConfigurationService.java b/dspace-services/src/main/java/org/dspace/services/ConfigurationService.java index 526a518a0911..7681553d4168 100644 --- a/dspace-services/src/main/java/org/dspace/services/ConfigurationService.java +++ b/dspace-services/src/main/java/org/dspace/services/ConfigurationService.java @@ -251,6 +251,8 @@ public interface ConfigurationService { * Set a configuration property (setting) in the system. * Type is not important here since conversion happens automatically * when properties are requested. + *
    + * Note: use with care, the value will be reset when the configuration is reloaded! * * @param name the property name * @param value the property value (set this to null to clear out the property) From 421ff55dfe34fe91318c55e322bd6f4989614ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20L=C3=B6hden?= <75250168+EikLoe@users.noreply.github.com> Date: Thu, 21 May 2026 17:28:39 +0200 Subject: [PATCH 142/283] Merge pull request #12350 from dspace-unimr/fix/ds-12349-handle-submission-with-non-public-items-and-item-filters Fix submission with non public items and AccessCondition filters (cherry picked from commit c70841f0ee92d6a655954fa53532bd47229b0207) --- .../logic/condition/ReadableByGroupCondition.java | 2 +- .../org/dspace/content/logic/LogicalFilterTest.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/content/logic/condition/ReadableByGroupCondition.java b/dspace-api/src/main/java/org/dspace/content/logic/condition/ReadableByGroupCondition.java index 20138beb47ef..e7b0bb7e046c 100644 --- a/dspace-api/src/main/java/org/dspace/content/logic/condition/ReadableByGroupCondition.java +++ b/dspace-api/src/main/java/org/dspace/content/logic/condition/ReadableByGroupCondition.java @@ -49,7 +49,7 @@ public boolean getResult(Context context, Item item) throws LogicalStatementExce List policies = authorizeService .getPoliciesActionFilter(context, item, Constants.getActionID(action)); for (ResourcePolicy policy : policies) { - if (policy.getGroup().getName().equals(group)) { + if (policy.getGroup() != null && policy.getGroup().getName().equals(group)) { return true; } } diff --git a/dspace-api/src/test/java/org/dspace/content/logic/LogicalFilterTest.java b/dspace-api/src/test/java/org/dspace/content/logic/LogicalFilterTest.java index 0e0864622043..c84665f29853 100644 --- a/dspace-api/src/test/java/org/dspace/content/logic/LogicalFilterTest.java +++ b/dspace-api/src/test/java/org/dspace/content/logic/LogicalFilterTest.java @@ -57,8 +57,10 @@ import org.dspace.content.service.MetadataValueService; import org.dspace.content.service.WorkspaceItemService; import org.dspace.core.Constants; +import org.dspace.eperson.EPerson; import org.dspace.eperson.Group; import org.dspace.eperson.factory.EPersonServiceFactory; +import org.dspace.eperson.service.EPersonService; import org.dspace.eperson.service.GroupService; import org.junit.After; import org.junit.Before; @@ -81,6 +83,7 @@ public class LogicalFilterTest extends AbstractUnitTest { private MetadataValueService metadataValueService = ContentServiceFactory.getInstance().getMetadataValueService(); private AuthorizeService authorizeService = AuthorizeServiceFactory.getInstance().getAuthorizeService(); private GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); + private EPersonService epersonService = EPersonServiceFactory.getInstance().getEPersonService(); // Logger private static final Logger log = org.apache.logging.log4j.LogManager.getLogger(LogicalFilterTest.class); @@ -603,6 +606,10 @@ public void testReadableByGroupCondition() { groupService.setName(g, "Test Group"); groupService.update(context, g); authorizeService.addPolicy(context, itemOne, Constants.READ, g); + EPerson e = epersonService.create(context); + epersonService.update(context, e); + authorizeService.removeAllPolicies(context, itemThree); + authorizeService.addPolicy(context, itemThree, Constants.READ, e); context.restoreAuthSystemState(); } catch (AuthorizeException | SQLException e) { fail("Exception thrown adding group READ policy to item: " + itemOne + ": " + e.getMessage()); @@ -620,6 +627,9 @@ public void testReadableByGroupCondition() { // Test the filter on itemTwo - this item has no policies: expect false assertFalse("itemTwo unexpectedly matched the 'is readable by Test Group' test", filter.getResult(context, itemTwo)); + // Test the filter on itemThree - this item has only a person related policy: expect false + assertFalse("itemThree unexpectedly matched the 'is readable by Test Group' test", + filter.getResult(context, itemThree)); } catch (LogicalStatementException e) { log.error(e.getMessage()); fail("LogicalStatementException thrown testing the ReadableByGroup filter" + e.getMessage()); From c23e08e90ae2a9b23a98ca55643903f0a2822a0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 20 May 2026 15:50:07 +0000 Subject: [PATCH 143/283] build(deps): bump org.apache.commons:commons-configuration2 Bumps org.apache.commons:commons-configuration2 from 2.14.0 to 2.15.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-configuration2 dependency-version: 2.15.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] (cherry picked from commit 649fe8734e219d31eaa5704b4073509fa7406a2a) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ee4bc7f0d57..eb1b3497aaa2 100644 --- a/pom.xml +++ b/pom.xml @@ -1499,7 +1499,7 @@ org.apache.commons commons-configuration2 - 2.14.0 + 2.15.0 org.apache.commons From 7ac17f68432cff1e9463f05421fc8a29516000b8 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Sat, 16 May 2026 22:05:27 +0200 Subject: [PATCH 144/283] ORE aggregated resource URI validation --- .../crosswalk/OREIngestionCrosswalk.java | 84 +++++++++++++++++-- dspace/config/modules/oai.cfg | 7 ++ 2 files changed, 83 insertions(+), 8 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java index f756aae22577..9e890a6046fa 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java @@ -11,6 +11,8 @@ import java.io.IOException; import java.io.InputStream; import java.net.ConnectException; +import java.net.URI; +import java.net.URISyntaxException; import java.net.URL; import java.sql.SQLException; import java.text.NumberFormat; @@ -18,6 +20,8 @@ import java.util.Date; import java.util.HashSet; import java.util.List; +import java.util.Locale; +import java.util.Objects; import java.util.Set; import org.apache.logging.log4j.Logger; @@ -34,6 +38,8 @@ import org.dspace.content.service.ItemService; import org.dspace.core.Constants; import org.dspace.core.Context; +import org.dspace.services.ConfigurationService; +import org.dspace.services.factory.DSpaceServicesFactory; import org.jdom2.Attribute; import org.jdom2.Document; import org.jdom2.Element; @@ -76,6 +82,7 @@ public class OREIngestionCrosswalk .getBitstreamFormatService(); protected BundleService bundleService = ContentServiceFactory.getInstance().getBundleService(); protected ItemService itemService = ContentServiceFactory.getInstance().getItemService(); + protected ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); @Override @@ -173,9 +180,13 @@ public void ingest(Context context, DSpaceObject dso, Element root, boolean crea try { // Make sure the url string escapes all the oddball characters String processedURL = encodeForURL(href); - // Generate a requeset for the aggregated resource - ARurl = new URL(processedURL); - in = ARurl.openStream(); + if (validResourceUri(entryId, processedURL)) { + // Generate a request for the aggregated resource + ARurl = new URL(processedURL); + in = ARurl.openStream(); + } else { + throw new FileNotFoundException("Failed to validate " + processedURL); + } } catch (FileNotFoundException fe) { log.error("The provided URI failed to return a resource: " + href); } catch (ConnectException fe) { @@ -219,17 +230,17 @@ public void ingest(Context context, DSpaceObject dso, Element root, boolean crea * @param sourceString source unescaped string */ private String encodeForURL(String sourceString) { - Character lowalpha[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', + Character[] lowalpha = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}; - Character upalpha[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + Character[] upalpha = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'}; - Character digit[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; - Character mark[] = {'-', '_', '.', '!', '~', '*', '\'', '(', ')'}; + Character[] digit = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + Character[] mark = {'-', '_', '.', '!', '~', '*', '\'', '(', ')'}; // reserved - Character reserved[] = {';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '%', '#'}; + Character[] reserved = {';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '%', '#'}; Set URLcharsSet = new HashSet(); URLcharsSet.addAll(Arrays.asList(lowalpha)); @@ -251,4 +262,61 @@ private String encodeForURL(String sourceString) { return processedString.toString(); } + /** + * Validate a resource URI against the host and scheme of the remote OAI endpoint, or a configured + * list of allowed prefixes. + * This still implicitly "trusts" the remote OAI server, but will reject resource URIs with a totally + * different hostname to avoid downloading malicious resources from a compromised endpoint. + * Even if the URL prefix validation is disabled, schemes will still be enforced to http(s) so file:/// and + * other unwanted schemes cannot be used + * @param entryUrl the entryId of the parent ORE resource + * @param resourceUrl the resource URL of the aggregated ORE resource + * @return result of the validation + */ + private boolean validResourceUri(String entryUrl, String resourceUrl) { + try { + Set allowedSchemes = Set.of("http", "https"); + URI entryUri = new URI(entryUrl).normalize(); + URI resourceUri = new URI(resourceUrl).normalize(); + String scheme = resourceUri.getScheme(); + + if (scheme == null || + !allowedSchemes.contains(scheme.toLowerCase(Locale.ROOT))) { + log.warn("Illegal scheme requested for ORE resource: {}", resourceUri); + return false; + } + + if (configurationService.getBooleanProperty("oai.harvester.ore.file.validateUrlPrefix", false)) { + for (String allowedPrefix : configurationService + .getArrayProperty("oai.harvester.ore.file.allowedUrlPrefix")) { + URI allowedUri = new URI(allowedPrefix).normalize(); + // Return true on the first allowed prefix match + if (Objects.equals(resourceUri.getScheme(), allowedUri.getScheme()) + && Objects.equals(resourceUri.getHost().toLowerCase(Locale.ROOT), + allowedUri.getHost().toLowerCase(Locale.ROOT))) { + return true; + } + } + + // If no allowed prefixes were matched, we require scheme + host to match the remote OAI server + if (!Objects.equals(entryUri.getScheme(), resourceUri.getScheme())) { + log.warn("Illegal scheme requested for ORE resource: {}", resourceUri); + return false; + } + if (!Objects.equals( + entryUri.getHost().toLowerCase(Locale.ROOT), + resourceUri.getHost().toLowerCase(Locale.ROOT))) { + log.warn("Illegal host requested for ORE resource: {}", resourceUri); + return false; + } + } + + return true; + + } catch (URISyntaxException e) { + log.warn("Could not validate ORE resource URI: {}", resourceUrl); + return false; + } + } + } diff --git a/dspace/config/modules/oai.cfg b/dspace/config/modules/oai.cfg index 98b10f59dee9..b1ec11447f37 100644 --- a/dspace/config/modules/oai.cfg +++ b/dspace/config/modules/oai.cfg @@ -132,3 +132,10 @@ oai.harvester.unknownSchema = fail # when attempting to find the handle of harvested items. If there is a match with # this config parameter, a new handle will be minted instead. Default value: 123456789. #oai.harvester.rejectedHandlePrefix = 123456789, myTestHandle + +# If ingesting files with ORE, only files with URLs that match the base URL of the remote +# OAI endpoint's domain name are accepted, or a list of other URL prefixes defined below +#oai.harvester.ore.file.validateUrlPrefix = true +# Prefixes that are allowed globally (for any endpoint) are below +#oai.harvester.ore.file.allowedUrlPrefix = dspace.myinstitution.edu +#oai.harvester.ore.file.allowedUrlPrefix = files.myinstitution.edu From 5b31db512f62bb530b71cb8fe85b1300f35e5601 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 5 May 2026 16:24:29 +0200 Subject: [PATCH 145/283] Velocity and template safety for Email and LDN messages * Safer Velocity configuration * New "message.templates.allowed-config" config * Remove "UnmodifiableConfiguration" in favour of a simple Map of whitelisted Config keys/values * Centralise Velocity config in core Utils * Small javadoc changes (cherry picked from commit b2d6141389f5652970b366325ed9deff21a86836) --- .../src/main/java/org/dspace/core/Email.java | 83 ++++++------------- .../src/main/java/org/dspace/core/Utils.java | 64 ++++++++++++++ dspace/config/dspace.cfg | 12 +++ 3 files changed, 100 insertions(+), 59 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/core/Email.java b/dspace-api/src/main/java/org/dspace/core/Email.java index c157d16d4967..22bb3dc39630 100644 --- a/dspace-api/src/main/java/org/dspace/core/Email.java +++ b/dspace-api/src/main/java/org/dspace/core/Email.java @@ -22,7 +22,6 @@ import java.util.Date; import java.util.Enumeration; import java.util.List; -import java.util.Properties; import javax.activation.DataHandler; import javax.activation.DataSource; import javax.activation.FileDataSource; @@ -44,12 +43,10 @@ import org.apache.logging.log4j.Logger; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.Velocity; import org.apache.velocity.app.VelocityEngine; import org.apache.velocity.exception.MethodInvocationException; import org.apache.velocity.exception.ParseErrorException; import org.apache.velocity.exception.ResourceNotFoundException; -import org.apache.velocity.runtime.resource.loader.StringResourceLoader; import org.apache.velocity.runtime.resource.util.StringResourceRepository; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; @@ -72,7 +69,7 @@ * Apache Velocity. They may contain VTL directives and property * placeholders. *

    - * {@link addArgument(string)} adds a property to the {@code params} array + * {@link #addArgument(Object)} adds a property to the {@code params} array * in the Velocity context, which can be used to replace placeholder tokens * in the message. These arguments are indexed by number in the order they were * added to the message. @@ -80,9 +77,9 @@ * The DSpace configuration properties are also available to templates as the * array {@code config}, indexed by name. Example: {@code ${config.get('dspace.name')}} *

    - * Recipients and attachments may be added as needed. See {@link addRecipient}, - * {@link addAttachment(File, String)}, and - * {@link addAttachment(InputStream, String, String)}. + * Recipients and attachments may be added as needed. See {@link #addRecipient}, + * {@link #addAttachment(File, String)}, and + * {@link #addAttachment(InputStream, String, String)}. *

    * Headers such as Subject may be supplied by the template, by defining them * using the VTL directive {@code #set()}. Only headers named in the DSpace @@ -125,8 +122,8 @@ * *

    * There are two ways to load a message body. One can create an instance of - * {@link Email} and call {@link setContent} on it, passing the body as a String. Or - * one can use the static factory method {@link getEmail} to load a file by its + * {@link Email} and call {@link #setContent} on it, passing the body as a String. Or + * one can use the static factory method {@link #getEmail} to load a file by its * complete filesystem path. In either case the text will be loaded into a * Velocity template. * @@ -172,18 +169,6 @@ public class Email { /** Velocity template settings. */ private static final String RESOURCE_REPOSITORY_NAME = "Email"; - private static final Properties VELOCITY_PROPERTIES = new Properties(); - static { - VELOCITY_PROPERTIES.put(Velocity.RESOURCE_LOADERS, "string"); - VELOCITY_PROPERTIES.put("resource.loader.string.description", - "Velocity StringResource loader"); - VELOCITY_PROPERTIES.put("resource.loader.string.class", - StringResourceLoader.class.getName()); - VELOCITY_PROPERTIES.put("resource.loader.string.repository.name", - RESOURCE_REPOSITORY_NAME); - VELOCITY_PROPERTIES.put("resource.loader.string.repository.static", - "false"); - } /** Velocity template for a message body */ private Template template; @@ -202,6 +187,13 @@ public Email() { charset = null; } + /** + * Get configuration service + */ + private static ConfigurationService getConfigurationService() { + return DSpaceServicesFactory.getInstance().getConfigurationService(); + } + /** * Add a recipient. * @@ -224,7 +216,7 @@ public void setContent(String name, String content) { arguments.clear(); VelocityEngine templateEngine = new VelocityEngine(); - templateEngine.init(VELOCITY_PROPERTIES); + templateEngine.init(Utils.getSecureVelocityProperties(RESOURCE_REPOSITORY_NAME)); StringResourceRepository repo = (StringResourceRepository) templateEngine.getApplicationAttribute(RESOURCE_REPOSITORY_NAME); @@ -254,7 +246,8 @@ public void setReplyTo(String email) { /** * Fill out the next argument in the template. * - * @param arg the value for the next argument + * @param arg the value for the next argument. If {@code null}, + * a zero-length string is substituted. */ public void addArgument(Object arg) { arguments.add(arg); @@ -332,7 +325,7 @@ public void reset() { * {@code mail.message.headers} then that name and its value will be added * to the message's headers. * - *

    "subject" is treated specially: if {@link setSubject()} has not been + *

    "subject" is treated specially: if {@link #setSubject} has not been * called, the value of any "subject" property will be used as if setSubject * had been called with that value. Thus a template may define its subject, * but the caller may override it. @@ -346,16 +339,13 @@ public void send() throws MessagingException, IOException { throw new MessagingException("Email has no body"); } - ConfigurationService config - = DSpaceServicesFactory.getInstance().getConfigurationService(); - // Get the mail configuration properties - String from = config.getProperty("mail.from.address"); - boolean disabled = config.getBooleanProperty("mail.server.disabled", false); + String from = getConfigurationService().getProperty("mail.from.address"); + boolean disabled = getConfigurationService().getBooleanProperty("mail.server.disabled", false); // If no character set specified, attempt to retrieve a default if (charset == null) { - charset = config.getProperty("mail.charset"); + charset = getConfigurationService().getProperty("mail.charset"); } // Get session @@ -370,11 +360,13 @@ public void send() throws MessagingException, IOException { new InternetAddress(recipient)); } // Get headers defined by the template. - String[] templateHeaders = config.getArrayProperty("mail.message.headers"); + String[] templateHeaders = getConfigurationService().getArrayProperty("mail.message.headers"); // Format the mail message body VelocityContext vctx = new VelocityContext(); - vctx.put("config", new UnmodifiableConfigurationService(config)); + // Pass a restricted (via configuration) list of resolved Configuration keys and values, for + // template lookup + vctx.put("config", Utils.getAllowedTemplateConfig()); vctx.put("params", Collections.unmodifiableList(arguments)); StringWriter writer = new StringWriter(); @@ -661,31 +653,4 @@ public OutputStream getOutputStream() throws IOException { throw new IOException("Cannot write to this read-only resource"); } } - - /** - * Wrap ConfigurationService to prevent templates from modifying - * the configuration. - */ - public static class UnmodifiableConfigurationService { - private final ConfigurationService configurationService; - - /** - * Swallow an instance of ConfigurationService. - * - * @param cs the real instance, to be wrapped. - */ - public UnmodifiableConfigurationService(ConfigurationService cs) { - configurationService = cs; - } - - /** - * Look up a key in the actual ConfigurationService. - * - * @param key to be looked up in the DSpace configuration. - * @return whatever value ConfigurationService associates with {@code key}. - */ - public String get(String key) { - return configurationService.getProperty(key); - } - } } diff --git a/dspace-api/src/main/java/org/dspace/core/Utils.java b/dspace-api/src/main/java/org/dspace/core/Utils.java index a1294c3317ce..fcec140869cf 100644 --- a/dspace-api/src/main/java/org/dspace/core/Utils.java +++ b/dspace-api/src/main/java/org/dspace/core/Utils.java @@ -29,16 +29,22 @@ import java.util.Collections; import java.util.Date; import java.util.GregorianCalendar; +import java.util.List; +import java.util.Map; +import java.util.Properties; import java.util.Random; import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import com.coverity.security.Escape; import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.StringSubstitutor; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.velocity.app.Velocity; +import org.apache.velocity.runtime.resource.loader.StringResourceLoader; import org.dspace.services.ConfigurationService; import org.dspace.services.factory.DSpaceServicesFactory; @@ -101,6 +107,14 @@ public final class Utils { private static final Calendar outCal = GregorianCalendar.getInstance(); + // Allowed configuration properties to pass to Velocity templates (Email, LDN) + private static final String[] DEFAULT_ALLOWED_TEMPLATE_CONFIGS = { + "dspace.name", "dspace.shortname", "dspace.ui.url", + "mail.helpdesk", "mail.message.helpdesk.telephone", "mail.admin", "mail.admin.name"}; + + private static final ConfigurationService configurationService = + DSpaceServicesFactory.getInstance().getConfigurationService(); + /** * Private constructor */ @@ -507,4 +521,54 @@ public static String interpolateConfigsInString(String string) { return StringSubstitutor.replace(string, config.getProperties()); } + /** + * Get a list of allowed DSpace configuration property keys that will be exposed to Velocity templates + * (used in Email and LDN messages) as a simple Map of strings. + * @return Map of strings representing resolved configuration properties + */ + public static Map getAllowedTemplateConfig() { + // Pass a restricted (via configuration) list of resolved Configuration keys and values, for + // template lookup + List allowedConfigurationKeys = List.of(configurationService.getArrayProperty( + "message.templates.allowed-config", DEFAULT_ALLOWED_TEMPLATE_CONFIGS)); + return allowedConfigurationKeys.stream() + .map(key -> Map.entry(key, configurationService.getProperty(key))) + .filter(entry -> entry.getValue() != null) + .collect(Collectors.toMap( + Map.Entry::getKey, + Map.Entry::getValue + )); + } + + /** + * Create and return a set of default, secure Velocity configuration properties. + * @see {@link Email} + * + * @param resourceRepositoryName the templating context e.g. "LDN", "Email" + * @returns secure Velocity configuration for use with templating + */ + public static Properties getSecureVelocityProperties(String resourceRepositoryName) { + Properties secureVelocityProperties = new Properties(); + // Basic Velocity configuration + secureVelocityProperties.setProperty(Velocity.RESOURCE_LOADERS, "string"); + secureVelocityProperties.setProperty("resource.loader.string.description", + "Velocity StringResource loader"); + secureVelocityProperties.setProperty("resource.loader.string.class", + StringResourceLoader.class.getName()); + secureVelocityProperties.setProperty("resource.loader.string.repository.name", + resourceRepositoryName); + secureVelocityProperties.setProperty("resource.loader.string.repository.static", + "false"); + // Set secure default introspection and class restriction handling in Velocity + secureVelocityProperties.setProperty("introspector.uberspect.class", + "org.apache.velocity.util.introspection.SecureUberspector"); + secureVelocityProperties.setProperty("introspector.restrict.classes", + "java.lang.Class,java.lang.Runtime,java.lang.System"); + secureVelocityProperties.setProperty( "introspector.restrict.packages", + "java.lang.reflect,java.io,java.nio"); + secureVelocityProperties.setProperty("runtime.strict_mode.enable", "true"); + + return secureVelocityProperties; + } + } diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index 7e45645983b8..d0523f57708f 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -162,6 +162,7 @@ mail.from.address = dspace-noreply@myu.edu # will use the above settings to create a Session. #mail.session.name = Session + # When feedback is submitted via the Feedback form, it is sent to this address # Currently limited to one recipient! # if this property is empty or commented out, feedback form is disabled @@ -228,6 +229,17 @@ mail.message.headers = charset # Helpdesk telephone. Not email, but should be with other contact info. Optional. #mail.message.helpdesk.telephone = +1 555 555 5555 +# Allowed configuration properties, to pass in a "config" map to email and LDN templates. +# This allows templates to easily access dynamic configuration properties, without +# exposing sensitive information to the templating engine +message.templates.allowed-config = dspace.name +message.templates.allowed-config = dspace.shortname +message.templates.allowed-config = dspace.ui.url +message.templates.allowed-config = mail.helpdesk +message.templates.allowed-config = mail.message.helpdesk.telephone +message.templates.allowed-config = mail.admin +message.templates.allowed-config = mail.admin.name + ##### Asset Storage (bitstreams / files) ###### # Moved to config/spring/api/bitstore.xml From 46a0dfb38197dfd9fa9970aa293e3a11a67c12b0 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Sat, 16 May 2026 15:55:24 +0200 Subject: [PATCH 146/283] Better null checking in allowed config props (cherry picked from commit 6b665313cb48131ada04ae0840ff531b08b31dad) --- dspace-api/src/main/java/org/dspace/core/Utils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/core/Utils.java b/dspace-api/src/main/java/org/dspace/core/Utils.java index fcec140869cf..355e3f01cc5a 100644 --- a/dspace-api/src/main/java/org/dspace/core/Utils.java +++ b/dspace-api/src/main/java/org/dspace/core/Utils.java @@ -31,6 +31,7 @@ import java.util.GregorianCalendar; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Properties; import java.util.Random; import java.util.StringTokenizer; @@ -532,8 +533,11 @@ public static Map getAllowedTemplateConfig() { List allowedConfigurationKeys = List.of(configurationService.getArrayProperty( "message.templates.allowed-config", DEFAULT_ALLOWED_TEMPLATE_CONFIGS)); return allowedConfigurationKeys.stream() - .map(key -> Map.entry(key, configurationService.getProperty(key))) - .filter(entry -> entry.getValue() != null) + .map(key -> { + String value = configurationService.getProperty(key); + return value != null ? Map.entry(key, value) : null; + }) + .filter(Objects::nonNull) .collect(Collectors.toMap( Map.Entry::getKey, Map.Entry::getValue From 4be430f4f0d404b88ad87454af8aeafefae9c042 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 09:57:21 +0200 Subject: [PATCH 147/283] Access configurationService at runtime, not rely on class setup (cherry picked from commit 5803819ba65e7211a4f49318d0d3bbf2246e21c1) --- dspace-api/src/main/java/org/dspace/core/Utils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/core/Utils.java b/dspace-api/src/main/java/org/dspace/core/Utils.java index 355e3f01cc5a..90ce66344379 100644 --- a/dspace-api/src/main/java/org/dspace/core/Utils.java +++ b/dspace-api/src/main/java/org/dspace/core/Utils.java @@ -113,9 +113,6 @@ public final class Utils { "dspace.name", "dspace.shortname", "dspace.ui.url", "mail.helpdesk", "mail.message.helpdesk.telephone", "mail.admin", "mail.admin.name"}; - private static final ConfigurationService configurationService = - DSpaceServicesFactory.getInstance().getConfigurationService(); - /** * Private constructor */ @@ -530,6 +527,8 @@ public static String interpolateConfigsInString(String string) { public static Map getAllowedTemplateConfig() { // Pass a restricted (via configuration) list of resolved Configuration keys and values, for // template lookup + ConfigurationService configurationService = + DSpaceServicesFactory.getInstance().getConfigurationService(); List allowedConfigurationKeys = List.of(configurationService.getArrayProperty( "message.templates.allowed-config", DEFAULT_ALLOWED_TEMPLATE_CONFIGS)); return allowedConfigurationKeys.stream() From 655fc62874e9e4e5cf95ef2ff1e05b908484fc9f Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 15:39:41 +0200 Subject: [PATCH 148/283] Remove strict mode Velocity engine configuration (allow nulls) --- dspace-api/src/main/java/org/dspace/core/Utils.java | 6 +++++- dspace/config/dspace.cfg | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/core/Utils.java b/dspace-api/src/main/java/org/dspace/core/Utils.java index 90ce66344379..8f8011acef5e 100644 --- a/dspace-api/src/main/java/org/dspace/core/Utils.java +++ b/dspace-api/src/main/java/org/dspace/core/Utils.java @@ -569,7 +569,11 @@ public static Properties getSecureVelocityProperties(String resourceRepositoryNa "java.lang.Class,java.lang.Runtime,java.lang.System"); secureVelocityProperties.setProperty( "introspector.restrict.packages", "java.lang.reflect,java.io,java.nio"); - secureVelocityProperties.setProperty("runtime.strict_mode.enable", "true"); + // Set strict mode if configured (default: false, as we've always treated null values as blanks) + if (DSpaceServicesFactory.getInstance().getConfigurationService() + .getBooleanProperty("message.templates.strict_mode", false)) { + secureVelocityProperties.setProperty("runtime.strict_mode.enable", "true"); + } return secureVelocityProperties; } diff --git a/dspace/config/dspace.cfg b/dspace/config/dspace.cfg index d0523f57708f..fa85cc669d66 100644 --- a/dspace/config/dspace.cfg +++ b/dspace/config/dspace.cfg @@ -240,6 +240,11 @@ message.templates.allowed-config = mail.message.helpdesk.telephone message.templates.allowed-config = mail.admin message.templates.allowed-config = mail.admin.name +# Whether to run Velocity in strict mode (null parameter values in templates for LDN or Email will result +# in an Exception instead of a blank string) +# Default: false (this can introduce unwanted side-effects if e.g. a submitter eperson is deleted for a workflow task) +#message.templates.strict_mode = false + ##### Asset Storage (bitstreams / files) ###### # Moved to config/spring/api/bitstore.xml From dc3e4553641bdd91bac344d0402ad796b80a75f9 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Sat, 16 May 2026 20:54:09 +0200 Subject: [PATCH 149/283] Filter requests for JSPs or traversal (cherry picked from commit cf9be8554d3597e2c80958cd62336b40b79ba19d) --- .../security/GlobalRequestSecurityFilter.java | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java new file mode 100644 index 000000000000..53d6f7065333 --- /dev/null +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java @@ -0,0 +1,134 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.app.rest.security; + +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.filter.OncePerRequestFilter; + +import java.io.IOException; +import java.net.URI; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.Locale; + +/** + * Global filter acting on all requests (not just /api/) to provide some additional hardening + * against common attacks or RCE, if a malicious payload was somehow written to a directory + * executable by the servlet container. + * The decoding and normalisation is designed to be tolerant of malformed URLs or broken clients, etc. + * so that this additional security filter does not introduce false positives or unintended side effects. + * + * @author Kim Shepherd + */ +@Component +@Order(Ordered.HIGHEST_PRECEDENCE) +public class GlobalRequestSecurityFilter extends OncePerRequestFilter { + + @Override + protected void doFilterInternal( + HttpServletRequest request, + HttpServletResponse response, + FilterChain filterChain + ) throws ServletException, IOException { + String normalizedPath = normaliseUrl(request.getRequestURI()); + // Return 403 forbidden if JSP execution or URL traversal is attempted + if (isTraversalAttempt(normalizedPath) || isJspExecutionAttempt(normalizedPath)) { + response.sendError(HttpServletResponse.SC_FORBIDDEN); + return; + } + filterChain.doFilter(request, response); + } + + /** + * Normalise the URI similarly to Tomcat, for testing how it will be interpreted + * @param rawUrl the unvalidated URL string + * @return a decoded, normalise URL + */ + private String normaliseUrl(String rawUrl) throws IOException { + if (rawUrl == null || rawUrl.isBlank()) { + throw new IOException("Empty URL"); + } + String url = rawUrl.split("\\?")[0]; + // Strip ;jspsession=... and so on + int semicolon = url.indexOf(';'); + if (semicolon >= 0) { + url = url.substring(0, semicolon); + } + url = decodeUrl(url); + if (url == null || url.isBlank()) { + throw new IOException("Decoded URL path is empty"); + } + url = normaliseUrlPath(url); + if (url == null || url.isBlank()) { + throw new IOException("Normalised URL path is empty"); + } + return url.toLowerCase(Locale.ROOT); + } + + /** + * Decode URL, falling back to original URL if it's malformed or undecodable + * @param url the encoded / unvalidated URL + * @return decoded URL or the original URL on error + */ + private String decodeUrl(String url) { + try { + return URLDecoder.decode(url, StandardCharsets.UTF_8); + } catch (IllegalArgumentException ex) { + // if we can't decode it, just return raw string + return url; + } + } + + /** + * Normalise the URL path and ensure it ends in a / + * @param url the URL path to normalise + * @return normalised path or the original parameter on error + */ + private String normaliseUrlPath(String url) { + try { + if (!url.startsWith("/")) { + url = "/" + url; + } + return new URI(url).normalize().getPath(); + } catch (Exception e) { + // if we can't use or normalise the path, just return the raw string + return url; + } + } + + /** + * Detect traversal after normalisation + * @param url the URL path to validate + * @return true if this looks like a traversal attempt + */ + private boolean isTraversalAttempt(String url) { + return url.contains("../") + || url.contains("/..") + || url.contains("%2e%2e") + || url.contains(".."); + } + + /** + * Block JSP execution attempts + * @param url the URL path to validate + */ + private boolean isJspExecutionAttempt(String url) { + return url.endsWith(".jsp") + || url.endsWith(".jspx") + || url.contains(".jsp/") + || url.contains(".jspx/") + || url.contains(".jsp\0") + || url.contains(".jspx\0"); + } +} \ No newline at end of file From 0b1deae3fe94f55fb3dcda8dd6d6ba436b417f38 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Sat, 16 May 2026 22:18:27 +0200 Subject: [PATCH 150/283] Add additional logging to GlobalRequestSecurityFilter (cherry picked from commit 295a046fba14502619b3e3d96a7f6abdc9a4a5fc) --- .../app/rest/security/GlobalRequestSecurityFilter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java index 53d6f7065333..13740a53c7a4 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java @@ -43,7 +43,13 @@ protected void doFilterInternal( ) throws ServletException, IOException { String normalizedPath = normaliseUrl(request.getRequestURI()); // Return 403 forbidden if JSP execution or URL traversal is attempted - if (isTraversalAttempt(normalizedPath) || isJspExecutionAttempt(normalizedPath)) { + if (isTraversalAttempt(normalizedPath)) { + logger.warn("Path traversal attempt detected. Skipping request: " + request.getRequestURI()); + response.sendError(HttpServletResponse.SC_FORBIDDEN); + return; + } + if (isJspExecutionAttempt(normalizedPath)) { + logger.warn("JSP execution attempt detected. Skipping request: " + request.getRequestURI()); response.sendError(HttpServletResponse.SC_FORBIDDEN); return; } From 2e400771353f2a6e50bfb0067e2c58ca602e04c9 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 11:00:17 +0200 Subject: [PATCH 151/283] Fix import order (cherry picked from commit e2e6a796fd8d19de18a80b735e20a62d29c3c5cd) --- .../rest/security/GlobalRequestSecurityFilter.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java index 13740a53c7a4..78e433a8fad9 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java @@ -7,6 +7,12 @@ */ package org.dspace.app.rest.security; +import java.io.IOException; +import java.net.URI; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; +import java.util.Locale; + import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; @@ -16,12 +22,6 @@ import org.springframework.stereotype.Component; import org.springframework.web.filter.OncePerRequestFilter; -import java.io.IOException; -import java.net.URI; -import java.net.URLDecoder; -import java.nio.charset.StandardCharsets; -import java.util.Locale; - /** * Global filter acting on all requests (not just /api/) to provide some additional hardening * against common attacks or RCE, if a malicious payload was somehow written to a directory @@ -137,4 +137,4 @@ private boolean isJspExecutionAttempt(String url) { || url.contains(".jsp\0") || url.contains(".jspx\0"); } -} \ No newline at end of file +} From 1a3dfd7c1a341ce9c04ee1aef0bea9f45c24dcbc Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 13:38:55 +0200 Subject: [PATCH 152/283] Update sitemap traversal test expectations (cherry picked from commit 56ae2871eaba764900e4d9e23685a9472f485069) --- .../org/dspace/app/rest/SitemapRestControllerIT.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SitemapRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SitemapRestControllerIT.java index 04d22718e846..084b8272bd09 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/SitemapRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/SitemapRestControllerIT.java @@ -14,8 +14,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import javax.servlet.ServletException; - import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.authorize.service.ResourcePolicyService; import org.dspace.builder.CollectionBuilder; @@ -131,18 +129,20 @@ public void testSitemap_notValidSiteMapFile() throws Exception { .andExpect(status().isNotFound()); } - @Test(expected = ServletException.class) + @Test public void testSitemap_fileSystemTraversal_dspaceCfg() throws Exception { //** WHEN ** //We attempt to use endpoint for malicious file system traversal - getClient().perform(get("/" + SITEMAPS_ENDPOINT + "/%2e%2e/config/dspace.cfg")); + getClient().perform(get("/" + SITEMAPS_ENDPOINT + "/%2e%2e/config/dspace.cfg")) + .andExpect(status().isForbidden()); } - @Test(expected = ServletException.class) + @Test public void testSitemap_fileSystemTraversal_dspaceCfg2() throws Exception { //** WHEN ** //We attempt to use endpoint for malicious file system traversal - getClient().perform(get("/" + SITEMAPS_ENDPOINT + "/%2e%2e%2fconfig%2fdspace.cfg")); + getClient().perform(get("/" + SITEMAPS_ENDPOINT + "/%2e%2e%2fconfig%2fdspace.cfg")) + .andExpect(status().isForbidden()); } @Test From 8a2eee9d4adcbb4d858252877df8b020426e0802 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 16:30:28 +0200 Subject: [PATCH 153/283] Backport GlobalRequestSecurityFilter for javax --- .../app/rest/security/GlobalRequestSecurityFilter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java index 78e433a8fad9..983da703878b 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java @@ -13,10 +13,10 @@ import java.nio.charset.StandardCharsets; import java.util.Locale; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; +import javax.servlet.FilterChain; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; From 22bec4459def712f529ff41283a8c7c5bcd1889c Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 13:45:20 +0200 Subject: [PATCH 154/283] Add secure file access methods --- .../storage/secure/SecureFileAccess.java | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 dspace-api/src/main/java/org/dspace/storage/secure/SecureFileAccess.java diff --git a/dspace-api/src/main/java/org/dspace/storage/secure/SecureFileAccess.java b/dspace-api/src/main/java/org/dspace/storage/secure/SecureFileAccess.java new file mode 100644 index 000000000000..45727d9ee5ae --- /dev/null +++ b/dspace-api/src/main/java/org/dspace/storage/secure/SecureFileAccess.java @@ -0,0 +1,166 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.storage.secure; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +/** + * Decent I/O path validation - not perfect when symlinks are used and we are writing + * as 'toRealPath' check on the resolved path fails for new files + * + * @author Kim Shepherd + */ +public final class SecureFileAccess { + + private SecureFileAccess() {} + + /** + * Validate a given path against an allowed base path. Does not attempt to calculate "real path" + * before validation, as this breaks for new files which don't yet exist. This can make the resulting + * validation still vulnerable to symlink traversal in some cases + * @param file the unvalidated file, usually derived from user input or configuration + * This MUST be an absolute path, and the caller is expected to calculate it based on best + * context (e.g. configured base path, CWD, dspace.dir, and so on) + * @param allowedBasePaths list of allowed base paths for this use case as per system configuration + * @param purpose the name of the calling component / use case for logging and inspection + * @throws IOException on validation failure + */ + public static Path validatePathForWrite(String file, List allowedBasePaths, String purpose) + throws IOException { + Path filePath = Path.of(file); + if (!filePath.isAbsolute()) { + throw new IOException("Absolute path required for I/O (" + purpose + "): " + file); + } + for (String allowedBasePath : allowedBasePaths) { + Path basePath = Path.of(allowedBasePath) + .toRealPath() + .normalize(); + Path resolvedPath = basePath.resolve(file).normalize(); + if (resolvedPath.startsWith(basePath)) { + return resolvedPath; + } + } + + // If no valid path was resolved and returned by now + // we raise an exception and treat this as illegal access + throw new IOException("Illegal file path attempted for I/O (" + purpose + "): " + file); + } + + /** + * Validate a given path against an allowed base path. + * More secure than the 'write' variant because we can explicitly resolve links as well. + * + * @param file the unvalidated file, usually derived from user input or configuration + * This MUST be an absolute path, and the caller is expected to calculate it based on best + * context (e.g. configured base path, CWD, dspace.dir, and so on) + * @param allowedBasePaths the allowed base paths for this use case as per system configuration + * @param purpose the name of the calling component / use case for logging and inspection + * @throws IOException on validation failure + */ + public static Path validatePathForRead(String file, List allowedBasePaths, String purpose) + throws IOException { + Path filePath = Path.of(file); + if (!filePath.isAbsolute()) { + throw new IOException("Absolute path required for I/O (" + purpose + "): " + file); + } + for (String allowedBasePath : allowedBasePaths) { + Path basePath = Path.of(allowedBasePath) + .toRealPath() + .normalize(); + Path resolvedPath = basePath.resolve(file).toRealPath().normalize(); + if (resolvedPath.startsWith(basePath)) { + return resolvedPath; + } + } + // If no valid path was resolved and returned by now + // we raise an exception and treat this as illegal access + throw new IOException("Illegal file path attempted for I/O (" + purpose + "): " + file); + } + + /** + * Get a buffered reader after validating file path. + * @param unvalidatedFile the unvalidated file, usually derived from user input or configuration + * @param allowedBasePaths the allowed base paths for this use case as per system configuration + * @param purpose the name of the calling component / use case for logging and inspection + * @throws IOException on validation failure + */ + public static BufferedReader getBufferedReader(String unvalidatedFile, List allowedBasePaths, + String purpose, Charset charset) throws IOException { + if (charset == null) { + charset = StandardCharsets.UTF_8; + } + Path validatedFile = validatePathForRead(unvalidatedFile, allowedBasePaths, purpose); + return Files.newBufferedReader(validatedFile, charset); + } + + /** + * Get an input stream after validating file path. + * @param unvalidatedFile the unvalidated file, usually derived from user input or configuration + * @param allowedBasePaths the allowed base paths for this use case as per system configuration + * @param purpose the name of the calling component / use case for logging and inspection + * @throws IOException on validation failure + */ + public static InputStream getInputStream(String unvalidatedFile, List allowedBasePaths, String purpose) + throws IOException { + Path validatedFile = validatePathForRead(unvalidatedFile, allowedBasePaths, purpose); + return Files.newInputStream(validatedFile); + + } + + /** + * Get an output stream after validating file path. New files can't use toRealPath() for link calculation so + * there is a bit of a trade-off in allowing some symlink traversal to occur + * @param unvalidatedFile the unvalidated file, usually derived from user input or configuration + * @param allowedBasePaths the allowed base paths for this use case as per system configuration + * @param purpose the name of the calling component / use case for logging and inspection + * @throws IOException on validation failure + */ + public static OutputStream getOutputStream(String unvalidatedFile, List allowedBasePaths, String purpose) + throws IOException { + Path validatedFile = validatePathForWrite(unvalidatedFile, allowedBasePaths, purpose); + return Files.newOutputStream(validatedFile); + } + + /** + * Calculate an absolute path (if not already absolute) using current working dir as a root + * for relative file paths + * @param file the relative or absolute file given as input + * @return absolute path calculated from file and cwd + */ + public static String calculateAbsolutePathUsingCwd(String file) { + String filePath = file; + Path path = Path.of(filePath); + if (!path.isAbsolute()) { + filePath = Path.of("").toAbsolutePath().resolve(path).normalize().toString(); + } + return filePath; + } + + /** + * Calculate an absolute path (if not already absolute) using a given base dir as a root + * for relative file paths + * @param file the relative or absolute file given as input + * @return absolute path calculated from file and base dir + */ + public static String calculateAbsolutePathUsingBaseDir(String file, String baseDir) { + String filePath = file; + Path path = Path.of(filePath); + if (!path.isAbsolute()) { + filePath = Path.of(baseDir).toAbsolutePath().resolve(path).normalize().toString(); + } + return filePath; + } +} From 55905a2fc46b98194f92ec38e0fb8bafa7fee21a Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 13:49:50 +0200 Subject: [PATCH 155/283] Backport Curation I/O using secure file access Removes some JDK >= 16 usage --- .../main/java/org/dspace/curate/Curation.java | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/curate/Curation.java b/dspace-api/src/main/java/org/dspace/curate/Curation.java index b894dcd85f03..43decd4add72 100644 --- a/dspace-api/src/main/java/org/dspace/curate/Curation.java +++ b/dspace-api/src/main/java/org/dspace/curate/Curation.java @@ -10,15 +10,18 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintStream; import java.io.Writer; +import java.nio.charset.StandardCharsets; import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.UUID; @@ -38,6 +41,7 @@ import org.dspace.handle.service.HandleService; import org.dspace.scripts.DSpaceRunnable; import org.dspace.services.factory.DSpaceServicesFactory; +import org.dspace.storage.secure.SecureFileAccess; import org.dspace.utils.DSpace; /** @@ -112,8 +116,16 @@ private void handleCurationTask(Curator curator) throws IOException, SQLExceptio } else if (commandLine.hasOption('T')) { // load taskFile BufferedReader reader = null; + // in this case, Curation CLI expects to calculate the -T parameter from the user's current working dir + String taskFilePath = SecureFileAccess.calculateAbsolutePathUsingCwd(this.taskFile); try { - reader = new BufferedReader(new FileReader(this.taskFile)); + String dspaceDir = DSpaceServicesFactory.getInstance() + .getConfigurationService().getProperty("dspace.dir"); + List allowedTaskFileBasePath = new ArrayList<>( + Arrays.asList(DSpaceServicesFactory.getInstance().getConfigurationService() + .getArrayProperty("curate.taskfile.base", new String[]{dspaceDir}))); + reader = SecureFileAccess.getBufferedReader(taskFilePath, allowedTaskFileBasePath, + "curation-taskfile", StandardCharsets.UTF_8); while ((taskName = reader.readLine()) != null) { if (verbose) { super.handler.logInfo("Adding task: " + taskName); @@ -189,12 +201,25 @@ private void endScript(long timeRun) throws SQLException { private Curator initCurator() throws FileNotFoundException { Curator curator = new Curator(handler); OutputStream reporterStream; + String dspaceDir = DSpaceServicesFactory.getInstance() + .getConfigurationService().getProperty("dspace.dir"); + List allowedReporterBasePaths = new ArrayList<>(Arrays.asList(DSpaceServicesFactory.getInstance() + .getConfigurationService().getArrayProperty("curate.reporter.base", + new String[]{dspaceDir + File.separatorChar + "log"}))); if (null == this.reporter) { reporterStream = NullOutputStream.NULL_OUTPUT_STREAM; } else if ("-".equals(this.reporter)) { reporterStream = System.out; } else { - reporterStream = new PrintStream(this.reporter); + // Reporter param comes from CLI execution. Calculate abs path from user's current working dir + String reporterFilePath = SecureFileAccess.calculateAbsolutePathUsingCwd(this.reporter); + try { + reporterStream = new PrintStream( + SecureFileAccess.getOutputStream( + reporterFilePath, allowedReporterBasePaths, "curation-reporter")); + } catch (IOException e) { + throw new FileNotFoundException(e.getLocalizedMessage()); + } } Writer reportWriter = new OutputStreamWriter(reporterStream); curator.setReporter(reportWriter); From 45022245be2fabb5ba26d50b335f1aa1f905a660 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 13:50:59 +0200 Subject: [PATCH 156/283] Curation config support for allowed base paths --- dspace/config/modules/curate.cfg | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dspace/config/modules/curate.cfg b/dspace/config/modules/curate.cfg index 6e75738de543..dad40d615454 100644 --- a/dspace/config/modules/curate.cfg +++ b/dspace/config/modules/curate.cfg @@ -29,3 +29,15 @@ curate.taskqueue.dir = ${dspace.dir}/ctqueues # Maximum amount of redirects set to 0 for none and -1 for unlimited curate.checklinks.max-redirect = 0 + +# allowed base path(s) of curation task files +# it is recommended to restrict this path as much as possible +# so that the DSpace Processes framework may only load files as "tasks" +# from a trusted location. For multiple paths, repeat this configuration +# property for each trusted path +# Default: ${dspace.dir} +#curate.taskfile.base = ${dspace.dir} + +# allowed base path of reporter output. +# Default: ${dspace.dir}/log +#curate.reporter.base = ${dspace.dir}/log From 277af8233261ec0f61d71a4ce0908341c30e5e89 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 26 May 2026 14:06:14 +0200 Subject: [PATCH 157/283] Move curation -r reporter param to CLI only --- .../java/org/dspace/curate/CurationCliScriptConfiguration.java | 3 +++ .../src/main/java/org/dspace/curate/CurationClientOptions.java | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java b/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java index eaa04f477829..07684f3643d0 100644 --- a/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java +++ b/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java @@ -20,6 +20,9 @@ public Options getOptions() { options = super.getOptions(); options.addOption("e", "eperson", true, "email address of curating eperson"); options.getOption("e").setRequired(true); + options.addOption("r", "reporter", true, + "relative or absolute path to the desired report file. Use '-' to report to console. If absent, no " + + "reporting"); return options; } } diff --git a/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java b/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java index 8ec0f14697c0..a8a3d358ce67 100644 --- a/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java +++ b/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java @@ -59,9 +59,6 @@ protected static Options constructOptions() { "Id (handle) of object to perform task on, or 'all' to perform on whole repository"); options.addOption("p", "parameter", true, "a task parameter 'NAME=VALUE'"); options.addOption("q", "queue", true, "name of task queue to process"); - options.addOption("r", "reporter", true, - "relative or absolute path to the desired report file. Use '-' to report to console. If absent, no " + - "reporting"); options.addOption("s", "scope", true, "transaction scope to impose: use 'object', 'curation', or 'open'. If absent, 'open' applies"); options.addOption("v", "verbose", false, "report activity to stdout"); From a7572212c135155fb8420a2bfc95869f1ba6959d Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 16:57:21 +0200 Subject: [PATCH 158/283] Fix import order --- .../dspace/app/rest/security/GlobalRequestSecurityFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java index 983da703878b..a9f0eea8d728 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/security/GlobalRequestSecurityFilter.java @@ -12,11 +12,11 @@ import java.net.URLDecoder; import java.nio.charset.StandardCharsets; import java.util.Locale; - import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; From 37cd6eb791d4f61bb54fedf899aa96f99504e38d Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 14:38:00 +0200 Subject: [PATCH 159/283] Ignore CurationScriptIT -T taskFile tests, to rewrite w/ CLI (cherry picked from commit 6437472b8277b9aa815dd71e14b499ba7515f87d) --- .../src/test/java/org/dspace/curate/CurationScriptIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/curate/CurationScriptIT.java b/dspace-server-webapp/src/test/java/org/dspace/curate/CurationScriptIT.java index 8745613d7af6..347ed0935f05 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/curate/CurationScriptIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/curate/CurationScriptIT.java @@ -49,6 +49,7 @@ import org.dspace.scripts.configuration.ScriptConfiguration; import org.dspace.scripts.factory.ScriptServiceFactory; import org.dspace.scripts.service.ScriptService; +import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -214,6 +215,7 @@ public void curateScript_InvalidScope() throws Exception { .andExpect(status().isBadRequest()); } + @Ignore @Test public void curateScript_InvalidTaskFile() throws Exception { String token = getAuthToken(admin.getEmail(), password); @@ -286,6 +288,7 @@ public void curateScript_validRequest_Task() throws Exception { } } + @Ignore @Test public void curateScript_validRequest_TaskFile() throws Exception { context.turnOffAuthorisationSystem(); From 27708ea6d70abe433f131cf3b875dfdc067d3c12 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Wed, 27 May 2026 06:43:22 +0200 Subject: [PATCH 160/283] Move taskfile -T option to CLI script config only (cherry picked from commit 00e4979a60fd69adbf4a7476926701ef59207ce7) --- .../org/dspace/curate/CurationCliScriptConfiguration.java | 1 + .../main/java/org/dspace/curate/CurationClientOptions.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java b/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java index 07684f3643d0..925bd4f2d232 100644 --- a/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java +++ b/dspace-api/src/main/java/org/dspace/curate/CurationCliScriptConfiguration.java @@ -23,6 +23,7 @@ public Options getOptions() { options.addOption("r", "reporter", true, "relative or absolute path to the desired report file. Use '-' to report to console. If absent, no " + "reporting"); + options.addOption("T", "taskfile", true, "file containing curation task names"); return options; } } diff --git a/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java b/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java index a8a3d358ce67..03ad2f34b230 100644 --- a/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java +++ b/dspace-api/src/main/java/org/dspace/curate/CurationClientOptions.java @@ -31,7 +31,8 @@ public enum CurationClientOptions { /** * This method resolves the CommandLine parameters to figure out which action the curation script should perform * - * @param commandLine The relevant CommandLine for the curation script + * @param commandLine The relevant CommandLine for the curation script. Note that -T is passed only + * from CurationCliScriptConfig and is not accessible from UI processes * @return The curation option to be ran, parsed from the CommandLine */ protected static CurationClientOptions getClientOption(CommandLine commandLine) { @@ -54,7 +55,6 @@ protected static Options constructOptions() { Options options = new Options(); options.addOption("t", "task", true, "curation task name; options: " + getTaskOptions()); - options.addOption("T", "taskfile", true, "file containing curation task names"); options.addOption("i", "id", true, "Id (handle) of object to perform task on, or 'all' to perform on whole repository"); options.addOption("p", "parameter", true, "a task parameter 'NAME=VALUE'"); From f228458d1d2f3814171f64a3d00741b25b147110 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 13:39:35 -0500 Subject: [PATCH 161/283] Update LICENSES_THIRD_PARTY for next release --- LICENSES_THIRD_PARTY | 289 ++++++++++++++++++++++--------------------- 1 file changed, 147 insertions(+), 142 deletions(-) diff --git a/LICENSES_THIRD_PARTY b/LICENSES_THIRD_PARTY index 174c8760cab0..fdb56efc3604 100644 --- a/LICENSES_THIRD_PARTY +++ b/LICENSES_THIRD_PARTY @@ -25,10 +25,10 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * com.drewnoakes:metadata-extractor (com.drewnoakes:metadata-extractor:2.19.0 - https://drewnoakes.com/code/exif/) * parso (com.epam:parso:2.0.14 - https://github.com/epam/parso) * Internet Time Utility (com.ethlo.time:itu:1.7.0 - https://github.com/ethlo/itu) - * ClassMate (com.fasterxml:classmate:1.7.1 - https://github.com/FasterXML/java-classmate) - * Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.20 - https://github.com/FasterXML/jackson) - * Jackson-core (com.fasterxml.jackson.core:jackson-core:2.20.1 - https://github.com/FasterXML/jackson-core) - * jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.20.1 - https://github.com/FasterXML/jackson) + * ClassMate (com.fasterxml:classmate:1.7.3 - https://github.com/FasterXML/java-classmate) + * Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.21 - https://github.com/FasterXML/jackson) + * Jackson-core (com.fasterxml.jackson.core:jackson-core:2.21.2 - https://github.com/FasterXML/jackson-core) + * jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.21.2 - https://github.com/FasterXML/jackson) * Jackson dataformat: Smile (com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.15.2 - https://github.com/FasterXML/jackson-dataformats-binary) * Jackson-dataformat-YAML (com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0 - https://github.com/FasterXML/jackson-dataformats-text) * Jackson datatype: jdk8 (com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jdk8) @@ -40,9 +40,9 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * zjsonpatch (com.flipkart.zjsonpatch:zjsonpatch:0.4.16 - https://github.com/flipkart-incubator/zjsonpatch/) * Caffeine cache (com.github.ben-manes.caffeine:caffeine:2.9.3 - https://github.com/ben-manes/caffeine) * JSON.simple (com.github.cliftonlabs:json-simple:3.0.2 - https://cliftonlabs.github.io/json-simple/) - * docker-java-api (com.github.docker-java:docker-java-api:3.7.0 - https://github.com/docker-java/docker-java) - * docker-java-transport (com.github.docker-java:docker-java-transport:3.7.0 - https://github.com/docker-java/docker-java) - * docker-java-transport-zerodep (com.github.docker-java:docker-java-transport-zerodep:3.7.0 - https://github.com/docker-java/docker-java) + * docker-java-api (com.github.docker-java:docker-java-api:3.7.1 - https://github.com/docker-java/docker-java) + * docker-java-transport (com.github.docker-java:docker-java-transport:3.7.1 - https://github.com/docker-java/docker-java) + * docker-java-transport-zerodep (com.github.docker-java:docker-java-transport-zerodep:3.7.1 - https://github.com/docker-java/docker-java) * btf (com.github.java-json-tools:btf:1.3 - https://github.com/java-json-tools/btf) * jackson-coreutils (com.github.java-json-tools:jackson-coreutils:2.0 - https://github.com/java-json-tools/jackson-coreutils) * jackson-coreutils-equivalence (com.github.java-json-tools:jackson-coreutils-equivalence:1.0 - https://github.com/java-json-tools/jackson-coreutils) @@ -56,16 +56,17 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Google Analytics API v3-rev145-1.23.0 (com.google.apis:google-api-services-analytics:v3-rev145-1.23.0 - http://nexus.sonatype.org/oss-repository-hosting.html/google-api-services-analytics) * FindBugs-jsr305 (com.google.code.findbugs:jsr305:3.0.2 - http://findbugs.sourceforge.net/) * Gson (com.google.code.gson:gson:2.11.0 - https://github.com/google/gson) - * error-prone annotations (com.google.errorprone:error_prone_annotations:2.21.1 - https://errorprone.info/error_prone_annotations) + * error-prone annotations (com.google.errorprone:error_prone_annotations:2.47.0 - https://errorprone.info/error_prone_annotations) * Guava InternalFutureFailureAccess and InternalFutures (com.google.guava:failureaccess:1.0.1 - https://github.com/google/guava/failureaccess) - * Guava: Google Core Libraries for Java (com.google.guava:guava:32.1.3-jre - https://github.com/google/guava) + * Guava InternalFutureFailureAccess and InternalFutures (com.google.guava:failureaccess:1.0.3 - https://github.com/google/guava/failureaccess) + * Guava: Google Core Libraries for Java (com.google.guava:guava:33.6.0-jre - https://github.com/google/guava) * Guava ListenableFuture only (com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava - https://github.com/google/guava/listenablefuture) * Google HTTP Client Library for Java (com.google.http-client:google-http-client:1.47.1 - https://github.com/googleapis/google-http-java-client/google-http-client) * Apache HTTP transport v2 for the Google HTTP Client Library for Java. (com.google.http-client:google-http-client-apache-v2:1.42.0 - https://github.com/googleapis/google-http-java-client/google-http-client-apache-v2) * GSON extensions to the Google HTTP Client Library for Java. (com.google.http-client:google-http-client-gson:1.47.1 - https://github.com/googleapis/google-http-java-client/google-http-client-gson) * Jackson 2 extensions to the Google HTTP Client Library for Java. (com.google.http-client:google-http-client-jackson2:1.47.1 - https://github.com/googleapis/google-http-java-client/google-http-client-jackson2) * J2ObjC Annotations (com.google.j2objc:j2objc-annotations:1.3 - https://github.com/google/j2objc/) - * J2ObjC Annotations (com.google.j2objc:j2objc-annotations:2.8 - https://github.com/google/j2objc/) + * J2ObjC Annotations (com.google.j2objc:j2objc-annotations:3.1 - https://github.com/google/j2objc/) * Google OAuth Client Library for Java (com.google.oauth-client:google-oauth-client:1.39.0 - https://github.com/googleapis/google-oauth-java-client/google-oauth-client) * ConcurrentLinkedHashMap (com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:1.4.2 - http://code.google.com/p/concurrentlinkedhashmap) * libphonenumber (com.googlecode.libphonenumber:libphonenumber:8.11.1 - https://github.com/google/libphonenumber/) @@ -93,13 +94,13 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * SparseBitSet (com.zaxxer:SparseBitSet:1.3 - https://github.com/brettwooldridge/SparseBitSet) * Apache Commons BeanUtils (commons-beanutils:commons-beanutils:1.11.0 - https://commons.apache.org/proper/commons-beanutils) * Apache Commons CLI (commons-cli:commons-cli:1.11.0 - https://commons.apache.org/proper/commons-cli/) - * Apache Commons Codec (commons-codec:commons-codec:1.20.0 - https://commons.apache.org/proper/commons-codec/) + * Apache Commons Codec (commons-codec:commons-codec:1.22.0 - https://commons.apache.org/proper/commons-codec/) * Apache Commons Collections (commons-collections:commons-collections:3.2.2 - http://commons.apache.org/collections/) * Commons Digester (commons-digester:commons-digester:2.1 - http://commons.apache.org/digester/) * Commons FileUpload (commons-fileupload:commons-fileupload:1.2.1 - http://commons.apache.org/fileupload/) - * Apache Commons IO (commons-io:commons-io:2.21.0 - https://commons.apache.org/proper/commons-io/) + * Apache Commons IO (commons-io:commons-io:2.22.0 - https://commons.apache.org/proper/commons-io/) * Commons Lang (commons-lang:commons-lang:2.6 - http://commons.apache.org/lang/) - * Apache Commons Logging (commons-logging:commons-logging:1.3.5 - https://commons.apache.org/proper/commons-logging/) + * Apache Commons Logging (commons-logging:commons-logging:1.3.6 - https://commons.apache.org/proper/commons-logging/) * Apache Commons Validator (commons-validator:commons-validator:1.10.1 - https://commons.apache.org/proper/commons-validator/) * GeoJson POJOs for Jackson (de.grundid.opendatalab:geojson-jackson:1.14 - https://github.com/opendatalab-de/geojson-jackson) * OpenAIRE Funders Model (eu.openaire:funders-model:2.0.0 - https://api.openaire.eu) @@ -108,34 +109,34 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Metrics Integration for Jetty 9.3 and higher (io.dropwizard.metrics:metrics-jetty9:4.1.5 - https://metrics.dropwizard.io/metrics-jetty9) * Metrics Integration with JMX (io.dropwizard.metrics:metrics-jmx:4.1.5 - https://metrics.dropwizard.io/metrics-jmx) * JVM Integration for Metrics (io.dropwizard.metrics:metrics-jvm:4.1.5 - https://metrics.dropwizard.io/metrics-jvm) - * io.grpc:grpc-api (io.grpc:grpc-api:1.77.0 - https://github.com/grpc/grpc-java) - * io.grpc:grpc-context (io.grpc:grpc-context:1.77.0 - https://github.com/grpc/grpc-java) + * io.grpc:grpc-api (io.grpc:grpc-api:1.80.0 - https://github.com/grpc/grpc-java) + * io.grpc:grpc-context (io.grpc:grpc-context:1.80.0 - https://github.com/grpc/grpc-java) * micrometer-core (io.micrometer:micrometer-core:1.9.17 - https://github.com/micrometer-metrics/micrometer) * Netty/Buffer (io.netty:netty-buffer:4.1.99.Final - https://netty.io/netty-buffer/) - * Netty/Buffer (io.netty:netty-buffer:4.2.7.Final - https://netty.io/netty-buffer/) + * Netty/Buffer (io.netty:netty-buffer:4.2.12.Final - https://netty.io/netty-buffer/) * Netty/Codec (io.netty:netty-codec:4.1.99.Final - https://netty.io/netty-codec/) - * Netty/Codec (io.netty:netty-codec:4.2.7.Final - https://netty.io/netty-codec/) - * Netty/Codec/Base (io.netty:netty-codec-base:4.2.7.Final - https://netty.io/netty-codec-base/) - * Netty/Codec/Compression (io.netty:netty-codec-compression:4.2.7.Final - https://netty.io/netty-codec-compression/) + * Netty/Codec (io.netty:netty-codec:4.2.12.Final - https://netty.io/netty-codec/) + * Netty/Codec/Base (io.netty:netty-codec-base:4.2.12.Final - https://netty.io/netty-codec-base/) + * Netty/Codec/Compression (io.netty:netty-codec-compression:4.2.12.Final - https://netty.io/netty-codec-compression/) * Netty/Codec/HTTP (io.netty:netty-codec-http:4.1.86.Final - https://netty.io/netty-codec-http/) * Netty/Codec/HTTP2 (io.netty:netty-codec-http2:4.1.86.Final - https://netty.io/netty-codec-http2/) - * Netty/Codec/Marshalling (io.netty:netty-codec-marshalling:4.2.7.Final - https://netty.io/netty-codec-marshalling/) - * Netty/Codec/Protobuf (io.netty:netty-codec-protobuf:4.2.7.Final - https://netty.io/netty-codec-protobuf/) + * Netty/Codec/Marshalling (io.netty:netty-codec-marshalling:4.2.12.Final - https://netty.io/netty-codec-marshalling/) + * Netty/Codec/Protobuf (io.netty:netty-codec-protobuf:4.2.12.Final - https://netty.io/netty-codec-protobuf/) * Netty/Codec/Socks (io.netty:netty-codec-socks:4.1.86.Final - https://netty.io/netty-codec-socks/) * Netty/Common (io.netty:netty-common:4.1.99.Final - https://netty.io/netty-common/) - * Netty/Common (io.netty:netty-common:4.2.7.Final - https://netty.io/netty-common/) + * Netty/Common (io.netty:netty-common:4.2.12.Final - https://netty.io/netty-common/) * Netty/Handler (io.netty:netty-handler:4.1.99.Final - https://netty.io/netty-handler/) - * Netty/Handler (io.netty:netty-handler:4.2.7.Final - https://netty.io/netty-handler/) + * Netty/Handler (io.netty:netty-handler:4.2.12.Final - https://netty.io/netty-handler/) * Netty/Handler/Proxy (io.netty:netty-handler-proxy:4.1.86.Final - https://netty.io/netty-handler-proxy/) * Netty/Resolver (io.netty:netty-resolver:4.1.99.Final - https://netty.io/netty-resolver/) * Netty/TomcatNative [BoringSSL - Static] (io.netty:netty-tcnative-boringssl-static:2.0.56.Final - https://github.com/netty/netty-tcnative/netty-tcnative-boringssl-static/) * Netty/TomcatNative [OpenSSL - Classes] (io.netty:netty-tcnative-classes:2.0.56.Final - https://github.com/netty/netty-tcnative/netty-tcnative-classes/) * Netty/Transport (io.netty:netty-transport:4.1.99.Final - https://netty.io/netty-transport/) - * Netty/Transport (io.netty:netty-transport:4.2.7.Final - https://netty.io/netty-transport/) + * Netty/Transport (io.netty:netty-transport:4.2.12.Final - https://netty.io/netty-transport/) * Netty/Transport/Classes/Epoll (io.netty:netty-transport-classes-epoll:4.1.99.Final - https://netty.io/netty-transport-classes-epoll/) * Netty/Transport/Native/Epoll (io.netty:netty-transport-native-epoll:4.1.99.Final - https://netty.io/netty-transport-native-epoll/) * Netty/Transport/Native/Unix/Common (io.netty:netty-transport-native-unix-common:4.1.99.Final - https://netty.io/netty-transport-native-unix-common/) - * Netty/Transport/Native/Unix/Common (io.netty:netty-transport-native-unix-common:4.2.7.Final - https://netty.io/netty-transport-native-unix-common/) + * Netty/Transport/Native/Unix/Common (io.netty:netty-transport-native-unix-common:4.2.12.Final - https://netty.io/netty-transport-native-unix-common/) * OpenCensus (io.opencensus:opencensus-api:0.31.1 - https://github.com/census-instrumentation/opencensus-java) * OpenCensus (io.opencensus:opencensus-contrib-http-util:0.31.1 - https://github.com/census-instrumentation/opencensus-java) * OpenTracing API (io.opentracing:opentracing-api:0.33.0 - https://github.com/opentracing/opentracing-java/opentracing-api) @@ -164,7 +165,7 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * JSR107 API and SPI (javax.cache:cache-api:1.1.1 - https://github.com/jsr107/jsr107spec) * javax.inject (javax.inject:javax.inject:1 - http://code.google.com/p/atinject/) * jdbm (jdbm:jdbm:1.0 - no url defined) - * Joda-Time (joda-time:joda-time:2.14.0 - https://www.joda.org/joda-time/) + * Joda-Time (joda-time:joda-time:2.14.1 - https://www.joda.org/joda-time/) * Byte Buddy (without dependencies) (net.bytebuddy:byte-buddy:1.11.13 - https://bytebuddy.net/byte-buddy) * Byte Buddy (without dependencies) (net.bytebuddy:byte-buddy:1.12.18 - https://bytebuddy.net/byte-buddy) * Byte Buddy agent (net.bytebuddy:byte-buddy-agent:1.11.13 - https://bytebuddy.net/byte-buddy-agent) @@ -176,25 +177,25 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * JSON Small and Fast Parser (net.minidev:json-smart:2.6.0 - https://urielch.github.io/) * Abdera Core (org.apache.abdera:abdera-core:1.1.3 - http://abdera.apache.org/abdera-core) * I18N Libraries (org.apache.abdera:abdera-i18n:1.1.3 - http://abdera.apache.org) - * Apache Ant Core (org.apache.ant:ant:1.10.15 - https://ant.apache.org/) - * Apache Ant Launcher (org.apache.ant:ant-launcher:1.10.15 - https://ant.apache.org/) - * Apache Commons BCEL (org.apache.bcel:bcel:6.11.0 - https://commons.apache.org/proper/commons-bcel) + * Apache Ant Core (org.apache.ant:ant:1.10.17 - https://ant.apache.org/) + * Apache Ant Launcher (org.apache.ant:ant-launcher:1.10.17 - https://ant.apache.org/) + * Apache Commons BCEL (org.apache.bcel:bcel:6.12.0 - https://commons.apache.org/proper/commons-bcel) * Calcite Core (org.apache.calcite:calcite-core:1.35.0 - https://calcite.apache.org) * Calcite Linq4j (org.apache.calcite:calcite-linq4j:1.35.0 - https://calcite.apache.org) * Apache Calcite Avatica (org.apache.calcite.avatica:avatica-core:1.23.0 - https://calcite.apache.org/avatica) * Apache Calcite Avatica Metrics (org.apache.calcite.avatica:avatica-metrics:1.23.0 - https://calcite.apache.org/avatica) * Apache Commons Collections (org.apache.commons:commons-collections4:4.5.0 - https://commons.apache.org/proper/commons-collections/) * Apache Commons Compress (org.apache.commons:commons-compress:1.28.0 - https://commons.apache.org/proper/commons-compress/) - * Apache Commons Configuration (org.apache.commons:commons-configuration2:2.13.0 - https://commons.apache.org/proper/commons-configuration/) + * Apache Commons Configuration (org.apache.commons:commons-configuration2:2.15.0 - https://commons.apache.org/proper/commons-configuration/) * Apache Commons CSV (org.apache.commons:commons-csv:1.14.1 - https://commons.apache.org/proper/commons-csv/) - * Apache Commons DBCP (org.apache.commons:commons-dbcp2:2.13.0 - https://commons.apache.org/proper/commons-dbcp/) + * Apache Commons DBCP (org.apache.commons:commons-dbcp2:2.14.0 - https://commons.apache.org/proper/commons-dbcp/) * Apache Commons Digester (org.apache.commons:commons-digester3:3.2 - http://commons.apache.org/digester/) * Apache Commons Exec (org.apache.commons:commons-exec:1.3 - http://commons.apache.org/proper/commons-exec/) - * Apache Commons Exec (org.apache.commons:commons-exec:1.5.0 - https://commons.apache.org/proper/commons-exec/) + * Apache Commons Exec (org.apache.commons:commons-exec:1.6.0 - https://commons.apache.org/proper/commons-exec/) * Apache Commons Lang (org.apache.commons:commons-lang3:3.20.0 - https://commons.apache.org/proper/commons-lang/) * Apache Commons Math (org.apache.commons:commons-math3:3.6.1 - http://commons.apache.org/proper/commons-math/) - * Apache Commons Pool (org.apache.commons:commons-pool2:2.12.1 - https://commons.apache.org/proper/commons-pool/) - * Apache Commons Text (org.apache.commons:commons-text:1.14.0 - https://commons.apache.org/proper/commons-text) + * Apache Commons Pool (org.apache.commons:commons-pool2:2.13.1 - https://commons.apache.org/proper/commons-pool/) + * Apache Commons Text (org.apache.commons:commons-text:1.15.0 - https://commons.apache.org/proper/commons-text) * Curator Client (org.apache.curator:curator-client:2.13.0 - http://curator.apache.org/curator-client) * Curator Framework (org.apache.curator:curator-framework:2.13.0 - http://curator.apache.org/curator-framework) * Curator Recipes (org.apache.curator:curator-recipes:2.13.0 - http://curator.apache.org/curator-recipes) @@ -210,7 +211,7 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Apache HttpClient (org.apache.httpcomponents.client5:httpclient5:5.1.3 - https://hc.apache.org/httpcomponents-client-5.0.x/5.1.3/httpclient5/) * Apache HttpComponents Core HTTP/1.1 (org.apache.httpcomponents.core5:httpcore5:5.1.3 - https://hc.apache.org/httpcomponents-core-5.1.x/5.1.3/httpcore5/) * Apache HttpComponents Core HTTP/2 (org.apache.httpcomponents.core5:httpcore5-h2:5.1.3 - https://hc.apache.org/httpcomponents-core-5.1.x/5.1.3/httpcore5-h2/) - * Apache James :: Mime4j :: Core (org.apache.james:apache-mime4j-core:0.8.13 - http://james.apache.org/mime4j/apache-mime4j-core) + * Apache James :: Mime4j :: Core (org.apache.james:apache-mime4j-core:0.8.14 - http://james.apache.org/mime4j/apache-mime4j-core) * Apache James :: Mime4j :: DOM (org.apache.james:apache-mime4j-dom:0.8.13 - http://james.apache.org/mime4j/apache-mime4j-dom) * Apache Jena - Libraries POM (org.apache.jena:apache-jena-libs:2.13.0 - http://jena.apache.org/apache-jena-libs/) * Apache Jena - ARQ (SPARQL 1.1 Query Engine) (org.apache.jena:jena-arq:2.13.0 - http://jena.apache.org/jena-arq/) @@ -221,9 +222,9 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Kerby-kerb Util (org.apache.kerby:kerb-util:1.0.1 - http://directory.apache.org/kerby/kerby-kerb/kerb-util) * Kerby ASN1 Project (org.apache.kerby:kerby-asn1:1.0.1 - http://directory.apache.org/kerby/kerby-common/kerby-asn1) * Kerby PKIX Project (org.apache.kerby:kerby-pkix:1.0.1 - http://directory.apache.org/kerby/kerby-pkix) - * Apache Log4j 1.x Compatibility API (org.apache.logging.log4j:log4j-1.2-api:2.25.2 - https://logging.apache.org/log4j/2.x/) - * Apache Log4j API (org.apache.logging.log4j:log4j-api:2.25.2 - https://logging.apache.org/log4j/2.x/) - * Apache Log4j Core (org.apache.logging.log4j:log4j-core:2.25.2 - https://logging.apache.org/log4j/2.x/) + * Apache Log4j 1.x Compatibility API (org.apache.logging.log4j:log4j-1.2-api:2.25.4 - https://logging.apache.org/log4j/2.x/) + * Apache Log4j API (org.apache.logging.log4j:log4j-api:2.25.4 - https://logging.apache.org/log4j/2.x/) + * Apache Log4j Core (org.apache.logging.log4j:log4j-core:2.25.4 - https://logging.apache.org/log4j/2.x/) * Apache Log4j JUL Adapter (org.apache.logging.log4j:log4j-jul:2.17.2 - https://logging.apache.org/log4j/2.x/log4j-jul/) * Apache Log4j Layout for JSON template (org.apache.logging.log4j:log4j-layout-template-json:2.17.2 - https://logging.apache.org/log4j/2.x/log4j-layout-template-json/) * Apache Log4j SLF4J Binding (org.apache.logging.log4j:log4j-slf4j-impl:2.17.2 - https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/) @@ -251,46 +252,46 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Lucene Spatial Extras (org.apache.lucene:lucene-spatial-extras:8.11.4 - https://lucene.apache.org/lucene-parent/lucene-spatial-extras) * Lucene Spatial 3D (org.apache.lucene:lucene-spatial3d:8.11.4 - https://lucene.apache.org/lucene-parent/lucene-spatial3d) * Lucene Suggest (org.apache.lucene:lucene-suggest:8.11.4 - https://lucene.apache.org/lucene-parent/lucene-suggest) - * Apache FontBox (org.apache.pdfbox:fontbox:3.0.5 - http://pdfbox.apache.org/) + * Apache FontBox (org.apache.pdfbox:fontbox:3.0.7 - http://pdfbox.apache.org/) * PDFBox JBIG2 ImageIO plugin (org.apache.pdfbox:jbig2-imageio:3.0.4 - https://www.apache.org/jbig2-imageio/) * Apache JempBox (org.apache.pdfbox:jempbox:1.8.17 - http://www.apache.org/pdfbox-parent/jempbox/) - * Apache PDFBox (org.apache.pdfbox:pdfbox:3.0.5 - https://www.apache.org/pdfbox-parent/pdfbox/) - * Apache PDFBox io (org.apache.pdfbox:pdfbox-io:3.0.5 - https://www.apache.org/pdfbox-parent/pdfbox-io/) - * Apache PDFBox tools (org.apache.pdfbox:pdfbox-tools:3.0.5 - https://www.apache.org/pdfbox-parent/pdfbox-tools/) - * Apache XmpBox (org.apache.pdfbox:xmpbox:3.0.5 - https://www.apache.org/pdfbox-parent/xmpbox/) - * Apache POI - Common (org.apache.poi:poi:5.4.1 - https://poi.apache.org/) - * Apache POI - API based on OPC and OOXML schemas (org.apache.poi:poi-ooxml:5.4.1 - https://poi.apache.org/) - * Apache POI (org.apache.poi:poi-ooxml-lite:5.4.1 - https://poi.apache.org/) - * Apache POI (org.apache.poi:poi-scratchpad:5.4.1 - https://poi.apache.org/) + * Apache PDFBox (org.apache.pdfbox:pdfbox:3.0.7 - https://www.apache.org/pdfbox-parent/pdfbox/) + * Apache PDFBox io (org.apache.pdfbox:pdfbox-io:3.0.7 - https://www.apache.org/pdfbox-parent/pdfbox-io/) + * Apache PDFBox tools (org.apache.pdfbox:pdfbox-tools:3.0.7 - https://www.apache.org/pdfbox-parent/pdfbox-tools/) + * Apache XmpBox (org.apache.pdfbox:xmpbox:3.0.7 - https://www.apache.org/pdfbox-parent/xmpbox/) + * Apache POI - Common (org.apache.poi:poi:5.5.1 - https://poi.apache.org/) + * Apache POI - API based on OPC and OOXML schemas (org.apache.poi:poi-ooxml:5.5.1 - https://poi.apache.org/) + * Apache POI - OOXML schemas (full) (org.apache.poi:poi-ooxml-full:5.5.1 - https://poi.apache.org/) + * Apache POI (org.apache.poi:poi-scratchpad:5.5.1 - https://poi.apache.org/) * Apache Solr Core (org.apache.solr:solr-core:8.11.4 - https://lucene.apache.org/solr-parent/solr-core) * Apache Solr Solrj (org.apache.solr:solr-solrj:8.11.4 - https://lucene.apache.org/solr-parent/solr-solrj) * Apache Standard Taglib Implementation (org.apache.taglibs:taglibs-standard-impl:1.2.5 - http://tomcat.apache.org/taglibs/standard-1.2.5/taglibs-standard-impl) * Apache Standard Taglib Specification API (org.apache.taglibs:taglibs-standard-spec:1.2.5 - http://tomcat.apache.org/taglibs/standard-1.2.5/taglibs-standard-spec) * Apache Thrift (org.apache.thrift:libthrift:0.9.2 - http://thrift.apache.org) - * Apache Tika core (org.apache.tika:tika-core:3.2.3 - https://tika.apache.org/) - * Apache Tika Apple parser module (org.apache.tika:tika-parser-apple-module:3.2.3 - https://tika.apache.org/tika-parser-apple-module/) - * Apache Tika audiovideo parser module (org.apache.tika:tika-parser-audiovideo-module:3.2.3 - https://tika.apache.org/tika-parser-audiovideo-module/) - * Apache Tika cad parser module (org.apache.tika:tika-parser-cad-module:3.2.3 - https://tika.apache.org/tika-parser-cad-module/) - * Apache Tika code parser module (org.apache.tika:tika-parser-code-module:3.2.3 - https://tika.apache.org/tika-parser-code-module/) - * Apache Tika crypto parser module (org.apache.tika:tika-parser-crypto-module:3.2.3 - https://tika.apache.org/tika-parser-crypto-module/) - * Apache Tika digest commons (org.apache.tika:tika-parser-digest-commons:3.2.3 - https://tika.apache.org/tika-parser-digest-commons/) - * Apache Tika font parser module (org.apache.tika:tika-parser-font-module:3.2.3 - https://tika.apache.org/tika-parser-font-module/) - * Apache Tika html parser module (org.apache.tika:tika-parser-html-module:3.2.3 - https://tika.apache.org/tika-parser-html-module/) - * Apache Tika image parser module (org.apache.tika:tika-parser-image-module:3.2.3 - https://tika.apache.org/tika-parser-image-module/) - * Apache Tika mail commons (org.apache.tika:tika-parser-mail-commons:3.2.3 - https://tika.apache.org/tika-parser-mail-commons/) - * Apache Tika mail parser module (org.apache.tika:tika-parser-mail-module:3.2.3 - https://tika.apache.org/tika-parser-mail-module/) - * Apache Tika Microsoft parser module (org.apache.tika:tika-parser-microsoft-module:3.2.3 - https://tika.apache.org/tika-parser-microsoft-module/) - * Apache Tika miscellaneous office format parser module (org.apache.tika:tika-parser-miscoffice-module:3.2.3 - https://tika.apache.org/tika-parser-miscoffice-module/) - * Apache Tika news parser module (org.apache.tika:tika-parser-news-module:3.2.3 - https://tika.apache.org/tika-parser-news-module/) - * Apache Tika OCR parser module (org.apache.tika:tika-parser-ocr-module:3.2.3 - https://tika.apache.org/tika-parser-ocr-module/) - * Apache Tika PDF parser module (org.apache.tika:tika-parser-pdf-module:3.2.3 - https://tika.apache.org/tika-parser-pdf-module/) - * Apache Tika package parser module (org.apache.tika:tika-parser-pkg-module:3.2.3 - https://tika.apache.org/tika-parser-pkg-module/) - * Apache Tika text parser module (org.apache.tika:tika-parser-text-module:3.2.3 - https://tika.apache.org/tika-parser-text-module/) - * Apache Tika WARC parser module (org.apache.tika:tika-parser-webarchive-module:3.2.3 - https://tika.apache.org/tika-parser-webarchive-module/) - * Apache Tika XML parser module (org.apache.tika:tika-parser-xml-module:3.2.3 - https://tika.apache.org/tika-parser-xml-module/) - * Apache Tika XMP commons (org.apache.tika:tika-parser-xmp-commons:3.2.3 - https://tika.apache.org/tika-parser-xmp-commons/) - * Apache Tika ZIP commons (org.apache.tika:tika-parser-zip-commons:3.2.3 - https://tika.apache.org/tika-parser-zip-commons/) - * Apache Tika standard parser package (org.apache.tika:tika-parsers-standard-package:3.2.3 - https://tika.apache.org/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/) + * Apache Tika core (org.apache.tika:tika-core:3.3.0 - https://tika.apache.org/) + * Apache Tika Apple parser module (org.apache.tika:tika-parser-apple-module:3.3.0 - https://tika.apache.org/tika-parser-apple-module/) + * Apache Tika audiovideo parser module (org.apache.tika:tika-parser-audiovideo-module:3.3.0 - https://tika.apache.org/tika-parser-audiovideo-module/) + * Apache Tika cad parser module (org.apache.tika:tika-parser-cad-module:3.3.0 - https://tika.apache.org/tika-parser-cad-module/) + * Apache Tika code parser module (org.apache.tika:tika-parser-code-module:3.3.0 - https://tika.apache.org/tika-parser-code-module/) + * Apache Tika crypto parser module (org.apache.tika:tika-parser-crypto-module:3.3.0 - https://tika.apache.org/tika-parser-crypto-module/) + * Apache Tika digest commons (org.apache.tika:tika-parser-digest-commons:3.3.0 - https://tika.apache.org/tika-parser-digest-commons/) + * Apache Tika font parser module (org.apache.tika:tika-parser-font-module:3.3.0 - https://tika.apache.org/tika-parser-font-module/) + * Apache Tika html parser module (org.apache.tika:tika-parser-html-module:3.3.0 - https://tika.apache.org/tika-parser-html-module/) + * Apache Tika image parser module (org.apache.tika:tika-parser-image-module:3.3.0 - https://tika.apache.org/tika-parser-image-module/) + * Apache Tika mail commons (org.apache.tika:tika-parser-mail-commons:3.3.0 - https://tika.apache.org/tika-parser-mail-commons/) + * Apache Tika mail parser module (org.apache.tika:tika-parser-mail-module:3.3.0 - https://tika.apache.org/tika-parser-mail-module/) + * Apache Tika Microsoft parser module (org.apache.tika:tika-parser-microsoft-module:3.3.0 - https://tika.apache.org/tika-parser-microsoft-module/) + * Apache Tika miscellaneous office format parser module (org.apache.tika:tika-parser-miscoffice-module:3.3.0 - https://tika.apache.org/tika-parser-miscoffice-module/) + * Apache Tika news parser module (org.apache.tika:tika-parser-news-module:3.3.0 - https://tika.apache.org/tika-parser-news-module/) + * Apache Tika OCR parser module (org.apache.tika:tika-parser-ocr-module:3.3.0 - https://tika.apache.org/tika-parser-ocr-module/) + * Apache Tika PDF parser module (org.apache.tika:tika-parser-pdf-module:3.3.0 - https://tika.apache.org/tika-parser-pdf-module/) + * Apache Tika package parser module (org.apache.tika:tika-parser-pkg-module:3.3.0 - https://tika.apache.org/tika-parser-pkg-module/) + * Apache Tika text parser module (org.apache.tika:tika-parser-text-module:3.3.0 - https://tika.apache.org/tika-parser-text-module/) + * Apache Tika WARC parser module (org.apache.tika:tika-parser-webarchive-module:3.3.0 - https://tika.apache.org/tika-parser-webarchive-module/) + * Apache Tika XML parser module (org.apache.tika:tika-parser-xml-module:3.3.0 - https://tika.apache.org/tika-parser-xml-module/) + * Apache Tika XMP commons (org.apache.tika:tika-parser-xmp-commons:3.3.0 - https://tika.apache.org/tika-parser-xmp-commons/) + * Apache Tika ZIP commons (org.apache.tika:tika-parser-zip-commons:3.3.0 - https://tika.apache.org/tika-parser-zip-commons/) + * Apache Tika standard parser package (org.apache.tika:tika-parsers-standard-package:3.3.0 - https://tika.apache.org/tika-parsers/tika-parsers-standard/tika-parsers-standard-package/) * tomcat-embed-core (org.apache.tomcat.embed:tomcat-embed-core:9.0.83 - https://tomcat.apache.org/) * tomcat-embed-el (org.apache.tomcat.embed:tomcat-embed-el:9.0.83 - https://tomcat.apache.org/) * tomcat-embed-websocket (org.apache.tomcat.embed:tomcat-embed-websocket:9.0.83 - https://tomcat.apache.org/) @@ -345,21 +346,22 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * flyway-core (org.flywaydb:flyway-core:8.5.13 - https://flywaydb.org/flyway-core) * Ogg and Vorbis for Java, Core (org.gagravarr:vorbis-java-core:0.8 - https://github.com/Gagravarr/VorbisJava) * Apache Tika plugin for Ogg, Vorbis and FLAC (org.gagravarr:vorbis-java-tika:0.8 - https://github.com/Gagravarr/VorbisJava) - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-core-common (org.glassfish.jersey.core:jersey-common:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-common) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-core-common (org.glassfish.jersey.core:jersey-common:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-common) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) * Hibernate Validator Engine (org.hibernate.validator:hibernate-validator:6.2.5.Final - http://hibernate.org/validator/hibernate-validator) * Hibernate Validator Portable Extension (org.hibernate.validator:hibernate-validator-cdi:6.2.5.Final - http://hibernate.org/validator/hibernate-validator-cdi) * org.immutables.value-annotations (org.immutables:value-annotations:2.9.2 - http://immutables.org/value-annotations) * Javassist (org.javassist:javassist:3.30.2-GA - https://www.javassist.org/) * Java Annotation Indexer (org.jboss:jandex:2.4.2.Final - http://www.jboss.org/jandex) - * JBoss Logging 3 (org.jboss.logging:jboss-logging:3.6.1.Final - http://www.jboss.org) + * JBoss Logging 3 (org.jboss.logging:jboss-logging:3.4.3.Final - http://www.jboss.org) * JDOM (org.jdom:jdom2:2.0.6.1 - http://www.jdom.org) * JetBrains Java Annotations (org.jetbrains:annotations:17.0.0 - https://github.com/JetBrains/java-annotations) * Kotlin Stdlib (org.jetbrains.kotlin:kotlin-stdlib:1.8.21 - https://kotlinlang.org/) * Kotlin Stdlib Common (org.jetbrains.kotlin:kotlin-stdlib-common:1.8.21 - https://kotlinlang.org/) * Kotlin Stdlib Jdk7 (org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21 - https://kotlinlang.org/) * Kotlin Stdlib Jdk8 (org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 - https://kotlinlang.org/) + * JSpecify annotations (org.jspecify:jspecify:1.0.0 - http://jspecify.org/) * jtwig-core (org.jtwig:jtwig-core:5.87.0.RELEASE - http://jtwig.org) * jtwig-reflection (org.jtwig:jtwig-reflection:5.87.0.RELEASE - http://jtwig.org) * jtwig-spring (org.jtwig:jtwig-spring:5.87.0.RELEASE - http://jtwig.org) @@ -377,7 +379,7 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Jetty Servlet Tester (org.mortbay.jetty:jetty-servlet-tester:6.1.26 - http://www.eclipse.org/jetty/jetty-parent/project/jetty-servlet-tester) * Jetty Utilities (org.mortbay.jetty:jetty-util:6.1.26 - http://www.eclipse.org/jetty/jetty-parent/project/jetty-util) * Servlet Specification API (org.mortbay.jetty:servlet-api:2.5-20081211 - http://jetty.mortbay.org/servlet-api) - * jwarc (org.netpreserve:jwarc:0.32.0 - https://github.com/iipc/jwarc) + * jwarc (org.netpreserve:jwarc:0.35.0 - https://github.com/iipc/jwarc) * Objenesis (org.objenesis:objenesis:3.2 - http://objenesis.org/objenesis) * parboiled-core (org.parboiled:parboiled-core:1.1.7 - http://parboiled.org) * parboiled-java (org.parboiled:parboiled-java:1.1.7 - http://parboiled.org) @@ -436,39 +438,43 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * org.xmlunit:xmlunit-core (org.xmlunit:xmlunit-core:2.9.1 - https://www.xmlunit.org/) * org.xmlunit:xmlunit-placeholders (org.xmlunit:xmlunit-placeholders:2.9.1 - https://www.xmlunit.org/xmlunit-placeholders/) * SnakeYAML (org.yaml:snakeyaml:1.30 - https://bitbucket.org/snakeyaml/snakeyaml) - * AWS Java SDK :: Annotations (software.amazon.awssdk:annotations:2.38.8 - https://aws.amazon.com/sdkforjava/core/annotations) - * AWS Java SDK :: Arns (software.amazon.awssdk:arns:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Auth (software.amazon.awssdk:auth:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: AWS Core (software.amazon.awssdk:aws-core:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Core :: Protocols :: AWS Query Protocol (software.amazon.awssdk:aws-query-protocol:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Core :: Protocols :: AWS Xml Protocol (software.amazon.awssdk:aws-xml-protocol:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Checksums (software.amazon.awssdk:checksums:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Checksums SPI (software.amazon.awssdk:checksums-spi:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: AWS CRT Core (software.amazon.awssdk:crt-core:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Endpoints SPI (software.amazon.awssdk:endpoints-spi:2.38.8 - https://aws.amazon.com/sdkforjava/core/endpoints-spi) - * AWS Java SDK :: HTTP Auth (software.amazon.awssdk:http-auth:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: HTTP Auth AWS (software.amazon.awssdk:http-auth-aws:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: HTTP Auth Event Stream (software.amazon.awssdk:http-auth-aws-eventstream:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: HTTP Auth SPI (software.amazon.awssdk:http-auth-spi:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: HTTP Client Interface (software.amazon.awssdk:http-client-spi:2.38.8 - https://aws.amazon.com/sdkforjava/http-client-spi) - * AWS Java SDK :: Identity SPI (software.amazon.awssdk:identity-spi:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Core :: Protocols :: Json Utils (software.amazon.awssdk:json-utils:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Metrics SPI (software.amazon.awssdk:metrics-spi:2.38.8 - https://aws.amazon.com/sdkforjava/core/metrics-spi) - * AWS Java SDK :: Profiles (software.amazon.awssdk:profiles:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Core :: Protocols :: Protocol Core (software.amazon.awssdk:protocol-core:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Regions (software.amazon.awssdk:regions:2.38.8 - https://aws.amazon.com/sdkforjava/core/regions) - * AWS Java SDK :: Retries (software.amazon.awssdk:retries:2.38.8 - https://aws.amazon.com/sdkforjava/core/retries) - * AWS Java SDK :: Retries API (software.amazon.awssdk:retries-spi:2.38.8 - https://aws.amazon.com/sdkforjava/core/retries-spi) - * AWS Java SDK :: Services :: Amazon S3 (software.amazon.awssdk:s3:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: SDK Core (software.amazon.awssdk:sdk-core:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Third Party :: Jackson-core (software.amazon.awssdk:third-party-jackson-core:2.38.8 - https://aws.amazon.com/sdkforjava) - * AWS Java SDK :: Utilities (software.amazon.awssdk:utils:2.38.8 - https://aws.amazon.com/sdkforjava/utils) - * AWS Java SDK :: Utils Lite (software.amazon.awssdk:utils-lite:2.38.8 - https://aws.amazon.com/sdkforjava) - * software.amazon.awssdk.crt:aws-crt (software.amazon.awssdk.crt:aws-crt:0.39.4 - https://github.com/awslabs/aws-crt-java) + * AWS Java SDK :: Annotations (software.amazon.awssdk:annotations:2.42.40 - https://aws.amazon.com/sdkforjava/core/annotations) + * AWS Java SDK :: Arns (software.amazon.awssdk:arns:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Auth (software.amazon.awssdk:auth:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: AWS Core (software.amazon.awssdk:aws-core:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Core :: Protocols :: AWS Query Protocol (software.amazon.awssdk:aws-query-protocol:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Core :: Protocols :: AWS Xml Protocol (software.amazon.awssdk:aws-xml-protocol:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Checksums (software.amazon.awssdk:checksums:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Checksums SPI (software.amazon.awssdk:checksums-spi:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: AWS CRT Core (software.amazon.awssdk:crt-core:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Endpoints SPI (software.amazon.awssdk:endpoints-spi:2.42.40 - https://aws.amazon.com/sdkforjava/core/endpoints-spi) + * AWS Java SDK :: HTTP Auth (software.amazon.awssdk:http-auth:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: HTTP Auth AWS (software.amazon.awssdk:http-auth-aws:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: HTTP Auth Event Stream (software.amazon.awssdk:http-auth-aws-eventstream:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: HTTP Auth SPI (software.amazon.awssdk:http-auth-spi:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: HTTP Client Interface (software.amazon.awssdk:http-client-spi:2.42.40 - https://aws.amazon.com/sdkforjava/http-client-spi) + * AWS Java SDK :: Identity SPI (software.amazon.awssdk:identity-spi:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Core :: Protocols :: Json Utils (software.amazon.awssdk:json-utils:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Metrics SPI (software.amazon.awssdk:metrics-spi:2.42.40 - https://aws.amazon.com/sdkforjava/core/metrics-spi) + * AWS Java SDK :: Profiles (software.amazon.awssdk:profiles:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Core :: Protocols :: Protocol Core (software.amazon.awssdk:protocol-core:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Regions (software.amazon.awssdk:regions:2.42.40 - https://aws.amazon.com/sdkforjava/core/regions) + * AWS Java SDK :: Retries (software.amazon.awssdk:retries:2.42.40 - https://aws.amazon.com/sdkforjava/core/retries) + * AWS Java SDK :: Retries API (software.amazon.awssdk:retries-spi:2.42.40 - https://aws.amazon.com/sdkforjava/core/retries-spi) + * AWS Java SDK :: Services :: Amazon S3 (software.amazon.awssdk:s3:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: SDK Core (software.amazon.awssdk:sdk-core:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Third Party :: Jackson-core (software.amazon.awssdk:third-party-jackson-core:2.42.40 - https://aws.amazon.com/sdkforjava) + * AWS Java SDK :: Utilities (software.amazon.awssdk:utils:2.42.40 - https://aws.amazon.com/sdkforjava/utils) + * AWS Java SDK :: Utils Lite (software.amazon.awssdk:utils-lite:2.42.40 - https://aws.amazon.com/sdkforjava) + * software.amazon.awssdk.crt:aws-crt (software.amazon.awssdk.crt:aws-crt:0.45.1 - https://github.com/awslabs/aws-crt-java) * AWS Event Stream (software.amazon.eventstream:eventstream:1.0.1 - https://github.com/awslabs/aws-eventstream-java) * Xerces2-j (xerces:xercesImpl:2.12.2 - https://xerces.apache.org/xerces2-j/) * XML Commons External Components XML APIs (xml-apis:xml-apis:1.4.01 - http://xml.apache.org/commons/components/external/) + BSD 2-Clause License: + + * zstd-jni (com.github.luben:zstd-jni:1.5.7-4 - https://github.com/luben/zstd-jni) + BSD License: * AntLR Parser Generator (antlr:antlr:2.7.7 - http://www.antlr.org/) @@ -480,15 +486,15 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Protocol Buffers [Core] (com.google.protobuf:protobuf-java:3.15.0 - https://developers.google.com/protocol-buffers/protobuf-java/) * JZlib (com.jcraft:jzlib:1.1.3 - http://www.jcraft.com/jzlib/) * jmustache (com.samskivert:jmustache:1.15 - http://github.com/samskivert/jmustache) - * dnsjava (dnsjava:dnsjava:3.6.3 - https://github.com/dnsjava/dnsjava) - * jaxen (jaxen:jaxen:2.0.0 - http://www.cafeconleche.org/jaxen/jaxen) + * dnsjava (dnsjava:dnsjava:3.6.4 - https://github.com/dnsjava/dnsjava) + * jaxen (jaxen:jaxen:2.0.1 - https://jaxen-xpath.github.io/jaxen/jaxen/) * ANTLR 4 Runtime (org.antlr:antlr4-runtime:4.5.1-1 - http://www.antlr.org/antlr4-runtime) * commons-compiler (org.codehaus.janino:commons-compiler:3.1.8 - http://janino-compiler.github.io/commons-compiler/) * janino (org.codehaus.janino:janino:3.1.8 - http://janino-compiler.github.io/janino/) * Stax2 API (org.codehaus.woodstox:stax2-api:4.2.1 - http://github.com/FasterXML/stax2-api) * Hamcrest Date (org.exparity:hamcrest-date:2.0.8 - https://github.com/exparity/hamcrest-date) - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) * Hamcrest (org.hamcrest:hamcrest:2.2 - http://hamcrest.org/JavaHamcrest/) * Hamcrest Core (org.hamcrest:hamcrest-core:2.2 - http://hamcrest.org/JavaHamcrest/) * HdrHistogram (org.hdrhistogram:HdrHistogram:2.1.12 - http://hdrhistogram.github.io/HdrHistogram/) @@ -498,10 +504,10 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * asm-commons (org.ow2.asm:asm-commons:9.3 - http://asm.ow2.io/) * ASM Tree (org.ow2.asm:asm-tree:5.0.3 - http://asm.objectweb.org/asm-tree/) * ASM Util (org.ow2.asm:asm-util:5.0.3 - http://asm.objectweb.org/asm-util/) - * PostgreSQL JDBC Driver (org.postgresql:postgresql:42.7.8 - https://jdbc.postgresql.org) + * PostgreSQL JDBC Driver (org.postgresql:postgresql:42.7.11 - https://jdbc.postgresql.org) * Reflections (org.reflections:reflections:0.9.12 - http://github.com/ronmamo/reflections) * JMatIO (org.tallison:jmatio:1.5 - https://github.com/tballison/jmatio) - * XZ for Java (org.tukaani:xz:1.10 - https://tukaani.org/xz/java.html) + * XZ for Java (org.tukaani:xz:1.12 - https://tukaani.org/xz/java.html) * XMLUnit for Java (xmlunit:xmlunit:1.3 - http://xmlunit.sourceforge.net/) Common Development and Distribution License (CDDL): @@ -519,15 +525,15 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * Java Servlet API (javax.servlet:javax.servlet-api:3.1.0 - http://servlet-spec.java.net) * javax.transaction API (javax.transaction:javax.transaction-api:1.3 - http://jta-spec.java.net) * jaxb-api (javax.xml.bind:jaxb-api:2.3.1 - https://github.com/javaee/jaxb-spec/jaxb-api) - * JHighlight (org.codelibs:jhighlight:1.1.0 - https://github.com/codelibs/jhighlight) + * JHighlight (org.codelibs:jhighlight:1.1.1 - https://github.com/codelibs/jhighlight) * HK2 API module (org.glassfish.hk2:hk2-api:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/hk2-api) * ServiceLocator Default Implementation (org.glassfish.hk2:hk2-locator:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/hk2-locator) * HK2 Implementation Utilities (org.glassfish.hk2:hk2-utils:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/hk2-utils) * OSGi resource locator (org.glassfish.hk2:osgi-resource-locator:1.0.3 - https://projects.eclipse.org/projects/ee4j/osgi-resource-locator) * aopalliance version 1.0 repackaged as a module (org.glassfish.hk2.external:aopalliance-repackaged:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/external/aopalliance-repackaged) * javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:jakarta.inject:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/external/jakarta.inject) - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) * Java Transaction API (org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.1.1.Final - http://www.jboss.org/jboss-transaction-api_1.2_spec) Cordra (Version 2) License Agreement: @@ -548,8 +554,8 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * javax.persistence-api (javax.persistence:javax.persistence-api:2.2 - https://github.com/javaee/jpa-spec) * JAXB Runtime (org.glassfish.jaxb:jaxb-runtime:2.3.9 - https://eclipse-ee4j.github.io/jaxb-ri/) * TXW2 Runtime (org.glassfish.jaxb:txw2:2.3.9 - https://eclipse-ee4j.github.io/jaxb-ri/) - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) * Java Persistence API, Version 2.1 (org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final - http://hibernate.org) * org.locationtech.jts:jts-core (org.locationtech.jts:jts-core:1.19.0 - https://www.locationtech.org/projects/technology.jts/jts-modules/jts-core) * org.locationtech.jts.io:jts-io-common (org.locationtech.jts.io:jts-io-common:1.19.0 - https://www.locationtech.org/projects/technology.jts/jts-modules/jts-io/jts-io-common) @@ -604,9 +610,9 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * OSGi resource locator (org.glassfish.hk2:osgi-resource-locator:1.0.3 - https://projects.eclipse.org/projects/ee4j/osgi-resource-locator) * aopalliance version 1.0 repackaged as a module (org.glassfish.hk2.external:aopalliance-repackaged:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/external/aopalliance-repackaged) * javax.inject:1 as OSGi bundle (org.glassfish.hk2.external:jakarta.inject:2.6.1 - https://github.com/eclipse-ee4j/glassfish-hk2/external/jakarta.inject) - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-core-common (org.glassfish.jersey.core:jersey-common:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-common) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-core-common (org.glassfish.jersey.core:jersey-common:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-common) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) * Java Persistence API, Version 2.1 (org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final - http://hibernate.org) * org.locationtech.jts:jts-core (org.locationtech.jts:jts-core:1.19.0 - https://www.locationtech.org/projects/technology.jts/jts-modules/jts-core) * org.locationtech.jts.io:jts-io-common (org.locationtech.jts.io:jts-io-common:1.19.0 - https://www.locationtech.org/projects/technology.jts/jts-modules/jts-io/jts-io-common) @@ -633,14 +639,14 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * msg-simple (com.github.java-json-tools:msg-simple:1.2 - https://github.com/java-json-tools/msg-simple) * uri-template (com.github.java-json-tools:uri-template:0.10 - https://github.com/java-json-tools/uri-template) * FindBugs-Annotations (com.google.code.findbugs:annotations:3.0.1u2 - http://findbugs.sourceforge.net/) - * JHighlight (org.codelibs:jhighlight:1.1.0 - https://github.com/codelibs/jhighlight) + * JHighlight (org.codelibs:jhighlight:1.1.1 - https://github.com/codelibs/jhighlight) * Hibernate ORM - hibernate-core (org.hibernate:hibernate-core:5.6.15.Final - https://hibernate.org/orm) * Hibernate ORM - hibernate-jcache (org.hibernate:hibernate-jcache:5.6.15.Final - https://hibernate.org/orm) * Hibernate ORM - hibernate-jpamodelgen (org.hibernate:hibernate-jpamodelgen:5.6.15.Final - https://hibernate.org/orm) * Hibernate Commons Annotations (org.hibernate.common:hibernate-commons-annotations:5.1.2.Final - http://hibernate.org) * im4java (org.im4java:im4java:1.4.0 - http://sourceforge.net/projects/im4java/) * Javassist (org.javassist:javassist:3.30.2-GA - https://www.javassist.org/) - * XOM (xom:xom:1.3.9 - https://xom.nu) + * XOM (xom:xom:1.4.0 - https://xom.nu) Go License: @@ -661,28 +667,27 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines MIT License: * Java SemVer (com.github.zafarkhaja:java-semver:0.9.0 - https://github.com/zafarkhaja/jsemver) - * dd-plist (com.googlecode.plist:dd-plist:1.28 - http://www.github.com/3breadt/dd-plist) + * dd-plist (com.googlecode.plist:dd-plist:1.29 - http://www.github.com/3breadt/dd-plist) * DigitalCollections: IIIF API Library (de.digitalcollections.iiif:iiif-apis:0.3.11 - https://github.com/dbmdz/iiif-apis) * ClassGraph (io.github.classgraph:classgraph:4.8.154 - https://github.com/classgraph/classgraph) * JOpt Simple (net.sf.jopt-simple:jopt-simple:5.0.4 - http://jopt-simple.github.io/jopt-simple) - * Bouncy Castle JavaMail Jakarta S/MIME APIs (org.bouncycastle:bcjmail-jdk18on:1.81 - https://www.bouncycastle.org/download/bouncy-castle-java/) - * Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs (org.bouncycastle:bcpkix-jdk18on:1.82 - https://www.bouncycastle.org/download/bouncy-castle-java/) - * Bouncy Castle Provider (org.bouncycastle:bcprov-jdk18on:1.82 - https://www.bouncycastle.org/download/bouncy-castle-java/) - * Bouncy Castle ASN.1 Extension and Utility APIs (org.bouncycastle:bcutil-jdk18on:1.82 - https://www.bouncycastle.org/download/bouncy-castle-java/) + * Bouncy Castle JavaMail Jakarta S/MIME APIs (org.bouncycastle:bcjmail-jdk18on:1.83 - https://www.bouncycastle.org/download/bouncy-castle-java/) + * Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs (org.bouncycastle:bcpkix-jdk18on:1.81 - https://www.bouncycastle.org/download/bouncy-castle-java/) + * Bouncy Castle Provider (org.bouncycastle:bcprov-jdk18on:1.81 - https://www.bouncycastle.org/download/bouncy-castle-java/) + * Bouncy Castle ASN.1 Extension and Utility APIs (org.bouncycastle:bcutil-jdk18on:1.81 - https://www.bouncycastle.org/download/bouncy-castle-java/) * org.brotli:dec (org.brotli:dec:0.1.2 - http://brotli.org/dec) * Checker Qual (org.checkerframework:checker-qual:3.23.0 - https://checkerframework.org) - * Checker Qual (org.checkerframework:checker-qual:3.49.5 - https://checkerframework.org/) - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) - * jsoup Java HTML Parser (org.jsoup:jsoup:1.21.2 - https://jsoup.org/) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jsoup Java HTML Parser (org.jsoup:jsoup:1.22.1 - https://jsoup.org/) * mockito-core (org.mockito:mockito-core:3.12.4 - https://github.com/mockito/mockito) * mockito-inline (org.mockito:mockito-inline:3.12.4 - https://github.com/mockito/mockito) * ORCID - Model (org.orcid:orcid-model:3.0.2 - http://github.com/ORCID/orcid-model) * Duct Tape (org.rnorth.duct-tape:duct-tape:1.0.8 - https://github.com/rnorth/duct-tape) * JUL to SLF4J bridge (org.slf4j:jul-to-slf4j:1.7.36 - http://www.slf4j.org) * SLF4J API Module (org.slf4j:slf4j-api:1.7.36 - http://www.slf4j.org) - * Testcontainers Core (org.testcontainers:testcontainers:2.0.2 - https://java.testcontainers.org) - * Testcontainers :: Localstack (org.testcontainers:testcontainers-localstack:2.0.2 - https://java.testcontainers.org) + * Testcontainers Core (org.testcontainers:testcontainers:2.0.5 - https://java.testcontainers.org) + * Testcontainers :: Localstack (org.testcontainers:testcontainers-localstack:2.0.5 - https://java.testcontainers.org) * HAL Browser (org.webjars:hal-browser:ad9b865 - http://webjars.org) * toastr (org.webjars.bowergithub.codeseven:toastr:2.1.4 - http://webjars.org) * backbone (org.webjars.bowergithub.jashkenas:backbone:1.4.1 - https://www.webjars.org) @@ -690,7 +695,7 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines * jquery (org.webjars.bowergithub.jquery:jquery-dist:3.7.1 - https://www.webjars.org) * urijs (org.webjars.bowergithub.medialize:uri.js:1.19.11 - https://www.webjars.org) * bootstrap (org.webjars.bowergithub.twbs:bootstrap:4.6.2 - https://www.webjars.org) - * core-js (org.webjars.npm:core-js:3.46.0 - https://www.webjars.org) + * core-js (org.webjars.npm:core-js:3.49.0 - https://www.webjars.org) * @json-editor/json-editor (org.webjars.npm:json-editor__json-editor:2.15.2 - https://www.webjars.org) MIT-0: @@ -707,9 +712,9 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines Public Domain: - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-core-common (org.glassfish.jersey.core:jersey-common:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-common) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-core-common (org.glassfish.jersey.core:jersey-common:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-common) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) * HdrHistogram (org.hdrhistogram:HdrHistogram:2.1.12 - http://hdrhistogram.github.io/HdrHistogram/) * JSON in Java (org.json:json:20231013 - https://github.com/douglascrockford/JSON-java) * LatencyUtils (org.latencyutils:LatencyUtils:2.0.3 - http://latencyutils.github.io/LatencyUtils/) @@ -717,11 +722,11 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines The Apache Software License, version 2.0: - * picocli (info.picocli:picocli:4.7.6 - https://picocli.info) + * picocli (info.picocli:picocli:4.7.7 - https://picocli.info) UnRar License: - * Java Unrar (com.github.junrar:junrar:7.5.5 - https://github.com/junrar/junrar) + * Java Unrar (com.github.junrar:junrar:7.5.8 - https://github.com/junrar/junrar) Unicode/ICU License: @@ -729,10 +734,10 @@ https://wiki.lyrasis.org/display/DSPACE/Code+Contribution+Guidelines W3C license: - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) jQuery license: - * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) - * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.47 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) + * jersey-core-client (org.glassfish.jersey.core:jersey-client:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/jersey-client) + * jersey-inject-hk2 (org.glassfish.jersey.inject:jersey-hk2:2.48 - https://projects.eclipse.org/projects/ee4j.jersey/project/jersey-hk2) From 7d35ae52c9f80811c21fb4aea228e7ad6e73e711 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 15:15:20 -0500 Subject: [PATCH 162/283] [maven-release-plugin] prepare release dspace-7.6.7 --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 28 ++++++++++++++-------------- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 4f4874d5d255..a64a19fa391d 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index 38dc845d0b1c..c3a4e2484859 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 5ea46fc1db14..64612f9d5f4d 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 8c7a6fa42258..480b101177b2 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 0ac7b38b0783..61dc210b0eeb 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index fa5643c48eb8..7f9015b0489a 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 3363a34e04e8..aec6677ffe4d 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index d97c39bba336..d80386698f2e 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index a316d600cd98..adcf996f9840 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 72649577de79..036dd7c2f259 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 ../../pom.xml diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index ea548ba7f35b..ea334423ac74 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/pom.xml b/dspace/pom.xml index da6820074a5d..ddea9bac0bae 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 ../pom.xml diff --git a/pom.xml b/pom.xml index eb1b3497aaa2..c8065bcbaf4f 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.7-SNAPSHOT + 7.6.7 DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -1032,69 +1032,69 @@ org.dspace dspace-api - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-api test-jar - 7.6.7-SNAPSHOT + 7.6.7 test org.dspace.modules additions - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-sword - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-swordv2 - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-oai - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-services - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-server-webapp test-jar - 7.6.7-SNAPSHOT + 7.6.7 test org.dspace dspace-rdf - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-iiif - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-server-webapp - 7.6.7-SNAPSHOT + 7.6.7 jar classes org.dspace dspace-server-webapp - 7.6.7-SNAPSHOT + 7.6.7 war @@ -1950,7 +1950,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-7_x + dspace-7.6.7 From 5d0ff98c68fb4dd5d5bf55a3995169a8c788562f Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 15:15:24 -0500 Subject: [PATCH 163/283] [maven-release-plugin] prepare for next development iteration --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 28 ++++++++++++++-------------- 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index a64a19fa391d..5c1d6f725d14 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index c3a4e2484859..6f18f0bef490 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 64612f9d5f4d..e2f9e613db2f 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 480b101177b2..46d342d8af38 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 61dc210b0eeb..78fdc0276a8c 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index 7f9015b0489a..2b3398106542 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index aec6677ffe4d..4e040ee12c85 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index d80386698f2e..f77204e7bdaa 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index adcf996f9840..23e1f49316b1 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 036dd7c2f259..6605e64e3606 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT ../../pom.xml diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index ea334423ac74..8042f7508b13 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.7 + 7.6.8-SNAPSHOT .. diff --git a/dspace/pom.xml b/dspace/pom.xml index ddea9bac0bae..e224a7ecaa55 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.8-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index c8065bcbaf4f..5fe3a04d2c97 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.7 + 7.6.8-SNAPSHOT DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -1032,69 +1032,69 @@ org.dspace dspace-api - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-api test-jar - 7.6.7 + 7.6.8-SNAPSHOT test org.dspace.modules additions - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-sword - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-swordv2 - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-oai - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-services - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-server-webapp test-jar - 7.6.7 + 7.6.8-SNAPSHOT test org.dspace dspace-rdf - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-iiif - 7.6.7 + 7.6.8-SNAPSHOT org.dspace dspace-server-webapp - 7.6.7 + 7.6.8-SNAPSHOT jar classes org.dspace dspace-server-webapp - 7.6.7 + 7.6.8-SNAPSHOT war @@ -1950,7 +1950,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-7.6.7 + dspace-7_x From c5d4927ac2c77392099394387aead0aa611ae0e9 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 15:29:28 -0500 Subject: [PATCH 164/283] Undo partial/flawed 7.6.7 release --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 26 +++++++++++++------------- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 5c1d6f725d14..4f4874d5d255 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index 6f18f0bef490..38dc845d0b1c 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index e2f9e613db2f..5ea46fc1db14 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 46d342d8af38..8c7a6fa42258 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 78fdc0276a8c..0ac7b38b0783 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index 2b3398106542..fa5643c48eb8 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 4e040ee12c85..3363a34e04e8 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index f77204e7bdaa..d97c39bba336 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index 23e1f49316b1..a316d600cd98 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 6605e64e3606..72649577de79 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT ../../pom.xml diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index 8042f7508b13..ea548ba7f35b 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT .. diff --git a/dspace/pom.xml b/dspace/pom.xml index e224a7ecaa55..da6820074a5d 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index 5fe3a04d2c97..eb1b3497aaa2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -1032,69 +1032,69 @@ org.dspace dspace-api - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-api test-jar - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT test org.dspace.modules additions - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-sword - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-swordv2 - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-oai - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-services - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-server-webapp test-jar - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT test org.dspace dspace-rdf - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-iiif - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT org.dspace dspace-server-webapp - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT jar classes org.dspace dspace-server-webapp - 7.6.8-SNAPSHOT + 7.6.7-SNAPSHOT war From 7b754e4326ca8152be33ce89544db93166dfa035 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 15:52:06 -0500 Subject: [PATCH 165/283] [maven-release-plugin] prepare release dspace-7.6.7 --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-rest/pom.xml | 4 ++-- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/rest/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 32 ++++++++++++++++---------------- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 4f4874d5d255..a64a19fa391d 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index 38dc845d0b1c..c3a4e2484859 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 5ea46fc1db14..64612f9d5f4d 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 8c7a6fa42258..480b101177b2 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-rest/pom.xml b/dspace-rest/pom.xml index f37cf04ecf27..f501de21f524 100644 --- a/dspace-rest/pom.xml +++ b/dspace-rest/pom.xml @@ -3,7 +3,7 @@ org.dspace dspace-rest war - 7.6.7-SNAPSHOT + 7.6.7 DSpace (Deprecated) REST Webapp DSpace RESTful Web Services API. NOTE: this REST API is DEPRECATED. Please consider using the REST API in the dspace-server-webapp instead! @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 0ac7b38b0783..61dc210b0eeb 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index fa5643c48eb8..7f9015b0489a 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 3363a34e04e8..aec6677ffe4d 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index d97c39bba336..d80386698f2e 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index a316d600cd98..adcf996f9840 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 72649577de79..036dd7c2f259 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 ../../pom.xml diff --git a/dspace/modules/rest/pom.xml b/dspace/modules/rest/pom.xml index 39d1973c31e1..470626505c4e 100644 --- a/dspace/modules/rest/pom.xml +++ b/dspace/modules/rest/pom.xml @@ -13,7 +13,7 @@ org.dspace modules - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index ea548ba7f35b..ea334423ac74 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/pom.xml b/dspace/pom.xml index da6820074a5d..ddea9bac0bae 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 ../pom.xml diff --git a/pom.xml b/pom.xml index eb1b3497aaa2..e54bd9ce3873 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.7-SNAPSHOT + 7.6.7 DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -876,14 +876,14 @@ org.dspace dspace-rest - 7.6.7-SNAPSHOT + 7.6.7 jar classes org.dspace dspace-rest - 7.6.7-SNAPSHOT + 7.6.7 war @@ -1032,69 +1032,69 @@ org.dspace dspace-api - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-api test-jar - 7.6.7-SNAPSHOT + 7.6.7 test org.dspace.modules additions - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-sword - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-swordv2 - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-oai - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-services - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-server-webapp test-jar - 7.6.7-SNAPSHOT + 7.6.7 test org.dspace dspace-rdf - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-iiif - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-server-webapp - 7.6.7-SNAPSHOT + 7.6.7 jar classes org.dspace dspace-server-webapp - 7.6.7-SNAPSHOT + 7.6.7 war @@ -1950,7 +1950,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-7_x + dspace-7.6.7 From ce1c00d00ad51a230367c3c52673cdc10b9ff152 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 15:55:36 -0500 Subject: [PATCH 166/283] [maven-release-plugin] rollback the release of dspace-7.6.7 --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 32 ++++++++++++++++---------------- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index a64a19fa391d..4f4874d5d255 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index c3a4e2484859..38dc845d0b1c 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 64612f9d5f4d..5ea46fc1db14 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 480b101177b2..8c7a6fa42258 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 61dc210b0eeb..0ac7b38b0783 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index 7f9015b0489a..fa5643c48eb8 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index aec6677ffe4d..3363a34e04e8 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index d80386698f2e..d97c39bba336 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index adcf996f9840..a316d600cd98 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 036dd7c2f259..72649577de79 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT ../../pom.xml diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index ea334423ac74..ea548ba7f35b 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace/pom.xml b/dspace/pom.xml index ddea9bac0bae..da6820074a5d 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index e54bd9ce3873..eb1b3497aaa2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.7 + 7.6.7-SNAPSHOT DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -876,14 +876,14 @@ org.dspace dspace-rest - 7.6.7 + 7.6.7-SNAPSHOT jar classes org.dspace dspace-rest - 7.6.7 + 7.6.7-SNAPSHOT war @@ -1032,69 +1032,69 @@ org.dspace dspace-api - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-api test-jar - 7.6.7 + 7.6.7-SNAPSHOT test org.dspace.modules additions - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-sword - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-swordv2 - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-oai - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-services - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-server-webapp test-jar - 7.6.7 + 7.6.7-SNAPSHOT test org.dspace dspace-rdf - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-iiif - 7.6.7 + 7.6.7-SNAPSHOT org.dspace dspace-server-webapp - 7.6.7 + 7.6.7-SNAPSHOT jar classes org.dspace dspace-server-webapp - 7.6.7 + 7.6.7-SNAPSHOT war @@ -1950,7 +1950,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-7.6.7 + dspace-7_x From 79eb174f1257d05c9d830ca3a95ec92898377c02 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 16:03:53 -0500 Subject: [PATCH 167/283] Undo improper versioning in old REST API. --- dspace-rest/pom.xml | 4 ++-- dspace/modules/rest/pom.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dspace-rest/pom.xml b/dspace-rest/pom.xml index f501de21f524..f37cf04ecf27 100644 --- a/dspace-rest/pom.xml +++ b/dspace-rest/pom.xml @@ -3,7 +3,7 @@ org.dspace dspace-rest war - 7.6.7 + 7.6.7-SNAPSHOT DSpace (Deprecated) REST Webapp DSpace RESTful Web Services API. NOTE: this REST API is DEPRECATED. Please consider using the REST API in the dspace-server-webapp instead! @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7 + 7.6.7-SNAPSHOT .. diff --git a/dspace/modules/rest/pom.xml b/dspace/modules/rest/pom.xml index 470626505c4e..39d1973c31e1 100644 --- a/dspace/modules/rest/pom.xml +++ b/dspace/modules/rest/pom.xml @@ -13,7 +13,7 @@ org.dspace modules - 7.6.7 + 7.6.7-SNAPSHOT .. From ef3524af202c1755925f94c2470351f920be351f Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 27 May 2026 16:14:05 -0500 Subject: [PATCH 168/283] [maven-release-plugin] prepare release dspace-7.6.7 --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-rest/pom.xml | 4 ++-- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/rest/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 32 ++++++++++++++++---------------- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 4f4874d5d255..a64a19fa391d 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index 38dc845d0b1c..c3a4e2484859 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 5ea46fc1db14..64612f9d5f4d 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 8c7a6fa42258..480b101177b2 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-rest/pom.xml b/dspace-rest/pom.xml index f37cf04ecf27..f501de21f524 100644 --- a/dspace-rest/pom.xml +++ b/dspace-rest/pom.xml @@ -3,7 +3,7 @@ org.dspace dspace-rest war - 7.6.7-SNAPSHOT + 7.6.7 DSpace (Deprecated) REST Webapp DSpace RESTful Web Services API. NOTE: this REST API is DEPRECATED. Please consider using the REST API in the dspace-server-webapp instead! @@ -12,7 +12,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 0ac7b38b0783..61dc210b0eeb 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index fa5643c48eb8..7f9015b0489a 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 3363a34e04e8..aec6677ffe4d 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index d97c39bba336..d80386698f2e 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index a316d600cd98..adcf996f9840 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index 72649577de79..036dd7c2f259 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 ../../pom.xml diff --git a/dspace/modules/rest/pom.xml b/dspace/modules/rest/pom.xml index 39d1973c31e1..470626505c4e 100644 --- a/dspace/modules/rest/pom.xml +++ b/dspace/modules/rest/pom.xml @@ -13,7 +13,7 @@ org.dspace modules - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index ea548ba7f35b..ea334423ac74 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -13,7 +13,7 @@ just adding new jar in the classloader modules org.dspace - 7.6.7-SNAPSHOT + 7.6.7 .. diff --git a/dspace/pom.xml b/dspace/pom.xml index da6820074a5d..ddea9bac0bae 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 7.6.7-SNAPSHOT + 7.6.7 ../pom.xml diff --git a/pom.xml b/pom.xml index eb1b3497aaa2..e54bd9ce3873 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 7.6.7-SNAPSHOT + 7.6.7 DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -876,14 +876,14 @@ org.dspace dspace-rest - 7.6.7-SNAPSHOT + 7.6.7 jar classes org.dspace dspace-rest - 7.6.7-SNAPSHOT + 7.6.7 war @@ -1032,69 +1032,69 @@ org.dspace dspace-api - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-api test-jar - 7.6.7-SNAPSHOT + 7.6.7 test org.dspace.modules additions - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-sword - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-swordv2 - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-oai - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-services - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-server-webapp test-jar - 7.6.7-SNAPSHOT + 7.6.7 test org.dspace dspace-rdf - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-iiif - 7.6.7-SNAPSHOT + 7.6.7 org.dspace dspace-server-webapp - 7.6.7-SNAPSHOT + 7.6.7 jar classes org.dspace dspace-server-webapp - 7.6.7-SNAPSHOT + 7.6.7 war @@ -1950,7 +1950,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-7_x + dspace-7.6.7 From 648627bebf4514a7cb96de8556fad8e8a64f5a66 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 28 May 2026 10:28:51 -0500 Subject: [PATCH 169/283] [maven-release-plugin] prepare for next development iteration --- dspace-api/pom.xml | 2 +- dspace-iiif/pom.xml | 2 +- dspace-oai/pom.xml | 2 +- dspace-rdf/pom.xml | 2 +- dspace-server-webapp/pom.xml | 2 +- dspace-services/pom.xml | 2 +- dspace-sword/pom.xml | 2 +- dspace-swordv2/pom.xml | 2 +- dspace/modules/additions/pom.xml | 2 +- dspace/modules/pom.xml | 2 +- dspace/modules/server-boot/pom.xml | 2 +- dspace/modules/server/pom.xml | 2 +- dspace/pom.xml | 2 +- pom.xml | 28 ++++++++++++++-------------- 14 files changed, 27 insertions(+), 27 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 261926c0e76c..57f374488313 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -12,7 +12,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace-iiif/pom.xml b/dspace-iiif/pom.xml index 15f509f778ba..e37386022d02 100644 --- a/dspace-iiif/pom.xml +++ b/dspace-iiif/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace-oai/pom.xml b/dspace-oai/pom.xml index 262249bc145c..9ea51dfa73fe 100644 --- a/dspace-oai/pom.xml +++ b/dspace-oai/pom.xml @@ -8,7 +8,7 @@ dspace-parent org.dspace - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index db24b3995688..961b13ba985b 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 3f226327fb94..63d8908a9a03 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -14,7 +14,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace-services/pom.xml b/dspace-services/pom.xml index cc0af05c37a5..5682dd80e763 100644 --- a/dspace-services/pom.xml +++ b/dspace-services/pom.xml @@ -9,7 +9,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index ad02d31f1325..fc5e7eff0348 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -15,7 +15,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace-swordv2/pom.xml b/dspace-swordv2/pom.xml index 27c4bee8e77c..b2f663d72988 100644 --- a/dspace-swordv2/pom.xml +++ b/dspace-swordv2/pom.xml @@ -13,7 +13,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace/modules/additions/pom.xml b/dspace/modules/additions/pom.xml index f094b1dfcaf1..6544f0d9b5ea 100644 --- a/dspace/modules/additions/pom.xml +++ b/dspace/modules/additions/pom.xml @@ -17,7 +17,7 @@ org.dspace modules - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace/modules/pom.xml b/dspace/modules/pom.xml index b41455e53e0d..51774d11ec01 100644 --- a/dspace/modules/pom.xml +++ b/dspace/modules/pom.xml @@ -11,7 +11,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT ../../pom.xml diff --git a/dspace/modules/server-boot/pom.xml b/dspace/modules/server-boot/pom.xml index 5e4b7fe9611c..02089020278f 100644 --- a/dspace/modules/server-boot/pom.xml +++ b/dspace/modules/server-boot/pom.xml @@ -11,7 +11,7 @@ modules org.dspace - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace/modules/server/pom.xml b/dspace/modules/server/pom.xml index 6523392f76fe..2c3aa51352c9 100644 --- a/dspace/modules/server/pom.xml +++ b/dspace/modules/server/pom.xml @@ -7,7 +7,7 @@ modules org.dspace - 8.4 + 8.5-SNAPSHOT .. diff --git a/dspace/pom.xml b/dspace/pom.xml index 7492408e81a4..aa6b3e48fc1a 100644 --- a/dspace/pom.xml +++ b/dspace/pom.xml @@ -16,7 +16,7 @@ org.dspace dspace-parent - 8.4 + 8.5-SNAPSHOT ../pom.xml diff --git a/pom.xml b/pom.xml index aaf17ba9b1e2..063eeb1b694e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.dspace dspace-parent pom - 8.4 + 8.5-SNAPSHOT DSpace Parent Project DSpace open source software is a turnkey institutional repository application. @@ -1026,68 +1026,68 @@ org.dspace dspace-api - 8.4 + 8.5-SNAPSHOT org.dspace dspace-api test-jar - 8.4 + 8.5-SNAPSHOT test org.dspace.modules additions - 8.4 + 8.5-SNAPSHOT org.dspace.modules server classes - 8.4 + 8.5-SNAPSHOT org.dspace dspace-sword - 8.4 + 8.5-SNAPSHOT org.dspace dspace-swordv2 - 8.4 + 8.5-SNAPSHOT org.dspace dspace-oai - 8.4 + 8.5-SNAPSHOT org.dspace dspace-services - 8.4 + 8.5-SNAPSHOT org.dspace dspace-server-webapp test-jar - 8.4 + 8.5-SNAPSHOT test org.dspace dspace-rdf - 8.4 + 8.5-SNAPSHOT org.dspace dspace-iiif - 8.4 + 8.5-SNAPSHOT org.dspace dspace-server-webapp - 8.4 + 8.5-SNAPSHOT @@ -1943,7 +1943,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-8.4 + dspace-8_x From 261fd695b27d3ea9c007325d5cb27c1a257ab234 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 03:53:55 +0000 Subject: [PATCH 170/283] Bump org.apache.commons:commons-configuration2 Bumps the apache-commons group with 1 update: org.apache.commons:commons-configuration2. Updates `org.apache.commons:commons-configuration2` from 2.15.0 to 2.15.1 --- updated-dependencies: - dependency-name: org.apache.commons:commons-configuration2 dependency-version: 2.15.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: apache-commons ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 063eeb1b694e..a002ed6f9341 100644 --- a/pom.xml +++ b/pom.xml @@ -1519,7 +1519,7 @@ org.apache.commons commons-configuration2 - 2.15.0 + 2.15.1 org.apache.commons From 909700ebe01948d17a582b62649c10edb1e7e30d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 03:55:05 +0000 Subject: [PATCH 171/283] Bump dnsjava:dnsjava from 3.6.4 to 3.6.5 Bumps [dnsjava:dnsjava](https://github.com/dnsjava/dnsjava) from 3.6.4 to 3.6.5. - [Release notes](https://github.com/dnsjava/dnsjava/releases) - [Changelog](https://github.com/dnsjava/dnsjava/blob/master/Changelog) - [Commits](https://github.com/dnsjava/dnsjava/commits) --- updated-dependencies: - dependency-name: dnsjava:dnsjava dependency-version: 3.6.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 57f374488313..7c0e5169d35f 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -632,7 +632,7 @@ dnsjava dnsjava - 3.6.4 + 3.6.5 From 2c13746e429174619d81159908b72dcebd62b1bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 03:56:00 +0000 Subject: [PATCH 172/283] Bump log4j.version from 2.25.4 to 2.26.0 Bumps `log4j.version` from 2.25.4 to 2.26.0. Updates `org.apache.logging.log4j:log4j-api` from 2.25.4 to 2.26.0 Updates `org.apache.logging.log4j:log4j-core` from 2.25.4 to 2.26.0 Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.25.4 to 2.26.0 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-version: 2.26.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.apache.logging.log4j:log4j-core dependency-version: 2.26.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl dependency-version: 2.26.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 063eeb1b694e..8dc3997c07f9 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 1.1.1 9.4.58.v20250814 - 2.25.4 + 2.26.0 3.0.7 1.19.0 2.0.17 From 63a72f2473756081655285f1c57be614051d7300 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 03:56:19 +0000 Subject: [PATCH 173/283] Bump tika.version from 3.3.0 to 3.3.1 Bumps `tika.version` from 3.3.0 to 3.3.1. Updates `org.apache.tika:tika-core` from 3.3.0 to 3.3.1 - [Changelog](https://github.com/apache/tika/blob/3.3.1/CHANGES.txt) - [Commits](https://github.com/apache/tika/compare/3.3.0...3.3.1) Updates `org.apache.tika:tika-parsers-standard-package` from 3.3.0 to 3.3.1 --- updated-dependencies: - dependency-name: org.apache.tika:tika-core dependency-version: 3.3.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.tika:tika-parsers-standard-package dependency-version: 3.3.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 063eeb1b694e..e2c567c3711b 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 3.0.7 1.19.0 2.0.17 - 3.3.0 + 3.3.1 From 9a20a305268339009ef00186cab8f4b8d7c38cae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 03:56:47 +0000 Subject: [PATCH 174/283] Bump xom:xom from 1.4.1 to 1.4.4 Bumps [xom:xom](https://github.com/elharo/xom) from 1.4.1 to 1.4.4. - [Release notes](https://github.com/elharo/xom/releases) - [Commits](https://github.com/elharo/xom/compare/v1.4.1...v1.4.4) --- updated-dependencies: - dependency-name: xom:xom dependency-version: 1.4.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- dspace-sword/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index fc5e7eff0348..7053be471ec5 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -72,7 +72,7 @@ xom xom - 1.4.1 + 1.4.4 diff --git a/pom.xml b/pom.xml index 063eeb1b694e..07625ee89993 100644 --- a/pom.xml +++ b/pom.xml @@ -1801,7 +1801,7 @@ xom xom - 1.4.1 + 1.4.4 xml-apis From d74decf2aab0fecf967a138799ae9a8c9fa8121c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 05:01:05 +0000 Subject: [PATCH 175/283] Bump toshimaru/auto-author-assign from 3.0.1 to 3.0.2 Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 3.0.1 to 3.0.2. - [Release notes](https://github.com/toshimaru/auto-author-assign/releases) - [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md) - [Commits](https://github.com/toshimaru/auto-author-assign/compare/v3.0.1...v3.0.2) --- updated-dependencies: - dependency-name: toshimaru/auto-author-assign dependency-version: 3.0.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/pull_request_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml index e2b6e8ba9c2c..2cf1252334cd 100644 --- a/.github/workflows/pull_request_opened.yml +++ b/.github/workflows/pull_request_opened.yml @@ -21,4 +21,4 @@ jobs: # Assign the PR to whomever created it. This is useful for visualizing assignments on project boards # See https://github.com/toshimaru/auto-author-assign - name: Assign PR to creator - uses: toshimaru/auto-author-assign@v3.0.1 + uses: toshimaru/auto-author-assign@v3.0.2 From e3707d1b9bfd3e4c2c1b3579a136ede6d7ea9149 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 05:02:39 +0000 Subject: [PATCH 176/283] Bump actions/add-to-project from 1.0.2 to 2.0.0 Bumps [actions/add-to-project](https://github.com/actions/add-to-project) from 1.0.2 to 2.0.0. - [Release notes](https://github.com/actions/add-to-project/releases) - [Commits](https://github.com/actions/add-to-project/compare/v1.0.2...v2.0.0) --- updated-dependencies: - dependency-name: actions/add-to-project dependency-version: 2.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/issue_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_opened.yml b/.github/workflows/issue_opened.yml index c8c421d98f47..382093bdc1b0 100644 --- a/.github/workflows/issue_opened.yml +++ b/.github/workflows/issue_opened.yml @@ -16,7 +16,7 @@ jobs: # Only add to project board if issue is flagged as "needs triage" or has no labels # NOTE: By default we flag new issues as "needs triage" in our issue template if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') - uses: actions/add-to-project@v1.0.2 + uses: actions/add-to-project@v2.0.0 # Note, the authentication token below is an ORG level Secret. # It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token From b4c1ad45edb19339a9c9ccb1743ea1d48711d8b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 20:58:24 +0000 Subject: [PATCH 177/283] Bump the build-tools group across 1 directory with 4 updates Bumps the build-tools group with 4 updates in the / directory: [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer), [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire), [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) and [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin). Updates `org.apache.maven.plugins:maven-enforcer-plugin` from 3.6.2 to 3.6.3 - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.6.2...enforcer-3.6.3) Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.5 to 3.5.6 - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.5...surefire-3.5.6) Updates `org.apache.maven.plugins:maven-failsafe-plugin` from 3.5.5 to 3.5.6 - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.5...surefire-3.5.6) Updates `org.apache.maven.plugins:maven-dependency-plugin` from 3.10.0 to 3.11.0 - [Release notes](https://github.com/apache/maven-dependency-plugin/releases) - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.10.0...maven-dependency-plugin-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-version: 3.6.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-version: 3.5.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-failsafe-plugin dependency-version: 3.5.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-version: 3.11.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 063eeb1b694e..0964608f601c 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.6.2 + 3.6.3 enforce-java @@ -220,7 +220,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.5 + 3.5.6 @@ -247,7 +247,7 @@ maven-failsafe-plugin - 3.5.5 + 3.5.6 @@ -360,7 +360,7 @@ org.apache.maven.plugins maven-dependency-plugin - 3.10.0 + 3.11.0 org.apache.maven.plugins From a129f5b2fc221f7794466f0e24ace7b804317702 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 9 Jun 2026 15:59:15 -0500 Subject: [PATCH 178/283] Update issue_opened.yml --- .github/workflows/issue_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue_opened.yml b/.github/workflows/issue_opened.yml index 382093bdc1b0..99dd91c74e31 100644 --- a/.github/workflows/issue_opened.yml +++ b/.github/workflows/issue_opened.yml @@ -16,7 +16,7 @@ jobs: # Only add to project board if issue is flagged as "needs triage" or has no labels # NOTE: By default we flag new issues as "needs triage" in our issue template if: (contains(github.event.issue.labels.*.name, 'needs triage') || join(github.event.issue.labels.*.name) == '') - uses: actions/add-to-project@v2.0.0 + uses: actions/add-to-project@v2 # Note, the authentication token below is an ORG level Secret. # It must be created/recreated manually via a personal access token with admin:org, project, public_repo permissions # See: https://docs.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token From 5d4da9dc68127893fd4a22aa9b5e0b19f463dd55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:35:41 +0000 Subject: [PATCH 179/283] Bump org.xmlunit:xmlunit-core in the test-tools group Bumps the test-tools group with 1 update: [org.xmlunit:xmlunit-core](https://github.com/xmlunit/xmlunit). Updates `org.xmlunit:xmlunit-core` from 2.11.0 to 2.12.0 - [Release notes](https://github.com/xmlunit/xmlunit/releases) - [Changelog](https://github.com/xmlunit/xmlunit/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/xmlunit/xmlunit/compare/v2.11.0...v2.12.0) --- updated-dependencies: - dependency-name: org.xmlunit:xmlunit-core dependency-version: 2.12.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 57f374488313..e012fd14606f 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -790,7 +790,7 @@ org.xmlunit xmlunit-core - 2.11.0 + 2.12.0 test From e7f3a7d557a962d524985763b829e4496a82151a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:37:43 +0000 Subject: [PATCH 180/283] Bump jaxen:jaxen from 2.0.1 to 2.0.5 Bumps [jaxen:jaxen](https://github.com/jaxen-xpath/jaxen) from 2.0.1 to 2.0.5. - [Release notes](https://github.com/jaxen-xpath/jaxen/releases) - [Commits](https://github.com/jaxen-xpath/jaxen/compare/v2.0.1...v2.0.5) --- updated-dependencies: - dependency-name: jaxen:jaxen dependency-version: 2.0.5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 063eeb1b694e..900d1fd66610 100644 --- a/pom.xml +++ b/pom.xml @@ -1609,7 +1609,7 @@ jaxen jaxen - 2.0.1 + 2.0.5 org.jdom From 003c9f42e28edc3e2b0d0614f473c92ccb3bfbe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 16:20:21 +0000 Subject: [PATCH 181/283] Bump slf4j.version from 2.0.17 to 2.0.18 Bumps `slf4j.version` from 2.0.17 to 2.0.18. Updates `org.slf4j:jcl-over-slf4j` from 2.0.17 to 2.0.18 Updates `org.slf4j:slf4j-api` from 2.0.17 to 2.0.18 --- updated-dependencies: - dependency-name: org.slf4j:jcl-over-slf4j dependency-version: 2.0.18 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-api dependency-version: 2.0.18 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 06abf1923560..87908c46c0b9 100644 --- a/pom.xml +++ b/pom.xml @@ -43,7 +43,7 @@ 2.26.0 3.0.7 1.19.0 - 2.0.17 + 2.0.18 3.3.1 - 2.21.3 - 2.21 + 2.22.0 + 2.22 2.1.1 4.0.5 4.0.8 From ecb43b79798061c2bfc14e5625121ebbff15755b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jun 2026 20:11:10 +0000 Subject: [PATCH 183/283] Bump org.glassfish.jaxb:jaxb-runtime in the jakarta group Bumps the jakarta group with 1 update: org.glassfish.jaxb:jaxb-runtime. Updates `org.glassfish.jaxb:jaxb-runtime` from 4.0.8 to 4.0.9 --- updated-dependencies: - dependency-name: org.glassfish.jaxb:jaxb-runtime dependency-version: 4.0.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: jakarta ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0da3ac18ae39..cd703cf8f720 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,7 @@ 2.21 2.1.1 4.0.5 - 4.0.8 + 4.0.9 1.1.1 9.4.58.v20250814 From 94c2664c1e236d2256b189b71fbc58641ff6f6c7 Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Sat, 20 Jun 2026 08:18:12 +0200 Subject: [PATCH 184/283] Exclude apache5-client from AWS SDK s3 to fix dependency convergence The AWS SDK pulls in apache5-client (Apache HttpClient 5) transitively from v2.46.x onward, which drags in conflicting httpcore5 versions (5.4 and 5.4.2) and breaks the maven-enforcer DependencyConvergence rule. DSpace uses the CRT based client (S3AsyncClient.crtBuilder()), so this HTTP client is unused; apache-client and netty-nio-client are already excluded for the same reason. Extend the exclusion list to apache5-client. The exclusion is a no-op at the current 2.43.2 and lets the Dependabot amazon-s3 bumps to 2.46.3 rebase cleanly and pass CI. Fixes #12690 --- dspace-api/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 5fa8be32a18d..ec9987084169 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -730,6 +730,14 @@ software.amazon.awssdk apache-client + + + software.amazon.awssdk + apache5-client + From 4e64074c2d677cb13e9c9d5849a082c7b332d291 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Fri, 12 Jun 2026 13:03:17 -0500 Subject: [PATCH 185/283] Update byEmail search with same PreAuthorize as other EPerson search endpoints. Update IT to expect 401 instead of 204. (cherry picked from commit 80e5d5def9fb4d231d6f46a2a3aa58ed9b342fea) --- .../org/dspace/app/rest/repository/EPersonRestRepository.java | 1 + .../test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java index ce1edc1eed92..9f9b5d1d5052 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/EPersonRestRepository.java @@ -253,6 +253,7 @@ public Page findAll(Context context, Pageable pageable) { * is the *required* email address * @return a Page of EPersonRest instances matching the user query */ + @PreAuthorize("hasAuthority('ADMIN') || hasAuthority('MANAGE_ACCESS_GROUP')") @SearchRestMethod(name = "byEmail") public EPersonRest findByEmail(@Parameter(value = "email", required = true) String email) { EPerson eperson = null; diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java index beeef03aec47..5e84fefd31a4 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/EPersonRestRepositoryIT.java @@ -197,7 +197,7 @@ public void createAnonAccessDeniedTest() throws Exception { .andExpect(status().isUnauthorized()); getClient().perform(get("/api/eperson/epersons/search/byEmail") .param("email", data.getEmail())) - .andExpect(status().isNoContent()); + .andExpect(status().isUnauthorized()); } @Test From 9f063603d73eb8c82fc8b9403242bf38da1e9ed2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jun 2026 16:59:05 +0000 Subject: [PATCH 186/283] Bump the amazon-s3 group across 1 directory with 2 updates Bumps the amazon-s3 group with 2 updates in the / directory: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.43.2 to 2.46.10 Updates `software.amazon.awssdk.crt:aws-crt` from 0.45.2 to 0.47.0 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.45.2...v0.47.0) --- updated-dependencies: - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.46.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.44.12 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index ec9987084169..970580c52641 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -720,7 +720,7 @@ software.amazon.awssdk s3 - 2.43.2 + 2.46.10 software.amazon.awssdk @@ -744,7 +744,7 @@ software.amazon.awssdk.crt aws-crt - 0.45.2 + 0.47.0 ${basedir}/.. - 3.4.1 + 3.4.2 From 195487ef2e9e3f7b14a5158161d4b3281e9997ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:35:15 +0000 Subject: [PATCH 193/283] Bump the build-tools group with 4 updates Bumps the build-tools group with 4 updates: [com.github.spotbugs:spotbugs](https://github.com/spotbugs/spotbugs), [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin), [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin) and [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco). Updates `com.github.spotbugs:spotbugs` from 4.9.8 to 4.10.2 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.8...4.10.2) Updates `com.github.spotbugs:spotbugs-maven-plugin` from 4.9.8.3 to 4.10.2.0 - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.9.8.3...spotbugs-maven-plugin-4.10.2.0) Updates `org.sonatype.central:central-publishing-maven-plugin` from 0.10.0 to 0.11.0 - [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits) Updates `org.jacoco:jacoco-maven-plugin` from 0.8.14 to 0.8.15 - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.14...v0.8.15) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs dependency-version: 4.10.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.10.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.sonatype.central:central-publishing-maven-plugin dependency-version: 0.11.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: build-tools - dependency-name: org.jacoco:jacoco-maven-plugin dependency-version: 0.8.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 29dc97249a9a..84fb76d20cde 100644 --- a/pom.xml +++ b/pom.xml @@ -315,7 +315,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.9.8.3 + 4.10.2.0 Max Low @@ -325,7 +325,7 @@ com.github.spotbugs spotbugs - 4.9.8 + 4.10.2 @@ -377,7 +377,7 @@ org.sonatype.central central-publishing-maven-plugin - 0.10.0 + 0.11.0 @@ -417,7 +417,7 @@ org.jacoco jacoco-maven-plugin - 0.8.14 + 0.8.15 From 144a027ce17567a117dd713f47bc4767ef10e924 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:35:49 +0000 Subject: [PATCH 194/283] Bump the amazon-s3 group with 2 updates Bumps the amazon-s3 group with 2 updates: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.46.10 to 2.46.17 Updates `software.amazon.awssdk.crt:aws-crt` from 0.47.0 to 0.47.1 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.47.0...v0.47.1) --- updated-dependencies: - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.46.17 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.47.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 970580c52641..bd48c2f78209 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -720,7 +720,7 @@ software.amazon.awssdk s3 - 2.46.10 + 2.46.17 software.amazon.awssdk @@ -744,7 +744,7 @@ software.amazon.awssdk.crt aws-crt - 0.47.0 + 0.47.1 6.4.10.Final - 8.0.3.Final + 8.0.4.Final 42.7.11 10.22.0 8.11.4 From 10643722c2f4583e5f503a54d0216e2d97e69dbe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:39:11 +0000 Subject: [PATCH 197/283] Bump the spring group with 26 updates Bumps the spring group with 26 updates: | Package | From | To | | --- | --- | --- | | [org.springframework:spring-orm](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-core](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-beans](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-aop](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-context](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-context-support](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-tx](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-jdbc](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-web](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-webmvc](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-expression](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework:spring-test](https://github.com/spring-projects/spring-framework) | `6.2.18` | `6.2.19` | | [org.springframework.ldap:spring-ldap-core](https://github.com/spring-projects/spring-ldap) | `3.3.7` | `3.3.8` | | [org.springframework.boot:spring-boot-starter-test](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-tomcat](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-maven-plugin](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-cache](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-thymeleaf](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-web](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-data-rest](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-security](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-aop](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-actuator](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.boot:spring-boot-starter-log4j2](https://github.com/spring-projects/spring-boot) | `3.5.14` | `3.5.15` | | [org.springframework.security:spring-security-test](https://github.com/spring-projects/spring-security) | `6.5.10` | `6.5.11` | Updates `org.springframework:spring-orm` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-core` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-beans` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-aop` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-context` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-context-support` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-tx` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-jdbc` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-web` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-webmvc` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-expression` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-test` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-core` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-beans` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-aop` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-context` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-context-support` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework.ldap:spring-ldap-core` from 3.3.7 to 3.3.8 - [Release notes](https://github.com/spring-projects/spring-ldap/releases) - [Changelog](https://github.com/spring-projects/spring-ldap/blob/main/changelog.txt) - [Commits](https://github.com/spring-projects/spring-ldap/compare/3.3.7...3.3.8) Updates `org.springframework:spring-tx` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-jdbc` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-web` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-webmvc` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-expression` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework:spring-test` from 6.2.18 to 6.2.19 - [Release notes](https://github.com/spring-projects/spring-framework/releases) - [Commits](https://github.com/spring-projects/spring-framework/compare/v6.2.18...v6.2.19) Updates `org.springframework.boot:spring-boot-starter-test` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-tomcat` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-cache` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-thymeleaf` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-web` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-data-rest` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-security` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-aop` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-actuator` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-log4j2` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-tomcat` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.security:spring-security-test` from 6.5.10 to 6.5.11 - [Release notes](https://github.com/spring-projects/spring-security/releases) - [Changelog](https://github.com/spring-projects/spring-security/blob/main/RELEASE.adoc) - [Commits](https://github.com/spring-projects/spring-security/compare/6.5.10...6.5.11) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-cache` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-thymeleaf` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-web` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-data-rest` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-security` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-aop` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-actuator` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) Updates `org.springframework.boot:spring-boot-starter-log4j2` from 3.5.14 to 3.5.15 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.14...v3.5.15) --- updated-dependencies: - dependency-name: org.springframework:spring-orm dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-core dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-beans dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-aop dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-context dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-context-support dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-tx dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-jdbc dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-web dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-webmvc dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-expression dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-test dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-core dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-beans dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-aop dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-context dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-context-support dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.ldap:spring-ldap-core dependency-version: 3.3.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-tx dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-jdbc dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-web dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-webmvc dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-expression dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework:spring-test dependency-version: 6.2.19 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-test dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-tomcat dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-version: 3.5.15 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-cache dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-thymeleaf dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-web dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-data-rest dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-security dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-aop dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-actuator dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-log4j2 dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-tomcat dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.security:spring-security-test dependency-version: 6.5.11 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-version: 3.5.15 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-cache dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-thymeleaf dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-web dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-data-rest dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-security dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-aop dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-actuator dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-log4j2 dependency-version: 3.5.15 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring ... Signed-off-by: dependabot[bot] --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 29dc97249a9a..e24ecf582320 100644 --- a/pom.xml +++ b/pom.xml @@ -19,10 +19,10 @@ 17 - 6.2.18 - 3.3.7 - 3.5.14 - 6.5.10 + 6.2.19 + 3.3.8 + 3.5.15 + 6.5.11 6.4.10.Final 8.0.3.Final 42.7.11 From 852adcc12eb93a9590a10ed7e48f28d6b2e98408 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:40:09 +0000 Subject: [PATCH 198/283] Bump jersey.version from 3.1.11 to 3.1.12 Bumps `jersey.version` from 3.1.11 to 3.1.12. Updates `org.glassfish.jersey.core:jersey-client` from 3.1.11 to 3.1.12 Updates `org.glassfish.jersey.inject:jersey-hk2` from 3.1.11 to 3.1.12 --- updated-dependencies: - dependency-name: org.glassfish.jersey.core:jersey-client dependency-version: 3.1.12 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.glassfish.jersey.inject:jersey-hk2 dependency-version: 3.1.12 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 29dc97249a9a..bcfa49485d5b 100644 --- a/pom.xml +++ b/pom.xml @@ -51,7 +51,7 @@ 1.81 8.0.1 - 3.1.11 + 3.1.12 2.10.0 From e81952631f10f66e53d73c208e1f8234f06861ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:40:21 +0000 Subject: [PATCH 199/283] Bump jaxen:jaxen from 2.0.5 to 2.0.6 Bumps [jaxen:jaxen](https://github.com/jaxen-xpath/jaxen) from 2.0.5 to 2.0.6. - [Release notes](https://github.com/jaxen-xpath/jaxen/releases) - [Commits](https://github.com/jaxen-xpath/jaxen/compare/v2.0.5...v2.0.6) --- updated-dependencies: - dependency-name: jaxen:jaxen dependency-version: 2.0.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 29dc97249a9a..7dc9526900a6 100644 --- a/pom.xml +++ b/pom.xml @@ -1609,7 +1609,7 @@ jaxen jaxen - 2.0.5 + 2.0.6 org.jdom From e3192895f3db9c9b14dcf51c9224629fde6187a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:41:08 +0000 Subject: [PATCH 200/283] Bump actions/checkout from 6 to 7 in the github-actions group Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 6 to 7 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 4 ++-- .github/workflows/codescan.yml | 2 +- .github/workflows/docker.yml | 2 +- .github/workflows/port_merged_pull_request.yml | 2 +- .github/workflows/reusable-docker-build.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b14043c94b89..ac3dcba4435b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout codebase - uses: actions/checkout@v6 + uses: actions/checkout@v7 # https://github.com/actions/setup-java - name: Install JDK ${{ matrix.java }} @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 # Download artifacts from previous 'tests' job - name: Download coverage artifacts diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index 90d79f9bfd60..ed9a6bfbb408 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -35,7 +35,7 @@ jobs: steps: # https://github.com/actions/checkout - name: Checkout repository - uses: actions/checkout@v6 + uses: actions/checkout@v7 # https://github.com/actions/setup-java - name: Install JDK diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5732a22d8277..4f507b66d088 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -183,7 +183,7 @@ jobs: steps: # Checkout our codebase (to get access to Docker Compose scripts) - name: Checkout codebase - uses: actions/checkout@v6 + uses: actions/checkout@v7 # Download Docker image artifacts (which were just built by reusable-docker-build.yml) - name: Download Docker image artifacts uses: actions/download-artifact@v8 diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml index 676ad45ba263..52e06fcd8671 100644 --- a/.github/workflows/port_merged_pull_request.yml +++ b/.github/workflows/port_merged_pull_request.yml @@ -23,7 +23,7 @@ jobs: if: github.event.pull_request.merged steps: # Checkout code - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 # Port PR to other branch (ONLY if labeled with "port to") # See https://github.com/korthout/backport-action - name: Create backport pull requests diff --git a/.github/workflows/reusable-docker-build.yml b/.github/workflows/reusable-docker-build.yml index 768adb8f1602..8099760edcd6 100644 --- a/.github/workflows/reusable-docker-build.yml +++ b/.github/workflows/reusable-docker-build.yml @@ -109,7 +109,7 @@ jobs: # https://github.com/actions/checkout - name: Checkout codebase - uses: actions/checkout@v6 + uses: actions/checkout@v7 # https://github.com/docker/login-action # NOTE: This login occurs for BOTH non-PRs or PRs. PRs *must* also login to access private images from GHCR From 055047b4be5e687167eb9e6889e548b955fac099 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:41:13 +0000 Subject: [PATCH 201/283] Bump xom:xom from 1.4.4 to 1.4.6 Bumps [xom:xom](https://github.com/elharo/xom) from 1.4.4 to 1.4.6. - [Release notes](https://github.com/elharo/xom/releases) - [Commits](https://github.com/elharo/xom/compare/v1.4.4...v1.4.6) --- updated-dependencies: - dependency-name: xom:xom dependency-version: 1.4.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- dspace-sword/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-sword/pom.xml b/dspace-sword/pom.xml index 7053be471ec5..dd68175f7904 100644 --- a/dspace-sword/pom.xml +++ b/dspace-sword/pom.xml @@ -72,7 +72,7 @@ xom xom - 1.4.4 + 1.4.6 diff --git a/pom.xml b/pom.xml index 29dc97249a9a..9572af1d2fe5 100644 --- a/pom.xml +++ b/pom.xml @@ -1801,7 +1801,7 @@ xom xom - 1.4.4 + 1.4.6 xml-apis From ac58e53ece8aa9f7e2a0bcd84222a3e2633e5bcc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Jul 2026 02:41:46 +0000 Subject: [PATCH 202/283] Bump toshimaru/auto-author-assign from 3.0.2 to 3.0.3 Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/toshimaru/auto-author-assign/releases) - [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md) - [Commits](https://github.com/toshimaru/auto-author-assign/compare/v3.0.2...v3.0.3) --- updated-dependencies: - dependency-name: toshimaru/auto-author-assign dependency-version: 3.0.3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/pull_request_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml index 2cf1252334cd..7e7efc09a997 100644 --- a/.github/workflows/pull_request_opened.yml +++ b/.github/workflows/pull_request_opened.yml @@ -21,4 +21,4 @@ jobs: # Assign the PR to whomever created it. This is useful for visualizing assignments on project boards # See https://github.com/toshimaru/auto-author-assign - name: Assign PR to creator - uses: toshimaru/auto-author-assign@v3.0.2 + uses: toshimaru/auto-author-assign@v3.0.3 From af65ee6b262d83eb2b24b3309692e609b2a98430 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jul 2026 20:08:13 +0000 Subject: [PATCH 203/283] Bump korthout/backport-action from 4 to 4.5.2 Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 4 to 4.5.2. - [Release notes](https://github.com/korthout/backport-action/releases) - [Commits](https://github.com/korthout/backport-action/compare/v4...v4.5.2) --- updated-dependencies: - dependency-name: korthout/backport-action dependency-version: 4.5.2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/port_merged_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml index 52e06fcd8671..2e14bd8a404f 100644 --- a/.github/workflows/port_merged_pull_request.yml +++ b/.github/workflows/port_merged_pull_request.yml @@ -27,7 +27,7 @@ jobs: # Port PR to other branch (ONLY if labeled with "port to") # See https://github.com/korthout/backport-action - name: Create backport pull requests - uses: korthout/backport-action@v4 + uses: korthout/backport-action@v4.5.2 with: # Trigger based on a "port to [branch]" label on PR # (This label must specify the branch name to port to) From cb5e3404fe7943fad280287dded972dbc1c73d6e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 11 Jun 2026 14:18:56 -0500 Subject: [PATCH 204/283] Require authentication before you can use the externalsources endpoints. --- .../org/dspace/app/rest/ExternalSourcesRestController.java | 3 +++ .../app/rest/repository/ExternalSourceRestRepository.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/ExternalSourcesRestController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/ExternalSourcesRestController.java index 357ea409c0f6..0c8862527ea7 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/ExternalSourcesRestController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/ExternalSourcesRestController.java @@ -17,6 +17,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.web.PagedResourcesAssembler; import org.springframework.hateoas.PagedModel; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -54,6 +55,7 @@ public class ExternalSourcesRestController { * @return A paginated list of ExternalSourceEntryResource objects that comply with the params */ @RequestMapping(method = RequestMethod.GET, value = "/entries") + @PreAuthorize("hasAuthority('AUTHENTICATED')") public PagedModel getExternalSourceEntries( @PathVariable("externalSourceName") String externalSourceName, @RequestParam(name = "query") String query, @@ -81,6 +83,7 @@ public PagedModel getExternalSourceEntries( * @return An ExternalSourceEntryResource that complies with the above params */ @RequestMapping(method = RequestMethod.GET, value = "/entryValues/{entryId}") + @PreAuthorize("hasAuthority('AUTHENTICATED')") public ExternalSourceEntryResource getExternalSourceEntryValue(@PathVariable("externalSourceName") String externalSourceName, @PathVariable("entryId") String entryId) { diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java index 736261cd263b..a19630579c00 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ExternalSourceRestRepository.java @@ -82,7 +82,7 @@ public Page getExternalSourceEntries(String externalSou } @Override - @PreAuthorize("permitAll()") + @PreAuthorize("hasAuthority('AUTHENTICATED')") public ExternalSourceRest findOne(Context context, String externalSourceName) { ExternalDataProvider externalDataProvider = externalDataService.getExternalDataProvider(externalSourceName); if (externalDataProvider == null) { @@ -93,7 +93,7 @@ public ExternalSourceRest findOne(Context context, String externalSourceName) { } @Override - @PreAuthorize("permitAll()") + @PreAuthorize("hasAuthority('AUTHENTICATED')") public Page findAll(Context context, Pageable pageable) { List externalSources = externalDataService.getExternalDataProviders(); return converter.toRestPage(externalSources, pageable, utils.obtainProjection()); @@ -107,7 +107,7 @@ public Page findAll(Context context, Pageable pageable) { * @param entityType Entity type label * @return */ - @PreAuthorize("permitAll()") + @PreAuthorize("hasAuthority('AUTHENTICATED')") @SearchRestMethod(name = "findByEntityType") public Page findByEntityType(Context context, Pageable pageable, @Parameter(required = true, value = "entityType") String entityType) { From 72a1c67ecb1719ad9ca2e68d26da818742d94f9e Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 11 Jun 2026 15:38:51 -0500 Subject: [PATCH 205/283] Update ITs to authenticate. Add ITs for anonymous user checks. --- .../rest/ExternalSourcesRestControllerIT.java | 78 +++++++++++++++---- .../OpenaireFundingExternalSourcesIT.java | 31 ++++++-- .../app/rest/OrcidExternalSourcesIT.java | 31 ++++++-- 3 files changed, 110 insertions(+), 30 deletions(-) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java index cf9d91b84b8b..f75d020a2e93 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ExternalSourcesRestControllerIT.java @@ -26,6 +26,7 @@ import org.dspace.external.provider.ExternalDataProvider; import org.dspace.external.service.ExternalDataService; import org.hamcrest.Matchers; +import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -34,9 +35,19 @@ public class ExternalSourcesRestControllerIT extends AbstractControllerIntegrati @Autowired private ExternalDataService externalDataService; + String token; + + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + // All tests just require basic authentication privileges + token = getAuthToken(eperson.getEmail(), password); + } + @Test public void findAllExternalSources() throws Exception { - getClient().perform(get("/api/integration/externalsources")) + getClient(token).perform(get("/api/integration/externalsources")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalsources", Matchers.hasItems( ExternalSourceMatcher.matchExternalSource("mock", "mock", false), @@ -57,51 +68,70 @@ public void findAllExternalSources() throws Exception { .andExpect(jsonPath("$.page.totalElements", Matchers.is(11))); } + @Test + public void findAllExternalSourcesAnonymous() throws Exception { + getClient().perform(get("/api/integration/externalsources").param("size", "21")) + .andExpect(status().isUnauthorized()); + } + @Test public void findOneExternalSourcesExistingSources() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock")) + getClient(token).perform(get("/api/integration/externalsources/mock")) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.is( ExternalSourceMatcher.matchExternalSource("mock", "mock", false) ))); } + + @Test + public void findOneExternalSourcesExistingSourcesAnonymous() throws Exception { + getClient().perform(get("/api/integration/externalsources/mock")) + .andExpect(status().isUnauthorized()); + } + @Test public void findOneExternalSourcesNotExistingSources() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock2")) + getClient(token).perform(get("/api/integration/externalsources/mock2")) .andExpect(status().isNotFound()); } @Test public void findOneExternalSourceEntryValue() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock/entryValues/one")) + getClient(token).perform(get("/api/integration/externalsources/mock/entryValues/one")) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.is( ExternalSourceEntryMatcher.matchExternalSourceEntry("one", "one", "one", "mock") ))); } + @Test + public void findOneExternalSourceEntryValueAnonymous() throws Exception { + getClient().perform(get("/api/integration/externalsources/mock/entryValues/one")) + .andExpect(status().isUnauthorized()); + } + @Test public void findOneExternalSourceEntryValueInvalidEntryId() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock/entryValues/entryIdInvalid")) + getClient(token).perform(get("/api/integration/externalsources/mock/entryValues/entryIdInvalid")) .andExpect(status().isNotFound()); } @Test public void findOneExternalSourceEntryValueInvalidSource() throws Exception { - getClient().perform(get("/api/integration/externalsources/mocktwo/entryValues/one")) + getClient(token).perform(get("/api/integration/externalsources/mocktwo/entryValues/one")) .andExpect(status().isNotFound()); } @Test public void findOneExternalSourceEntriesInvalidSource() throws Exception { - getClient().perform(get("/api/integration/externalsources/mocktwo/entries") + getClient(token).perform(get("/api/integration/externalsources/mocktwo/entries") .param("query", "test")) .andExpect(status().isNotFound()); } @Test public void findOneExternalSourceEntriesApplicableQuery() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock/entries") + getClient(token).perform(get("/api/integration/externalsources/mock/entries") .param("query", "one")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries", Matchers.containsInAnyOrder( @@ -112,8 +142,15 @@ public void findOneExternalSourceEntriesApplicableQuery() throws Exception { } @Test - public void findOneExternalSourceEntriesApplicableQueryPagination() throws Exception { + public void findOneExternalSourceEntriesApplicableQueryAnonymous() throws Exception { getClient().perform(get("/api/integration/externalsources/mock/entries") + .param("query", "one")) + .andExpect(status().isUnauthorized()); + } + + @Test + public void findOneExternalSourceEntriesApplicableQueryPagination() throws Exception { + getClient(token).perform(get("/api/integration/externalsources/mock/entries") .param("query", "one").param("size", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries", Matchers.hasItem( @@ -121,7 +158,7 @@ public void findOneExternalSourceEntriesApplicableQueryPagination() throws Excep ))) .andExpect(jsonPath("$.page", PageMatcher.pageEntryWithTotalPagesAndElements(0, 1, 2, 2))); - getClient().perform(get("/api/integration/externalsources/mock/entries") + getClient(token).perform(get("/api/integration/externalsources/mock/entries") .param("query", "one").param("size", "1").param("page", "1")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries", Matchers.hasItem( @@ -132,7 +169,7 @@ public void findOneExternalSourceEntriesApplicableQueryPagination() throws Excep @Test public void findOneExternalSourceEntriesNoReturnQuery() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock/entries") + getClient(token).perform(get("/api/integration/externalsources/mock/entries") .param("query", "randomqueryfornoresults")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded").doesNotExist()); @@ -140,7 +177,7 @@ public void findOneExternalSourceEntriesNoReturnQuery() throws Exception { @Test public void findOneExternalSourceEntriesNoQuery() throws Exception { - getClient().perform(get("/api/integration/externalsources/mock/entries")) + getClient(token).perform(get("/api/integration/externalsources/mock/entries")) .andExpect(status().isBadRequest()); } @@ -151,7 +188,7 @@ public void findExternalSourcesByEntityTypeTest() throws Exception { List journalProviders = externalDataService.getExternalDataProvidersForEntityType("Journal"); - getClient().perform(get("/api/integration/externalsources/search/findByEntityType") + getClient(token).perform(get("/api/integration/externalsources/search/findByEntityType") .param("entityType", "Publication")) .andExpect(status().isOk()) // Expect that Publication sources match (check a max of 20 as that is default page size) @@ -160,7 +197,7 @@ public void findExternalSourcesByEntityTypeTest() throws Exception { )) .andExpect(jsonPath("$.page.totalElements", Matchers.is(publicationProviders.size()))); - getClient().perform(get("/api/integration/externalsources/search/findByEntityType") + getClient(token).perform(get("/api/integration/externalsources/search/findByEntityType") .param("entityType", "Journal")) .andExpect(status().isOk()) // Check that Journal sources match (check a max of 20 as that is default page size) @@ -170,9 +207,16 @@ public void findExternalSourcesByEntityTypeTest() throws Exception { .andExpect(jsonPath("$.page.totalElements", Matchers.is(journalProviders.size()))); } + @Test + public void findExternalSourcesByEntityTypeAnonymousTest() throws Exception { + getClient().perform(get("/api/integration/externalsources/search/findByEntityType") + .param("entityType", "Publication")) + .andExpect(status().isUnauthorized()); + } + @Test public void findExternalSourcesByEntityTypeBadRequestTest() throws Exception { - getClient().perform(get("/api/integration/externalsources/search/findByEntityType")) + getClient(token).perform(get("/api/integration/externalsources/search/findByEntityType")) .andExpect(status().isBadRequest()); } @@ -186,7 +230,7 @@ public void findExternalSourcesByEntityTypePaginationTest() throws Exception { int pageSize = 2; int numberOfPages = (int) Math.ceil((double) numJournalProviders / pageSize); - getClient().perform(get("/api/integration/externalsources/search/findByEntityType") + getClient(token).perform(get("/api/integration/externalsources/search/findByEntityType") .param("entityType", "Journal") .param("size", String.valueOf(pageSize))) .andExpect(status().isOk()) @@ -196,7 +240,7 @@ public void findExternalSourcesByEntityTypePaginationTest() throws Exception { .andExpect(jsonPath("$.page.totalPages", Matchers.is(numberOfPages))) .andExpect(jsonPath("$.page.totalElements", Matchers.is(numJournalProviders))); - getClient().perform(get("/api/integration/externalsources/search/findByEntityType") + getClient(token).perform(get("/api/integration/externalsources/search/findByEntityType") .param("entityType", "Journal") .param("page", "1") .param("size", String.valueOf(pageSize))) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/OpenaireFundingExternalSourcesIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/OpenaireFundingExternalSourcesIT.java index 8c76c7adea0e..afb74ae26ae7 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/OpenaireFundingExternalSourcesIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/OpenaireFundingExternalSourcesIT.java @@ -17,10 +17,21 @@ import org.dspace.app.rest.matcher.ExternalSourceMatcher; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.hamcrest.Matchers; +import org.junit.Before; import org.junit.Test; public class OpenaireFundingExternalSourcesIT extends AbstractControllerIntegrationTest { + String token; + + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + // All tests just require basic authentication privileges + token = getAuthToken(eperson.getEmail(), password); + } + /** * Test openaire funding external source * @@ -28,7 +39,7 @@ public class OpenaireFundingExternalSourcesIT extends AbstractControllerIntegrat */ @Test public void findOneOpenaireFundingExternalSourceTest() throws Exception { - getClient().perform(get("/api/integration/externalsources")).andExpect(status().isOk()) + getClient(token).perform(get("/api/integration/externalsources")).andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalsources", Matchers.hasItem( ExternalSourceMatcher.matchExternalSource("openaireFunding", "openaireFunding", false)))); } @@ -40,11 +51,18 @@ public void findOneOpenaireFundingExternalSourceTest() throws Exception { */ @Test public void findOneOpenaireFundingExternalSourceEntriesEmptyWithQueryTest() throws Exception { - - getClient().perform(get("/api/integration/externalsources/openaireFunding/entries").param("query", "empty")) + getClient(token).perform(get("/api/integration/externalsources/openaireFunding/entries") + .param("query", "empty")) .andExpect(status().isOk()).andExpect(jsonPath("$.page.number", is(0))); } + @Test + public void findOneOpenaireFundingExternalSourceEntriesEmptyWithQueryAnonymousTest() throws Exception { + getClient().perform(get("/api/integration/externalsources/openaireFunding/entries") + .param("query", "empty")) + .andExpect(status().isUnauthorized()); + } + /** * Test openaire funding entries with multiple keywords for a query returning no * results @@ -54,7 +72,7 @@ public void findOneOpenaireFundingExternalSourceEntriesEmptyWithQueryTest() thro @Test public void findOneOpenaireFundingExternalSourceEntriesWithQueryMultipleKeywordsTest() throws Exception { - getClient() + getClient(token) .perform( get("/api/integration/externalsources/openaireFunding/entries").param("query", "empty+results")) .andExpect(status().isOk()).andExpect(jsonPath("$.page.number", is(0))); @@ -67,7 +85,8 @@ public void findOneOpenaireFundingExternalSourceEntriesWithQueryMultipleKeywords */ @Test public void findOneOpenaireFundingExternalSourceEntriesWithQueryTest() throws Exception { - getClient().perform(get("/api/integration/externalsources/openaireFunding/entries").param("query", "mushroom")) + getClient(token).perform(get("/api/integration/externalsources/openaireFunding/entries") + .param("query", "mushroom")) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries", Matchers.hasItem(ExternalSourceEntryMatcher.matchExternalSourceEntry( @@ -90,7 +109,7 @@ public void findOneOpenaireFundingExternalSourceEntryValueTest() throws Exceptio String projectName = "Portuguese Wild Mushrooms: Chemical characterization and functional study" + " of antiproliferative and proapoptotic properties in cancer cell lines"; - getClient().perform(get("/api/integration/externalsources/openaireFunding/entryValues/" + projectID)) + getClient(token).perform(get("/api/integration/externalsources/openaireFunding/entryValues/" + projectID)) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf(hasJsonPath("$.id", is(projectID)), hasJsonPath("$.display", is(projectName)), diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidExternalSourcesIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidExternalSourcesIT.java index 04592c17da2d..e8e96076e5ab 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidExternalSourcesIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/OrcidExternalSourcesIT.java @@ -23,6 +23,7 @@ import org.dspace.services.ConfigurationService; import org.hamcrest.Matchers; import org.junit.Assume; +import org.junit.Before; import org.junit.Test; import org.mockito.ArgumentMatchers; import org.mockito.Mockito; @@ -55,9 +56,19 @@ public void onlyRunIfConfigExists() { } } + String token; + + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + // All tests just require basic authentication privileges + token = getAuthToken(eperson.getEmail(), password); + } + @Test public void findOneExternalSourcesExistingSources() throws Exception { - getClient().perform(get("/api/integration/externalsources/orcid")) + getClient(token).perform(get("/api/integration/externalsources/orcid")) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( hasJsonPath("$.id", is("orcid")), @@ -67,12 +78,18 @@ public void findOneExternalSourcesExistingSources() throws Exception { ))); } + @Test + public void findOneExternalSourcesExistingSourcesAnonymous() throws Exception { + getClient().perform(get("/api/integration/externalsources/orcid")) + .andExpect(status().isUnauthorized()); + } + @Test public void findOneExternalSourcesExistingSourcesWithentryValueTest() throws Exception { // this test will query the real ORCID API if configured in the CI otherwise will be skipped onlyRunIfConfigExists(); String entry = "0000-0002-9029-1854"; - getClient().perform(get("/api/integration/externalsources/orcid/entryValues/" + entry)) + getClient(token).perform(get("/api/integration/externalsources/orcid/entryValues/" + entry)) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( hasJsonPath("$.id", is(entry)), @@ -92,7 +109,7 @@ public void findOneExternalSourceEntriesApplicableQueryTest() throws Exception { // this test will query the real ORCID API if configured in the CI otherwise will be skipped onlyRunIfConfigExists(); String q = "orcid:0000-0002-9029-1854"; - getClient().perform(get("/api/integration/externalsources/orcid/entries") + getClient(token).perform(get("/api/integration/externalsources/orcid/entries") .param("query", q)) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries[0]", Matchers.allOf( @@ -117,7 +134,7 @@ public void findOneExternalSourceEntriesApplicableQueryFamilyNameAndGivenNamesTe // this test will query the real ORCID API if configured in the CI otherwise will be skipped onlyRunIfConfigExists(); String q = "family-name:bollini AND given-names:andrea"; - getClient().perform(get("/api/integration/externalsources/orcid/entries") + getClient(token).perform(get("/api/integration/externalsources/orcid/entries") .param("query", q)) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries", Matchers.hasItem( @@ -158,7 +175,7 @@ public InputStream answer(InvocationOnMock invocation) { }); String entry = "0000-0002-9029-1854"; - getClient().perform(get("/api/integration/externalsources/orcid/entryValues/" + entry)) + getClient(token).perform(get("/api/integration/externalsources/orcid/entryValues/" + entry)) .andExpect(status().isOk()) .andExpect(jsonPath("$", Matchers.allOf( hasJsonPath("$.id", is(entry)), @@ -200,7 +217,7 @@ public InputStream answer(InvocationOnMock invocation) { } }); String q = "orcid:0000-0002-9029-1854"; - getClient().perform(get("/api/integration/externalsources/orcid/entries") + getClient(token).perform(get("/api/integration/externalsources/orcid/entries") .param("query", q)) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries[0]", Matchers.allOf( @@ -253,7 +270,7 @@ public InputStream answer(InvocationOnMock invocation) { } }); String q = "family-name:bollini AND given-names:andrea"; - getClient().perform(get("/api/integration/externalsources/orcid/entries") + getClient(token).perform(get("/api/integration/externalsources/orcid/entries") .param("query", q)) .andExpect(status().isOk()) .andExpect(jsonPath("$._embedded.externalSourceEntries", Matchers.hasItem( From 6012b491cb46f431c739e78914a2def028ce1960 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 23 Jun 2026 14:39:25 -0500 Subject: [PATCH 206/283] Remove unused and unsecured PubMedToImport test class --- .../org/dspace/testing/PubMedToImport.java | 248 ------------------ 1 file changed, 248 deletions(-) delete mode 100644 dspace-api/src/main/java/org/dspace/testing/PubMedToImport.java diff --git a/dspace-api/src/main/java/org/dspace/testing/PubMedToImport.java b/dspace-api/src/main/java/org/dspace/testing/PubMedToImport.java deleted file mode 100644 index ec51528429a4..000000000000 --- a/dspace-api/src/main/java/org/dspace/testing/PubMedToImport.java +++ /dev/null @@ -1,248 +0,0 @@ -/** - * The contents of this file are subject to the license and copyright - * detailed in the LICENSE and NOTICE files at the root of the source - * tree and available online at - * - * http://www.dspace.org/license/ - */ -package org.dspace.testing; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DefaultParser; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.Options; -import org.apache.commons.lang3.StringUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.jdom2.Document; -import org.jdom2.Element; -import org.jdom2.output.Format; -import org.jdom2.output.XMLOutputter; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -/** - * Simple class to transform a medline.xml file from PubMed into DSpace import package(s). - * - *

    - * This is a distinctly incomplete implementation - it doesn't even attempt to map a number of fields, - * and has no means of customizing the mapping. More importantly, it makes assumptions in parsing the xml - * that would be problematic for a production instance. - * - *

    - * However, it does use SAX parsing, which means it has no problems with handling a 1GB+ input file. - * This means it is a good way to generate a large number of realistic import packages very quickly - - * simply go to http://www.ncbi.nlm.nih.gov/pubmed and search for something that returns a lot of records - * ('nature' returns over 300,000 for example). Download the results as a medline.xml (and yes, it will attempt - * to download all 300,000+ into a single file), and then run this class over that file to spit out import packages - * which can then be loaded into DSpace using ItemImport. - */ -public class PubMedToImport { - private static final Logger log = LogManager.getLogger(PubMedToImport.class); - - private static File outputDir = null; - - /** - * Default constructor - */ - private PubMedToImport() { } - - public static void main(String args[]) { - Options options = new Options(); - - options.addOption(new Option("s", "source", true, "Source xml")); - options.addOption(new Option("o", "output", true, "Output directory")); - - try { - CommandLine cli = new DefaultParser().parse(options, args); - - String source = cli.getOptionValue("s"); - String output = cli.getOptionValue("o"); - - if (!new File(source).exists()) { - throw new IllegalArgumentException("Source file does not exist"); - } - - outputDir = new File(output); - if (outputDir.exists()) { - if (outputDir.list().length > 0) { - throw new IllegalStateException("Output directory must be empty"); - } - } else { - if (!outputDir.mkdirs()) { - throw new IllegalStateException("Unable to create output directory"); - } - } - - SAXParserFactory factory = SAXParserFactory.newInstance(); - SAXParser saxParser = factory.newSAXParser(); - - saxParser.parse(source, new PubMedHandler()); - - } catch (Exception e) { - // ignore - } - } - - private static class PubMedHandler extends DefaultHandler { - private static int recordCount = 1; - private static List dcValues; - - private static StringBuilder value; - private static StringBuilder lastName; - private static StringBuilder firstName; - - private static boolean isCorrection = false; - private static boolean isLastName = false; - private static boolean isFirstName = false; - - private static void addDCValue(String element, String qualifier, String value) { - if (dcValues == null) { - dcValues = new ArrayList<>(); - } - - MockMetadataValue thisValue = new MockMetadataValue(); - thisValue.schema = "dc"; - thisValue.element = element; - thisValue.qualifier = qualifier; - thisValue.value = value; - - dcValues.add(thisValue); - } - - @Override - public void startElement(String uri, String localName, String qName, Attributes attributes) - throws SAXException { - if ("PubmedArticle".equals(qName)) { - System.out.println("Starting record " + recordCount); - } else if ("CommensCorrectionsList".equals(qName)) { - isCorrection = true; - } else if ("ForeName".equals(qName)) { - isFirstName = true; - firstName = new StringBuilder(); - } else if ("LastName".equals(qName)) { - isLastName = true; - lastName = new StringBuilder(); - } else { - value = new StringBuilder(); - } - - super.startElement(uri, localName, qName, attributes); - } - - @Override - public void endElement(String uri, String localName, String qName) throws SAXException { - if (!isCorrection) { - if ("PMID".equals(qName)) { - addDCValue("identifier", null, value.toString()); - } else if ("ISSN".equals(qName)) { - addDCValue("identifier", "issn", value.toString()); - } else if ("ArticleTitle".equals(qName)) { - addDCValue("title", null, value.toString()); - } else if ("AbstractText".equals(qName)) { - addDCValue("description", "abstract", value.toString()); - } else if ("PublicationType".equals(qName)) { - addDCValue("type", null, value.toString()); - } else if ("Author".equals(qName)) { - addDCValue("contributor", "author", lastName + ", " + firstName); - } else if ("DescriptorName".equals(qName)) { - addDCValue("subject", "mesh", value.toString()); - } - } else { - if ("MedlineCitation".equals(qName)) { - isCorrection = false; - } - } - - if ("PubmedArticle".equals(qName)) { - try { - writeItem(); - } catch (IOException e) { - throw new IllegalStateException("Unable to export record", e); - } - System.out.println("Ending record " + recordCount); - recordCount++; - } - - isFirstName = false; - isLastName = false; - super.endElement(uri, localName, qName); - } - - @Override - public void characters(char[] chars, int start, int length) throws SAXException { - if (isFirstName) { - firstName.append(chars, start, length); -// firstName = String.copyValueOf(chars, start, length); - } else if (isLastName) { - lastName.append(chars, start, length); -// lastName = String.copyValueOf(chars, start, length); - } else { - value.append(chars, start, length); -// value = String.copyValueOf(chars, start, length); - } - - super.characters(chars, start, length); - } - - private void writeItem() throws IOException { - File itemDir = new File(outputDir, String.valueOf(recordCount)); - itemDir.mkdirs(); - - new File(itemDir, "contents").createNewFile(); - - Document doc = new Document(); - Element root = new Element("dublin_core"); - - doc.setRootElement(root); - - for (MockMetadataValue dcValue : dcValues) { - Element dcNode = new Element("dcvalue"); - - dcNode.setAttribute("element", dcValue.element); - - if (!StringUtils.isEmpty(dcValue.qualifier)) { - dcNode.setAttribute("qualifier", dcValue.qualifier); - } - - dcNode.setText(dcValue.value); - - root.addContent(dcNode); - } - - - File dc = new File(itemDir, "dublin_core.xml"); - XMLOutputter dcOutput = new XMLOutputter(Format.getPrettyFormat().setEncoding("UTF-8")); - OutputStream out = null; - try { - out = new BufferedOutputStream(new FileOutputStream(dc)); - dcOutput.output(doc, out); - } finally { - if (out != null) { - out.close(); - } - } - - dcValues.clear(); - } - } - - - protected static class MockMetadataValue { - public String schema; - public String element; - public String qualifier; - public String value; - } -} From 69257308f17a6845ad0b6e434c3f3f9ed335b018 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 23 Jun 2026 14:39:56 -0500 Subject: [PATCH 207/283] Secure usage of SchemaFactory by protecting against potential (but unlikely) XXE. --- .../java/org/dspace/app/util/XMLUtils.java | 18 ++++++++++++++++++ .../dspace/workflow/CurationTaskConfig.java | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java index 9f510077231a..c9099beb42af 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java @@ -28,6 +28,7 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.URIResolver; import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.SchemaFactory; import org.apache.commons.lang3.StringUtils; import org.jdom2.input.SAXBuilder; @@ -511,4 +512,21 @@ public Source resolve(String href, String base) throws TransformerException { } } } + + /** + * Initialize and return the javax SchemaFactory with some basic security + * applied to avoid XXE attacks and other unwanted content inclusion + * @param schemaLanguage locates an implementation of SchemaFactory that supports the specified schema language + * @return schema factory to generate new schema + * @throws SAXException + */ + public static SchemaFactory getSchemaFactory(String schemaLanguage) throws SAXException { + SchemaFactory factory = SchemaFactory.newInstance(schemaLanguage); + + // No external DTDs or Schema + factory.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + factory.setProperty(XMLConstants.ACCESS_EXTERNAL_SCHEMA, ""); + + return factory; + } } diff --git a/dspace-api/src/main/java/org/dspace/workflow/CurationTaskConfig.java b/dspace-api/src/main/java/org/dspace/workflow/CurationTaskConfig.java index 675fbb03be2d..163ed9782158 100644 --- a/dspace-api/src/main/java/org/dspace/workflow/CurationTaskConfig.java +++ b/dspace-api/src/main/java/org/dspace/workflow/CurationTaskConfig.java @@ -26,6 +26,7 @@ import jakarta.xml.bind.JAXBContext; import jakarta.xml.bind.JAXBException; import jakarta.xml.bind.Unmarshaller; +import org.dspace.app.util.XMLUtils; import org.xml.sax.SAXException; /** @@ -101,7 +102,7 @@ private Map loadTaskConfig(InputStream configuration) Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); // Give our configuration schema to the parser. - SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + SchemaFactory schemaFactory = XMLUtils.getSchemaFactory(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = schemaFactory.newSchema(CurationTaskConfig.class.getResource("workflow-curation.xsd")); unmarshaller.setSchema(schema); From 1f392152c5afd352036b303c6423cbae5856fbb8 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 23 Jun 2026 16:59:53 -0500 Subject: [PATCH 208/283] Enforce usages of XMLUtils methods instead of creating XML parsers directly. --- checkstyle.xml | 35 +++++++++++++++++++ .../java/org/dspace/app/util/XMLUtils.java | 7 ++++ 2 files changed, 42 insertions(+) diff --git a/checkstyle.xml b/checkstyle.xml index 36d2b15bd89e..8cf9605662d8 100644 --- a/checkstyle.xml +++ b/checkstyle.xml @@ -152,6 +152,41 @@ For more information on CheckStyle configurations below, see: http://checkstyle. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java index c9099beb42af..9e8ecb46dfd8 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java @@ -198,6 +198,7 @@ public static List getElementValueArrayList(Element rootElement, * @return document builder factory to generate new builders * @throws ParserConfigurationException */ + @SuppressWarnings("checkstyle:Regexp") public static DocumentBuilderFactory getTrustedDocumentBuilderFactory() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); @@ -210,6 +211,7 @@ public static DocumentBuilderFactory getTrustedDocumentBuilderFactory() * @return document builder factory to generate new builders * @throws ParserConfigurationException */ + @SuppressWarnings("checkstyle:Regexp") public static DocumentBuilderFactory getDocumentBuilderFactory() throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); @@ -281,6 +283,7 @@ public static SAXBuilder getSAXBuilder() { * @param validate whether to use JDOM XSD validation * @return SAX document builder for use in XML parsing */ + @SuppressWarnings("checkstyle:Regexp") public static SAXBuilder getSAXBuilder(boolean validate) { SAXBuilder saxBuilder = new SAXBuilder(); if (validate) { @@ -305,6 +308,7 @@ public static SAXBuilder getSAXBuilder(boolean validate) { * to avoid XXE attacks and other unwanted content inclusion * @return XML input factory for use in XML parsing */ + @SuppressWarnings("checkstyle:Regexp") public static XMLInputFactory getXMLInputFactory() { XMLInputFactory xmlInputFactory = XMLInputFactory.newFactory(); xmlInputFactory.setProperty(XMLInputFactory.SUPPORT_DTD, false); @@ -381,6 +385,7 @@ public InputSource resolveEntity(String publicId, String systemId) * @return transformer factory to generate new transformers * @throws TransformerConfigurationException */ + @SuppressWarnings("checkstyle:Regexp") public static TransformerFactory getTransformerFactory() throws TransformerConfigurationException { TransformerFactory factory = TransformerFactory.newInstance(); @@ -426,6 +431,7 @@ public static TransformerFactory getTrustedTransformerFactory(String... allowedB * @return TransformerFactory that allows references to external stylesheets but only for the given base Paths. * @throws TransformerConfigurationException */ + @SuppressWarnings("checkstyle:Regexp") public static TransformerFactory getTrustedTransformerFactory(String factoryClassName, String... allowedBasePaths) throws TransformerConfigurationException { // If not null, use the passed in factoryClassName. Otherwise, initialize a default TransformerFactory @@ -520,6 +526,7 @@ public Source resolve(String href, String base) throws TransformerException { * @return schema factory to generate new schema * @throws SAXException */ + @SuppressWarnings("checkstyle:Regexp") public static SchemaFactory getSchemaFactory(String schemaLanguage) throws SAXException { SchemaFactory factory = SchemaFactory.newInstance(schemaLanguage); From a4a7c60c57c33798a86bdbe81b6b7018c7878d49 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 16 Jul 2026 15:42:40 -0500 Subject: [PATCH 209/283] Fix broken job by allowing "unsafe checkout". Add comment to describe why. Also tweak the run statement to only trigger job if a "port to" label exists. --- .github/workflows/port_merged_pull_request.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml index 2e14bd8a404f..cdcd1e247f47 100644 --- a/.github/workflows/port_merged_pull_request.yml +++ b/.github/workflows/port_merged_pull_request.yml @@ -18,12 +18,22 @@ permissions: jobs: port_pr: - runs-on: ubuntu-latest - # Don't run on closed *unmerged* pull requests - if: github.event.pull_request.merged + runs-on: ubuntu-slim + # Only run on MERGED pull requests, + # and only run if the merged PR has a label that starts with "port to" + if: > + github.event.pull_request.merged && + contains(toJSON(github.event.pull_request.labels.*.name), '"port to ') steps: # Checkout code - uses: actions/checkout@v7 + with: + # When using 'pull_request_target' (see above), this 'checkout' step will always fail because it + # may make the codebase vulnerable to "pwn requests" via the user-created PR. + # See https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target + # However, we are allowing this unsafe checkout because (1) it's required to backport the PR, and + # (2) this job only runs when a PR is MERGED, and merger only happens after a thorough review of the PR. + allow-unsafe-pr-checkout: true # Port PR to other branch (ONLY if labeled with "port to") # See https://github.com/korthout/backport-action - name: Create backport pull requests From 2a60c610f8f22f2b0a892edb4e31849fb782c7d1 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 16 Jul 2026 17:06:34 -0500 Subject: [PATCH 210/283] Skip codecov on fork repositories --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac3dcba4435b..c974651e6086 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,6 +84,9 @@ jobs: codecov: # Must run after 'tests' job above needs: tests + # Only run on the upstream repository: forks do not have the CODECOV_TOKEN secret, + # and Codecov refuses to create a commit on a protected branch without a token. + if: github.repository == 'dspace/dspace' runs-on: ubuntu-latest steps: - name: Checkout From 1ae2f5ddb25f98170abf62aec05cea5d6ecdc636 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 2 Jul 2026 15:14:48 -0500 Subject: [PATCH 211/283] Don't run tests or docker build if the only changes are to static files --- .github/workflows/build.yml | 18 +++++++++++++++++- .github/workflows/codescan.yml | 5 ++++- .github/workflows/docker.yml | 14 ++++++++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac3dcba4435b..7729e1aadf15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,23 @@ name: Build # Run this Build for all pushes / PRs to current branch -on: [push, pull_request] +on: + push: + # Don't run if PR is only updating static documentation + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'LICENSES_THIRD_PARTY' + - 'NOTICE' + - '**/*.md' + pull_request: + # Don't run if PR is only updating static documentation + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'LICENSES_THIRD_PARTY' + - 'NOTICE' + - '**/*.md' permissions: contents: read # to fetch code (actions/checkout) diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index ed9a6bfbb408..1ae63dd41eba 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -17,8 +17,11 @@ on: - 'dspace-**' # Don't run if PR is only updating static documentation paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'LICENSES_THIRD_PARTY' + - 'NOTICE' - '**/*.md' - - '**/*.txt' schedule: - cron: "37 0 * * 1" diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4f507b66d088..7e3722e2a352 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -11,7 +11,21 @@ on: - 'dspace-**' tags: - 'dspace-**' + # Don't run if PR is only updating static documentation + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'LICENSES_THIRD_PARTY' + - 'NOTICE' + - '**/*.md' pull_request: + # Don't run if PR is only updating static documentation + paths-ignore: + - '.gitignore' + - 'LICENSE' + - 'LICENSES_THIRD_PARTY' + - 'NOTICE' + - '**/*.md' permissions: contents: read # to fetch code (actions/checkout) From 37e65f2bcf6aca534efa947628b3f6ae924d61f7 Mon Sep 17 00:00:00 2001 From: autavares-dev Date: Fri, 24 Jul 2026 09:43:38 -0300 Subject: [PATCH 212/283] Fix unit conversion in BitstreamStorageServiceImpl::isRecent method (cherry picked from commit 7ae75e4c3029c5d2ed789a07c9d20e5291a4526e) --- .../storage/bitstore/BitstreamStorageServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java b/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java index 43427dae3bbc..4f872e1bd010 100644 --- a/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/storage/bitstore/BitstreamStorageServiceImpl.java @@ -486,12 +486,14 @@ public Map getStores() { protected boolean isRecent(Long lastModified) { long now = new java.util.Date().getTime(); - if (lastModified >= now) { + if (lastModified == null || lastModified >= now) { return true; } // Less than one hour old - return (now - lastModified) < (1 * 60 * 1000); + long waitHours = 1L; + long waitMilli = waitHours * 60 * 60 * 1000; + return (now - lastModified) < waitMilli; } protected BitStoreService getStore(int position) throws IOException { From be7d0edd07281c28604d341fd0d032304afb6249 Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Sun, 12 Jul 2026 16:38:09 +0200 Subject: [PATCH 213/283] feat: enhance SEOHealthIndicator with detailed health check messages and unit tests ref: #12672 (cherry picked from commit a9f32724b97cc7d525c73a5391cb72d02c343040) --- .../app/rest/health/SEOHealthIndicator.java | 49 ++++--- .../rest/health/SEOHealthIndicatorTest.java | 123 ++++++++++++++++++ 2 files changed, 154 insertions(+), 18 deletions(-) create mode 100644 dspace-server-webapp/src/test/java/org/dspace/app/rest/health/SEOHealthIndicatorTest.java diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/health/SEOHealthIndicator.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/health/SEOHealthIndicator.java index 5b57f2d537fc..cf5634a2c2db 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/health/SEOHealthIndicator.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/health/SEOHealthIndicator.java @@ -7,9 +7,11 @@ */ package org.dspace.app.rest.health; +import static org.dspace.app.rest.configuration.ActuatorConfiguration.UP_WITH_ISSUES_STATUS; + import org.apache.commons.lang3.StringUtils; import org.dspace.services.ConfigurationService; -import org.dspace.services.factory.DSpaceServicesFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.actuate.health.AbstractHealthIndicator; import org.springframework.boot.actuate.health.Health; import org.springframework.web.client.RestTemplate; @@ -22,9 +24,26 @@ */ public class SEOHealthIndicator extends AbstractHealthIndicator { - ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); + public static final String SITEMAP = "sitemap"; + public static final String ROBOTS_TXT = "robots.txt"; + public static final String SSR = "ssr"; + public static final String OK = "OK"; + public static final String SITEMAP_MISSING = "Sitemaps are missing or inaccessible. Please see the " + + "DSpace Documentation on Search Engine Optimization for how to enable " + + "Sitemaps."; + public static final String ROBOTS_MISSING = "Missing or inaccessible. Please see the DSpace Documentation on " + + "Search Engine Optimization for how to create a robots.txt."; + public static final String ROBOTS_INVALID = "Invalid because it contains localhost URLs. This is often a sign " + + "that a proxy is failing to pass X-Forwarded headers to DSpace. Please see the DSpace " + + "Documentation on Search Engine Optimization for how to pass X-Forwarded headers."; + public static final String SSR_DISABLED = "Server-side rendering (SSR) appears to be disabled. Most " + + "search engines require enabling SSR for proper indexing. Please see the DSpace Documentation on" + + " Search Engine Optimization for more details."; + + @Autowired + private ConfigurationService configurationService; - private final RestTemplate restTemplate = new RestTemplate(); + private RestTemplate restTemplate = new RestTemplate(); @Override protected void doHealthCheck(Health.Builder builder) { @@ -36,27 +55,21 @@ protected void doHealthCheck(Health.Builder builder) { if (sitemapOk && robotsTxtStatus == RobotsTxtStatus.VALID && ssrOk) { builder.up() - .withDetail("sitemap", "OK") - .withDetail("robots.txt", "OK") - .withDetail("ssr", "OK"); + .withDetail(SITEMAP, OK) + .withDetail(ROBOTS_TXT, OK) + .withDetail(SSR, OK); } else { - builder.down(); - builder.withDetail("sitemap", sitemapOk ? "OK" : "Sitemaps are missing or inaccessible. Please see the " + - "DSpace Documentation on Search Engine Optimization for how to enable Sitemaps."); + builder.status(UP_WITH_ISSUES_STATUS) + .withDetail(SITEMAP, sitemapOk ? OK : SITEMAP_MISSING); if (robotsTxtStatus == RobotsTxtStatus.MISSING) { - builder.withDetail("robots.txt", "Missing or inaccessible. Please see the DSpace Documentation on " + - "Search Engine Optimization for how to create a robots.txt."); + builder.withDetail(ROBOTS_TXT, ROBOTS_MISSING); } else if (robotsTxtStatus == RobotsTxtStatus.INVALID) { - builder.withDetail("robots.txt", "Invalid because it contains localhost URLs. This is often a sign " + - "that a proxy is failing to pass X-Forwarded headers to DSpace. Please see the DSpace " + - "Documentation on Search Engine Optimization for how to pass X-Forwarded headers."); + builder.withDetail(ROBOTS_TXT, ROBOTS_INVALID); } else { - builder.withDetail("robots.txt", "OK"); + builder.withDetail(ROBOTS_TXT, OK); } - builder.withDetail("ssr", ssrOk ? "OK" : "Server-side rendering (SSR) appears to be disabled. Most " + - "search engines require enabling SSR for proper indexing. Please see the DSpace Documentation on" + - " Search Engine Optimization for more details."); + builder.withDetail(SSR, ssrOk ? OK : SSR_DISABLED); } } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/health/SEOHealthIndicatorTest.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/health/SEOHealthIndicatorTest.java new file mode 100644 index 000000000000..e5c9bb1c9e5d --- /dev/null +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/health/SEOHealthIndicatorTest.java @@ -0,0 +1,123 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.app.rest.health; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +import java.util.Map; + +import org.dspace.app.rest.configuration.ActuatorConfiguration; +import org.dspace.services.ConfigurationService; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.junit.MockitoJUnitRunner; +import org.springframework.boot.actuate.health.Health; +import org.springframework.boot.actuate.health.Status; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; + +/** + * Unit tests for {@link SEOHealthIndicator}. + */ +@RunWith(MockitoJUnitRunner.class) +public class SEOHealthIndicatorTest { + + private static final String BASE_URL = "https://demo.dspace.org"; + + @Mock + private ConfigurationService configurationService; + + @Mock + private RestTemplate restTemplate; + + @InjectMocks + private SEOHealthIndicator seoHealthIndicator; + + @Before + public void setUp() { + when(configurationService.getProperty("dspace.ui.url")).thenReturn(BASE_URL); + } + + @Test + public void testWithSeoConfiguredCorrectly() { + when(restTemplate.getForEntity(anyString(), eq(String.class))) + .thenReturn(ResponseEntity.ok("")); + when(restTemplate.getForObject(eq(BASE_URL + "/robots.txt"), eq(String.class))) + .thenReturn("User-agent: *\nSitemap: " + BASE_URL + "/sitemap_index.xml"); + when(restTemplate.getForObject(eq(BASE_URL), eq(String.class))) + .thenReturn("Rendered content"); + + Health health = seoHealthIndicator.health(); + + assertThat(health.getStatus(), is(Status.UP)); + assertThat(health.getDetails(), is(Map.of( + SEOHealthIndicator.SITEMAP, SEOHealthIndicator.OK, + SEOHealthIndicator.ROBOTS_TXT, SEOHealthIndicator.OK, + SEOHealthIndicator.SSR, SEOHealthIndicator.OK))); + } + + @Test + public void testWithSeoChecksFailingReportsUpWithIssues() { + when(restTemplate.getForEntity(anyString(), eq(String.class))) + .thenThrow(new RestClientException("connection refused")); + when(restTemplate.getForObject(anyString(), eq(String.class))) + .thenThrow(new RestClientException("connection refused")); + + Health health = seoHealthIndicator.health(); + + assertThat(health.getStatus(), is(ActuatorConfiguration.UP_WITH_ISSUES_STATUS)); + assertThat(health.getDetails(), is(Map.of( + SEOHealthIndicator.SITEMAP, SEOHealthIndicator.SITEMAP_MISSING, + SEOHealthIndicator.ROBOTS_TXT, SEOHealthIndicator.ROBOTS_MISSING, + SEOHealthIndicator.SSR, SEOHealthIndicator.SSR_DISABLED))); + } + + @Test + public void testWithRobotsTxtContainingLocalhostReportsUpWithIssues() { + when(restTemplate.getForEntity(anyString(), eq(String.class))) + .thenReturn(ResponseEntity.ok("")); + when(restTemplate.getForObject(eq(BASE_URL + "/robots.txt"), eq(String.class))) + .thenReturn("Sitemap: http://localhost:8080/sitemap_index.xml"); + when(restTemplate.getForObject(eq(BASE_URL), eq(String.class))) + .thenReturn("Rendered content"); + + Health health = seoHealthIndicator.health(); + + assertThat(health.getStatus(), is(ActuatorConfiguration.UP_WITH_ISSUES_STATUS)); + assertThat(health.getDetails(), is(Map.of( + SEOHealthIndicator.SITEMAP, SEOHealthIndicator.OK, + SEOHealthIndicator.ROBOTS_TXT, SEOHealthIndicator.ROBOTS_INVALID, + SEOHealthIndicator.SSR, SEOHealthIndicator.OK))); + } + + @Test + public void testWithSsrDisabledReportsUpWithIssues() { + when(restTemplate.getForEntity(anyString(), eq(String.class))) + .thenReturn(ResponseEntity.ok("")); + when(restTemplate.getForObject(eq(BASE_URL + "/robots.txt"), eq(String.class))) + .thenReturn("User-agent: *\nSitemap: " + BASE_URL + "/sitemap_index.xml"); + when(restTemplate.getForObject(eq(BASE_URL), eq(String.class))) + .thenReturn(""); + + Health health = seoHealthIndicator.health(); + + assertThat(health.getStatus(), is(ActuatorConfiguration.UP_WITH_ISSUES_STATUS)); + assertThat(health.getDetails(), is(Map.of( + SEOHealthIndicator.SITEMAP, SEOHealthIndicator.OK, + SEOHealthIndicator.ROBOTS_TXT, SEOHealthIndicator.OK, + SEOHealthIndicator.SSR, SEOHealthIndicator.SSR_DISABLED))); + } +} From 1a83b376f1a2f12d11e8abd7150888bb557a5f21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:05:16 +0000 Subject: [PATCH 214/283] Bump the build-tools group with 3 updates Bumps the build-tools group with 3 updates: [com.github.spotbugs:spotbugs](https://github.com/spotbugs/spotbugs), [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) and [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin). Updates `com.github.spotbugs:spotbugs` from 4.10.2 to 4.10.3 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.10.2...4.10.3) Updates `org.apache.maven.plugins:maven-jar-plugin` from 3.5.0 to 3.5.1 - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.5.0...maven-jar-plugin-3.5.1) Updates `com.github.spotbugs:spotbugs-maven-plugin` from 4.10.2.0 to 4.10.3.0 - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.10.2.0...spotbugs-maven-plugin-4.10.3.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs dependency-version: 4.10.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-version: 3.5.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.10.3.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6184fc9c7100..948b9856ae48 100644 --- a/pom.xml +++ b/pom.xml @@ -189,7 +189,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.5.0 + 3.5.1 @@ -315,7 +315,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.10.2.0 + 4.10.3.0 Max Low @@ -325,7 +325,7 @@ com.github.spotbugs spotbugs - 4.10.2 + 4.10.3 From c20d2711694b1122ebd1354cc57e0285d8fdb639 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:08:36 +0000 Subject: [PATCH 215/283] Bump the spring group with 12 updates Bumps the spring group with 12 updates: | Package | From | To | | --- | --- | --- | | [org.springframework.boot:spring-boot-starter-test](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-tomcat](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-maven-plugin](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-cache](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-thymeleaf](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-web](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-data-rest](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-security](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-aop](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-actuator](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | | [org.springframework.boot:spring-boot-starter-log4j2](https://github.com/spring-projects/spring-boot) | `3.5.15` | `3.5.16` | Updates `org.springframework.boot:spring-boot-starter-test` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-tomcat` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-cache` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-thymeleaf` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-web` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-data-rest` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-security` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-aop` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-actuator` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-log4j2` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-tomcat` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-maven-plugin` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-cache` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-thymeleaf` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-web` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-data-rest` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-security` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-aop` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-actuator` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) Updates `org.springframework.boot:spring-boot-starter-log4j2` from 3.5.15 to 3.5.16 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v3.5.15...v3.5.16) --- updated-dependencies: - dependency-name: org.springframework.boot:spring-boot-starter-test dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-tomcat dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-version: 3.5.16 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-cache dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-thymeleaf dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-web dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-data-rest dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-security dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-aop dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-actuator dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-log4j2 dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-tomcat dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-maven-plugin dependency-version: 3.5.16 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-cache dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-thymeleaf dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-web dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-data-rest dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-security dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-aop dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-actuator dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring - dependency-name: org.springframework.boot:spring-boot-starter-log4j2 dependency-version: 3.5.16 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: spring ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6184fc9c7100..76735ce8d0df 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 17 6.2.19 3.3.8 - 3.5.15 + 3.5.16 6.5.11 6.4.10.Final 8.0.4.Final From 35c7b8de98091fd80144cc1a70522119ea6f09fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:09:33 +0000 Subject: [PATCH 216/283] Bump log4j.version from 2.26.0 to 2.26.1 Bumps `log4j.version` from 2.26.0 to 2.26.1. Updates `org.apache.logging.log4j:log4j-api` from 2.26.0 to 2.26.1 Updates `org.apache.logging.log4j:log4j-core` from 2.26.0 to 2.26.1 Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.26.0 to 2.26.1 --- updated-dependencies: - dependency-name: org.apache.logging.log4j:log4j-api dependency-version: 2.26.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-core dependency-version: 2.26.1 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl dependency-version: 2.26.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6184fc9c7100..84bd6258797f 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 1.1.1 9.4.58.v20250814 - 2.26.0 + 2.26.1 3.0.7 1.19.0 2.0.18 From c8eba05ee958518b95d0e1ba98d126c0b42d69ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:09:53 +0000 Subject: [PATCH 217/283] Bump tika.version from 3.3.1 to 3.3.2 Bumps `tika.version` from 3.3.1 to 3.3.2. Updates `org.apache.tika:tika-core` from 3.3.1 to 3.3.2 - [Changelog](https://github.com/apache/tika/blob/3.3.2/CHANGES.txt) - [Commits](https://github.com/apache/tika/compare/3.3.1...3.3.2) Updates `org.apache.tika:tika-parsers-standard-package` from 3.3.1 to 3.3.2 --- updated-dependencies: - dependency-name: org.apache.tika:tika-core dependency-version: 3.3.2 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.tika:tika-parsers-standard-package dependency-version: 3.3.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6184fc9c7100..c02d4e067f7a 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ 3.0.7 1.19.0 2.0.18 - 3.3.1 + 3.3.2 From 9905c9b44bef2a9ad354cac3b125cf38b7925949 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:10:01 +0000 Subject: [PATCH 218/283] Bump org.postgresql:postgresql from 42.7.11 to 42.7.13 Bumps [org.postgresql:postgresql](https://github.com/pgjdbc/pgjdbc) from 42.7.11 to 42.7.13. - [Release notes](https://github.com/pgjdbc/pgjdbc/releases) - [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md) - [Commits](https://github.com/pgjdbc/pgjdbc/compare/REL42.7.11...REL42.7.13) --- updated-dependencies: - dependency-name: org.postgresql:postgresql dependency-version: 42.7.13 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6184fc9c7100..7af817c8f7c8 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 6.5.11 6.4.10.Final 8.0.4.Final - 42.7.11 + 42.7.13 10.22.0 8.11.4 From f2a3e1631cffcb622b1f1a3480d9422633723074 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:10:27 +0000 Subject: [PATCH 219/283] Bump com.healthmarketscience.jackcess:jackcess from 4.0.10 to 4.0.11 Bumps [com.healthmarketscience.jackcess:jackcess](https://github.com/jahlborn/jackcess) from 4.0.10 to 4.0.11. - [Commits](https://github.com/jahlborn/jackcess/commits) --- updated-dependencies: - dependency-name: com.healthmarketscience.jackcess:jackcess dependency-version: 4.0.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6184fc9c7100..ec70121ef2f1 100644 --- a/pom.xml +++ b/pom.xml @@ -1354,7 +1354,7 @@ com.healthmarketscience.jackcess jackcess - 4.0.10 + 4.0.11 From f5f73ad218db5b6c86ecdc3d91863b539f7a2369 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 02:53:43 +0000 Subject: [PATCH 220/283] Bump korthout/backport-action from 4.5.2 to 4.6.0 Bumps [korthout/backport-action](https://github.com/korthout/backport-action) from 4.5.2 to 4.6.0. - [Release notes](https://github.com/korthout/backport-action/releases) - [Commits](https://github.com/korthout/backport-action/compare/v4.5.2...v4.6.0) --- updated-dependencies: - dependency-name: korthout/backport-action dependency-version: 4.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/port_merged_pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/port_merged_pull_request.yml b/.github/workflows/port_merged_pull_request.yml index cdcd1e247f47..1eb4e52b762c 100644 --- a/.github/workflows/port_merged_pull_request.yml +++ b/.github/workflows/port_merged_pull_request.yml @@ -37,7 +37,7 @@ jobs: # Port PR to other branch (ONLY if labeled with "port to") # See https://github.com/korthout/backport-action - name: Create backport pull requests - uses: korthout/backport-action@v4.5.2 + uses: korthout/backport-action@v4.6.0 with: # Trigger based on a "port to [branch]" label on PR # (This label must specify the branch name to port to) From e27105564c8ed3bb021ea7dfd5b300cb9afe9c60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 18:14:18 +0000 Subject: [PATCH 221/283] Bump pdfbox-version from 3.0.7 to 3.0.8 Bumps `pdfbox-version` from 3.0.7 to 3.0.8. Updates `org.apache.pdfbox:pdfbox` from 3.0.7 to 3.0.8 Updates `org.apache.pdfbox:fontbox` from 3.0.7 to 3.0.8 --- updated-dependencies: - dependency-name: org.apache.pdfbox:fontbox dependency-version: 3.0.8 dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.apache.pdfbox:pdfbox dependency-version: 3.0.8 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84bd6258797f..50f5a60adbec 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 9.4.58.v20250814 2.26.1 - 3.0.7 + 3.0.8 1.19.0 2.0.18 3.3.1 From 16a9ac9277cbd37fe9fd9b47cccb60ad19b08ce0 Mon Sep 17 00:00:00 2001 From: JohnnyMendesC <177888064+JohnnyMendesC@users.noreply.github.com> Date: Fri, 3 Jul 2026 19:49:33 -0300 Subject: [PATCH 222/283] fix(#10106): Replace hard-coded metadata prefix oai_dc with dynamic dropdowns (cherry picked from commit 0fd232bb90d8e016737789aa61bee8280a4a1f60) --- .../src/main/resources/templates/index.html | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/dspace-oai/src/main/resources/templates/index.html b/dspace-oai/src/main/resources/templates/index.html index a0d35d91dea2..5aa811687bbf 100644 --- a/dspace-oai/src/main/resources/templates/index.html +++ b/dspace-oai/src/main/resources/templates/index.html @@ -19,7 +19,7 @@ - + @@ -55,8 +55,26 @@

    Identify List Sets List Metadata Formats - List Identifiers - List Records +
    + + +
    +
    + + +

    From 8d0c8f33d48a954e18c6668b2c9cfdc5a61bc582 Mon Sep 17 00:00:00 2001 From: Jonas Tschammer Date: Tue, 28 Jul 2026 09:26:44 +0200 Subject: [PATCH 223/283] Excluded dot directories from xml validation (cherry picked from commit fe449faf0d0202dac655e6d404df166d2299ff35) --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 11c7643b9cd7..79591da20a2a 100644 --- a/pom.xml +++ b/pom.xml @@ -517,6 +517,7 @@ **/target/** + **/.*/** From f856d4aa9257cb1a395f8e50e7fccc8d04cd45ed Mon Sep 17 00:00:00 2001 From: Jonas Tschammer Date: Thu, 30 Jul 2026 10:26:43 +0200 Subject: [PATCH 224/283] Updated comment about excluded directories (cherry picked from commit c70971aec5cf6070b9f192eb88f4361b2a9a8088) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 79591da20a2a..5aa290898fb3 100644 --- a/pom.xml +++ b/pom.xml @@ -507,7 +507,7 @@ - + ${root.basedir} From 13fc7a091ddcba35e8a0eb5c399b0a18253b6a3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 22:27:12 +0000 Subject: [PATCH 225/283] Bump commons-codec:commons-codec in the apache-commons group Bumps the apache-commons group with 1 update: [commons-codec:commons-codec](https://github.com/apache/commons-codec). Updates `commons-codec:commons-codec` from 1.22.0 to 1.22.1 - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.22.0...rel/commons-codec-1.22.1) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-version: 1.22.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: apache-commons ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 515ae3c114d9..45c7036c84ee 100644 --- a/pom.xml +++ b/pom.xml @@ -1510,7 +1510,7 @@ commons-codec commons-codec - 1.22.0 + 1.22.1 org.apache.commons From 909635ca9fba50be502adf5013f8d51902a996e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:02:12 +0000 Subject: [PATCH 226/283] Bump org.apache.httpcomponents.client5:httpclient5 Bumps the test-tools group with 1 update in the / directory: [org.apache.httpcomponents.client5:httpclient5](https://github.com/apache/httpcomponents-client). Updates `org.apache.httpcomponents.client5:httpclient5` from 5.6.1 to 5.6.3 - [Changelog](https://github.com/apache/httpcomponents-client/blob/rel/v5.6.3/RELEASE_NOTES.txt) - [Commits](https://github.com/apache/httpcomponents-client/compare/rel/v5.6.1...rel/v5.6.3) --- updated-dependencies: - dependency-name: org.apache.httpcomponents.client5:httpclient5 dependency-version: 5.6.2 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-server-webapp/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 63d8908a9a03..5c84efe4aa5c 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -588,7 +588,7 @@ org.apache.httpcomponents.client5 httpclient5 - 5.6.1 + 5.6.3 test From 1921735cc6729acda4070dadcab1469d334a1da7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Aug 2026 23:03:13 +0000 Subject: [PATCH 227/283] Bump the amazon-s3 group across 1 directory with 2 updates Bumps the amazon-s3 group with 2 updates in the / directory: software.amazon.awssdk:s3 and [software.amazon.awssdk.crt:aws-crt](https://github.com/awslabs/aws-crt-java). Updates `software.amazon.awssdk:s3` from 2.46.17 to 2.49.4 Updates `software.amazon.awssdk.crt:aws-crt` from 0.47.1 to 0.48.1 - [Release notes](https://github.com/awslabs/aws-crt-java/releases) - [Commits](https://github.com/awslabs/aws-crt-java/compare/v0.47.1...v0.48.1) --- updated-dependencies: - dependency-name: software.amazon.awssdk.crt:aws-crt dependency-version: 0.48.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 - dependency-name: software.amazon.awssdk:s3 dependency-version: 2.49.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: amazon-s3 ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 80acfc815e7b..4b68e9c5061b 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -720,7 +720,7 @@ software.amazon.awssdk s3 - 2.46.17 + 2.49.4 software.amazon.awssdk @@ -744,7 +744,7 @@ software.amazon.awssdk.crt aws-crt - 0.47.1 + 0.48.1 - 2.22.0 + 2.22.1 2.22 2.1.1 4.0.5 From 2e9d17bffdf5b5cba2182b0c759a6d0281a984a3 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 4 Aug 2026 13:58:02 -0500 Subject: [PATCH 229/283] Fix dependency convergence issues with checker-qual & cleanup dspace-rdf exclusions to be same as dspace-api. --- dspace-api/pom.xml | 7 +++++++ dspace-rdf/pom.xml | 21 +++------------------ 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 80acfc815e7b..a7d86e3ff6f4 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -436,6 +436,13 @@ org.apache.jena apache-jena-libs pom + + + + org.checkerframework + checker-qual + + commons-cli diff --git a/dspace-rdf/pom.xml b/dspace-rdf/pom.xml index 961b13ba985b..0f0f423cb15f 100644 --- a/dspace-rdf/pom.xml +++ b/dspace-rdf/pom.xml @@ -24,25 +24,10 @@ org.apache.jena apache-jena-libs + - jackson-core - com.fasterxml.jackson.core - - - jackson-databind - com.fasterxml.jackson.core - - - org.slf4j - slf4j-api - - - org.slf4j - slf4j-log4j12 - - - log4j - log4j + org.checkerframework + checker-qual pom From 14309c73e46bf61cd56a431455dfbe01360a3e95 Mon Sep 17 00:00:00 2001 From: Bram Maegerman Date: Fri, 5 Jun 2026 14:43:43 +0200 Subject: [PATCH 230/283] 141564: removed invalid xml 1.0 characters in sanitize function (cherry picked from commit 14b4e5f659ecc63421d2163ede9c38cc5454af53) --- .../main/java/org/dspace/xoai/util/ItemUtils.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java b/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java index 78c98533e0b4..5eb794e19288 100644 --- a/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java +++ b/dspace-oai/src/main/java/org/dspace/xoai/util/ItemUtils.java @@ -18,7 +18,6 @@ import com.lyncode.xoai.dataprovider.xml.xoai.Element; import com.lyncode.xoai.dataprovider.xml.xoai.Metadata; import com.lyncode.xoai.util.Base64Utils; -import org.apache.commons.text.StringEscapeUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.dspace.app.util.factory.UtilServiceFactory; @@ -168,7 +167,7 @@ private static Element createBundlesElement(Context context, Item item) throws S /** * Sanitizes a string to remove characters that are invalid - * in XML 1.0 using the Apache Commons Text library. + * in XML 1.0 using a hardcoded regex to avoid escaping special characters twice. * @param value The string to sanitize. * @return A sanitized string, or null if the input was null. */ @@ -176,7 +175,15 @@ private static String sanitize(String value) { if (value == null) { return null; } - return StringEscapeUtils.escapeXml10(value); + + // Strips characters that are illegal in XML 1.0 (per the XML spec, https://www.w3.org/TR/xml/#charsets) + // The allowed character set is: #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + // This regex matches everything OUTSIDE that allowed set, i.e. it removes: + // - C0 control characters other than tab (\x09), LF (\x0A), and CR (\x0D) + // (i.e. \x00-\x08, \x0B, \x0C, \x0E-\x1F) + // - The UTF-16 surrogate range \uD800-\uDFFF + // - The non-characters \uFFFE and \uFFFF + return value.replaceAll("[^\\x09\\x0A\\x0D\\x20-\\uD7FF\\uE000-\\uFFFD]", ""); } /** From 29fb5c083f64ca7465493ac7ddfb28fe5553dcc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:41:10 +0000 Subject: [PATCH 231/283] Bump the hibernate group across 1 directory with 2 updates Bumps the hibernate group with 2 updates in the / directory: [org.hibernate.validator:hibernate-validator](https://github.com/hibernate/hibernate-validator) and [org.hibernate.validator:hibernate-validator-cdi](https://github.com/hibernate/hibernate-validator). Updates `org.hibernate.validator:hibernate-validator` from 8.0.4.Final to 8.0.5.Final - [Release notes](https://github.com/hibernate/hibernate-validator/releases) - [Changelog](https://github.com/hibernate/hibernate-validator/blob/8.0.5.Final/changelog.txt) - [Commits](https://github.com/hibernate/hibernate-validator/compare/8.0.4.Final...8.0.5.Final) Updates `org.hibernate.validator:hibernate-validator-cdi` from 8.0.4.Final to 8.0.5.Final - [Release notes](https://github.com/hibernate/hibernate-validator/releases) - [Changelog](https://github.com/hibernate/hibernate-validator/blob/8.0.5.Final/changelog.txt) - [Commits](https://github.com/hibernate/hibernate-validator/compare/8.0.4.Final...8.0.5.Final) Updates `org.hibernate.validator:hibernate-validator-cdi` from 8.0.4.Final to 8.0.5.Final - [Release notes](https://github.com/hibernate/hibernate-validator/releases) - [Changelog](https://github.com/hibernate/hibernate-validator/blob/8.0.5.Final/changelog.txt) - [Commits](https://github.com/hibernate/hibernate-validator/compare/8.0.4.Final...8.0.5.Final) --- updated-dependencies: - dependency-name: org.hibernate.validator:hibernate-validator dependency-version: 8.0.5.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: hibernate - dependency-name: org.hibernate.validator:hibernate-validator-cdi dependency-version: 8.0.5.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: hibernate - dependency-name: org.hibernate.validator:hibernate-validator-cdi dependency-version: 8.0.5.Final dependency-type: direct:production update-type: version-update:semver-patch dependency-group: hibernate ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d70329e27d2a..ab20a82254c1 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 3.5.16 6.5.11 6.4.10.Final - 8.0.4.Final + 8.0.5.Final 42.7.13 10.22.0 8.11.4 From e6a35ab7c66cd4f75cba5788d846a6ed0b2e4898 Mon Sep 17 00:00:00 2001 From: nwoodward Date: Wed, 12 Aug 2026 14:43:41 -0500 Subject: [PATCH 232/283] check that @authority exists before using it --- dspace/config/crosswalks/DIM2DataCite.xsl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dspace/config/crosswalks/DIM2DataCite.xsl b/dspace/config/crosswalks/DIM2DataCite.xsl index 34fb9c64bf96..c44fb3d65780 100644 --- a/dspace/config/crosswalks/DIM2DataCite.xsl +++ b/dspace/config/crosswalks/DIM2DataCite.xsl @@ -359,14 +359,16 @@ - - - - + + + + + + From 49e1949cdec3c246ae5874d48e032f8bfbe4ce41 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 23 Jul 2026 12:29:28 -0500 Subject: [PATCH 233/283] Refactor XMLUtils PathRestrictedEntityResolver.resolveEntity() to parse paths using java.net.URI and java.nio.file.Path. Add UnitTests to prove the new behavior works properly (cherry picked from commit 457e977273d22d34977ff7467c024b3239cf753f) --- .../org/dspace/app/util/DCInputsReader.java | 2 +- .../app/util/SubmissionConfigReader.java | 2 +- .../java/org/dspace/app/util/XMLUtils.java | 28 ++- ...tils_PathRestrictedEntityResolverTest.java | 160 ++++++++++++++++++ 4 files changed, 181 insertions(+), 11 deletions(-) create mode 100644 dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedEntityResolverTest.java diff --git a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java index 7c0ad4830f13..a93f3b5911a8 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/DCInputsReader.java @@ -120,7 +120,7 @@ private void buildInputs(String fileName) File inputFile = new File(fileName); String inputFileDir = inputFile.toPath().normalize().getParent().toString(); - String uri = "file:" + inputFile.getAbsolutePath(); + String uri = inputFile.toURI().toString(); try { // This document builder will *not* disable external diff --git a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java index 2016fb2ce64e..adef03747966 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java +++ b/dspace-api/src/main/java/org/dspace/app/util/SubmissionConfigReader.java @@ -166,7 +166,7 @@ private void buildInputs(String fileName) throws SubmissionConfigReaderException entityTypeToSubmissionConfig = new HashMap(); submitDefns = new LinkedHashMap>>(); - String uri = "file:" + new File(fileName).getAbsolutePath(); + String uri = new File(fileName).toURI().toString(); try { // This document builder factory will *not* disable external diff --git a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java index 9e8ecb46dfd8..d3d22a61f848 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java @@ -338,21 +338,31 @@ public InputSource resolveEntity(String publicId, String systemId) return null; } - String filePath; - if (systemId.startsWith("file://")) { - filePath = systemId.substring(7); - } else if (systemId.startsWith("file:")) { - filePath = systemId.substring(5); - } else if (!systemId.contains("://")) { - filePath = systemId; - } else { + URI fileUri; + try { + // First, try to parse this string as a URI. + fileUri = new URI(systemId); + } catch (Exception e) { + try { + // Could not be parsed as a URI. + // Second, try to parse it as a Path and convert to URI. + fileUri = Paths.get(systemId).toUri(); + } catch (Exception e2) { + // Doesn't appear to be a valid URI or a Path, so we'll have to throw an error. + throw new SAXException("Invalid path: " + systemId, e2); + } + } + + // Only allow for "file" scheme or empty scheme + String scheme = fileUri.getScheme(); + if (scheme != null && !"file".equalsIgnoreCase(scheme)) { throw new SAXException("External resources not allowed: " + systemId + ". Only local file paths are permitted."); } Path resolvedPath; try { - resolvedPath = Paths.get(filePath).toAbsolutePath().normalize(); + resolvedPath = Paths.get(fileUri).toAbsolutePath().normalize(); } catch (Exception e) { throw new SAXException("Invalid path: " + systemId, e); } diff --git a/dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedEntityResolverTest.java b/dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedEntityResolverTest.java new file mode 100644 index 000000000000..60f3a46f71c5 --- /dev/null +++ b/dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedEntityResolverTest.java @@ -0,0 +1,160 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.app.util; + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; + +import org.dspace.app.util.XMLUtils.PathRestrictedEntityResolver; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Unit tests for {@link XMLUtils.PathRestrictedEntityResolver}. + * + * These unit tests exercise the resolver in isolation without the full application. + * Therefore, this PURPOSEFULLY doesn't extend AbstractUnitTest because it doesn't need a database setup. + */ +public class XMLUtils_PathRestrictedEntityResolverTest { + + @Rule + public TemporaryFolder allowedFolder = new TemporaryFolder(); + + @Rule + public TemporaryFolder disallowedFolder = new TemporaryFolder(); + + private Path allowedDir; + private Path allowedFile; + + @Before + public void setUp() throws IOException { + allowedDir = allowedFolder.getRoot().toPath(); + allowedFile = allowedFolder.newFile("allowed.dtd").toPath(); + } + + @Test + public void nullSystemId_returnsNull() throws Exception { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + assertNull(resolver.resolveEntity("somePublicId", null)); + } + + @Test + public void plainFilePath_withinAllowedDir_isResolved() throws Exception { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + + // systemId is a raw filesystem path (NOT a "file://" URI) + String systemId = allowedFile.toString(); + assertFalse(systemId.startsWith("file://")); + + InputSource result = resolver.resolveEntity(null, systemId); + // resolved successfully! + assertNotNull(result); + } + + @Test + public void fileURI_withinAllowedDir_isResolved() throws Exception { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + + // systemId using "file://" prefix, e.g. file:///path/to/allowed.dtd + String systemId = allowedFile.toUri().toString(); + assertTrue(systemId.startsWith("file://")); + + InputSource result = resolver.resolveEntity(null, systemId); + // resolved successfully! + assertNotNull(result); + } + + @Test + public void externalSystemId_isRejected() { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + + // systemId is an HTTP link + SAXException ex = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, "http://example.com/evil.dtd")); + assertTrue(ex.getMessage().contains("External resources not allowed")); + + // systemId is an FTP link + SAXException ex2 = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, "ftp://example.com/evil.dtd")); + assertTrue(ex2.getMessage().contains("External resources not allowed")); + + // systemId is an HTTPS link + SAXException ex3 = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, "https://example.com/evil.dtd")); + assertTrue(ex3.getMessage().contains("External resources not allowed")); + } + + @Test + public void pathOutsideAllowedDir_isDenied() throws IOException { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + + Path outsideFile = disallowedFolder.newFile("disallowed.dtd").toPath(); + + // systemId points at an existing file in a disallowed directory + SAXException ex = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, outsideFile.toString())); + assertTrue(ex.getMessage().contains("Access denied")); + } + + @Test + public void pathTraversalOutOfAllowedDir_isDenied() { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + + // systemId is an attempt at directory traversal attack starting from allowed directory + String traversalAttempt = allowedDir.resolve("../../../etc/passwd").toString(); + + SAXException ex = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, traversalAttempt)); + assertTrue(ex.getMessage().contains("Access denied")); + } + + @Test + public void noAllowedPaths_deniesEverything() { + // No allowedBasePaths provided means that nothing will resolve + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(); + + SAXException ex = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, allowedFile.toString())); + assertTrue(ex.getMessage().contains("Access denied")); + } + + @Test + public void multipleAllowedPaths_isResolvedForSecondPath() throws Exception { + // Provide multiple allowedBatPaths + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver( + disallowedFolder.getRoot().toString(), allowedDir.toString()); + + // Ensure something in the *second* path will resolve correctly + InputSource result = resolver.resolveEntity(null, allowedFile.toString()); + // resolved successfully! + assertNotNull(result); + } + + @Test + public void withinAllowedDir_butFileDoesNotExist() { + PathRestrictedEntityResolver resolver = new PathRestrictedEntityResolver(allowedDir.toString()); + + // Specify a file that doesn't exist in an allowed directory + Path missing = allowedDir.resolve("does-not-exist.dtd"); + + // Resolve should throw a file not found error, even though it was requested from an allowed directory. + SAXException ex = assertThrows(SAXException.class, + () -> resolver.resolveEntity(null, missing.toString())); + assertTrue(ex.getMessage().contains("File not found")); + } +} From 522fb7aee6ae9a70fa7ef76f76c8337603698c77 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 29 Jul 2026 14:37:44 -0500 Subject: [PATCH 234/283] Also add Unit Tests for XMLUtils.PathRestrictedURIResolver as those are also missing. (cherry picked from commit be0ac9947ec50406aea9b86222011e5b36513126) --- ...MLUtils_PathRestrictedURIResolverTest.java | 163 ++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedURIResolverTest.java diff --git a/dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedURIResolverTest.java b/dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedURIResolverTest.java new file mode 100644 index 000000000000..a4dc3f0a5e79 --- /dev/null +++ b/dspace-api/src/test/java/org/dspace/app/util/XMLUtils_PathRestrictedURIResolverTest.java @@ -0,0 +1,163 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.app.util; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + +import java.io.IOException; +import java.nio.file.Path; +import javax.xml.transform.Source; +import javax.xml.transform.TransformerException; + +import org.dspace.app.util.XMLUtils.PathRestrictedURIResolver; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.TemporaryFolder; + +/** + * Unit tests for {@link XMLUtils.PathRestrictedURIResolver}. + * + * These unit tests exercise the resolver in isolation without the full application. + * Therefore, this PURPOSEFULLY doesn't extend AbstractUnitTest because it doesn't need a database setup. + */ +public class XMLUtils_PathRestrictedURIResolverTest { + + @Rule + public TemporaryFolder allowedFolder = new TemporaryFolder(); + + @Rule + public TemporaryFolder disallowedFolder = new TemporaryFolder(); + + private Path allowedDir; + private Path allowedFile; + private final String allowedFileName = "allowed.xsl"; + + @Before + public void setUp() throws IOException { + allowedDir = allowedFolder.getRoot().toPath(); + allowedFile = allowedFolder.newFile(allowedFileName).toPath(); + } + + @Test + public void absoluteFileHref_withinAllowedDir_isResolved() throws Exception { + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(allowedDir.toString()); + + // href is an absolute path via a file:// URI + String href = allowedFile.toUri().toString(); + + Source source = resolver.resolve(href, null); + // resolved successfully! + assertNotNull(source); + + // Also ensure an empty base works properly + source = resolver.resolve(href, ""); + // resolved successfully! + assertNotNull(source); + } + + @Test + public void relativeHref_resolvedAgainstBase_withinAllowedDir_isResolved() throws Exception { + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(allowedDir.toString()); + + // base points at the allowed directory + String base = allowedDir.toUri().toString(); + // href is a relative URL to file based on the "base" path + String href = allowedFileName; + + Source source = resolver.resolve(href, base); + // resolved successfully! + assertNotNull(source); + } + + @Test + public void externalResource_isRejected() { + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(allowedDir.toString()); + + // href is an HTTP URL + TransformerException ex = assertThrows(TransformerException.class, + () -> resolver.resolve("http://example.com/evil.xsl", null)); + assertTrue(ex.getMessage().contains("External resources not allowed")); + + // href is an HTTPS URL + TransformerException ex2 = assertThrows(TransformerException.class, + () -> resolver.resolve("https://example.com/evil.xsl", null)); + assertTrue(ex2.getMessage().contains("External resources not allowed")); + + // href is an FTP URL + TransformerException ex3 = assertThrows(TransformerException.class, + () -> resolver.resolve("ftp://example.com/evil.xsl", null)); + assertTrue(ex3.getMessage().contains("External resources not allowed")); + } + + @Test + public void hrefOutsideAllowedDir_isDenied() throws IOException { + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(allowedDir.toString()); + + // href points to an existing file in a disallowed folder + Path outsideFile = disallowedFolder.newFile("disallowed.xsl").toPath(); + String href = outsideFile.toUri().toString(); + + TransformerException ex = assertThrows(TransformerException.class, + () -> resolver.resolve(href, null)); + assertTrue(ex.getMessage().contains("Access denied")); + } + + @Test + public void relativeHref_traversingOutOfBase_isDenied() { + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(allowedDir.toString()); + + // href is an attempt at a directory traversal attack starting from allowed directory + String base = allowedDir.toUri().toString(); + String href = "../../../../etc/passwd"; + + TransformerException ex = assertThrows(TransformerException.class, + () -> resolver.resolve(href, base)); + assertTrue(ex.getMessage().contains("Access denied")); + } + + @Test + public void noAllowedPaths_deniesEverything() { + // No allowedBasePaths provided means that nothing will resolve + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(); + + String href = allowedFile.toUri().toString(); + + TransformerException ex = assertThrows(TransformerException.class, + () -> resolver.resolve(href, null)); + assertTrue(ex.getMessage().contains("Access denied")); + } + + @Test + public void multipleAllowedPaths_isResolvedForSecondPath() throws Exception { + // Provide multiple allowedBatPaths + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver( + disallowedFolder.getRoot().toString(), allowedDir.toString()); + + // Ensure something in the *second* path will resolve correctly + String href = allowedFile.toUri().toString(); + + Source source = resolver.resolve(href, null); + assertNotNull(source); + } + + @Test + public void withinAllowedDir_butFileDoesNotExist() { + PathRestrictedURIResolver resolver = new PathRestrictedURIResolver(allowedDir.toString()); + + // Specify a file that doesn't exist in an allowed directory + String href = allowedDir.resolve("does-not-exist.xsl").toUri().toString(); + + // Resolve should throw a file not found error, even though it was requested from an allowed directory. + TransformerException ex = assertThrows(TransformerException.class, + () -> resolver.resolve(href, null)); + assertTrue(ex.getMessage().contains("File not found")); + } +} From 686667368bb7a9e04b94088651cc746debb15d2c Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 29 Jul 2026 15:24:29 -0500 Subject: [PATCH 235/283] Ensure URIs without a scheme are treated as "file" URIs as that's the only URI type we accept. (cherry picked from commit 31a5acc487a7a81a31cade764950390ba0c4c202) --- .../java/org/dspace/app/util/XMLUtils.java | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java index d3d22a61f848..419acdf320d3 100644 --- a/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java +++ b/dspace-api/src/main/java/org/dspace/app/util/XMLUtils.java @@ -12,6 +12,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.net.URI; +import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -349,13 +350,25 @@ public InputSource resolveEntity(String publicId, String systemId) fileUri = Paths.get(systemId).toUri(); } catch (Exception e2) { // Doesn't appear to be a valid URI or a Path, so we'll have to throw an error. - throw new SAXException("Invalid path: " + systemId, e2); + throw new SAXException("Invalid URI or path: " + systemId, e2); } } - // Only allow for "file" scheme or empty scheme String scheme = fileUri.getScheme(); - if (scheme != null && !"file".equalsIgnoreCase(scheme)) { + + // If our URI has a null scheme, that means it's a relative URI or missing its scheme (e.g. /tmp/path) + // Because we only accept file URIs, we'll attempt to recreate it as a file URI. + if (scheme == null) { + try { + fileUri = new URI("file", fileUri.getSchemeSpecificPart(), fileUri.getFragment()); + scheme = fileUri.getScheme(); + } catch (URISyntaxException e) { + throw new SAXException("Cannot convert to absolute file URI:" + systemId, e); + } + } + + // Only allow for "file" scheme + if (!"file".equalsIgnoreCase(scheme)) { throw new SAXException("External resources not allowed: " + systemId + ". Only local file paths are permitted."); } @@ -480,7 +493,7 @@ public PathRestrictedURIResolver(String... allowedBasePaths) { @Override public Source resolve(String href, String base) throws TransformerException { - final URI uri; + URI uri; // Base path is optional, as the "href" might already be an absolute path if (base == null || base.isEmpty()) { uri = URI.create(href); @@ -488,9 +501,21 @@ public Source resolve(String href, String base) throws TransformerException { uri = URI.create(base).resolve(href); } - // Only allow for "file" scheme or empty scheme String scheme = uri.getScheme(); - if (scheme != null && !"file".equalsIgnoreCase(scheme)) { + + // If our URI has a null scheme, that means it's a relative URI or missing its scheme (e.g. /tmp/path) + // Because we only accept file URIs, we'll attempt to recreate it as a file URI. + if (scheme == null) { + try { + uri = new URI("file", uri.getSchemeSpecificPart(), uri.getFragment()); + scheme = uri.getScheme(); + } catch (URISyntaxException e) { + throw new TransformerException("Cannot convert to absolute file URI:" + uri, e); + } + } + + // Only allow for "file" scheme + if (!"file".equalsIgnoreCase(scheme)) { throw new TransformerException("External resources not allowed: " + uri + ". Only local file paths are permitted."); } From cff9dd67548bae98b046fc9ffdb1bff1d402a633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Mi=C5=82osz?= Date: Mon, 10 Aug 2026 14:06:05 +0200 Subject: [PATCH 236/283] fix: correct HTTP success status code validation in OrcidRestConnector #11674 (cherry picked from commit 7b7dd557ea4272398c20b0a769e30ed4f4f7ad7a) --- .../src/main/java/org/dspace/external/OrcidRestConnector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/external/OrcidRestConnector.java b/dspace-api/src/main/java/org/dspace/external/OrcidRestConnector.java index 3d61462cc354..a8a90c33c1ef 100644 --- a/dspace-api/src/main/java/org/dspace/external/OrcidRestConnector.java +++ b/dspace-api/src/main/java/org/dspace/external/OrcidRestConnector.java @@ -76,11 +76,11 @@ public static String trimSlashes(String path) { private boolean isSuccessful(HttpResponse response) { int statusCode = getStatusCode(response); - return statusCode >= 200 || statusCode <= 299; + return statusCode >= 200 && statusCode <= 299; } private int getStatusCode(HttpResponse response) { return response.getStatusLine().getStatusCode(); } -} \ No newline at end of file +} From dfe46d40366e9884b4fe522886ebe8fa0fe1bee5 Mon Sep 17 00:00:00 2001 From: gaganag50 <29420591+gaganag50@users.noreply.github.com> Date: Sat, 4 Jul 2026 20:45:28 +0530 Subject: [PATCH 237/283] Report actual target directory in batch import unzip error log When unzip(File, String) is given a destDir that is not a valid directory, the error log printed the value of the org.dspace.app.batchitemimport.work.dir config property instead of the directory actually in use. For UI imports (processUIImport), which pass their own dataDir as destDir, this logged a misleading path. Log the actual destinationDir that was validated so the message matches the directory that was really used. Fixes #11954 (cherry picked from commit 94d768c154d505c4116e71d171539c2a21078759) --- .../java/org/dspace/app/itemimport/ItemImportServiceImpl.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java index 7685ffc8f323..5bf40a3cd32a 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java @@ -1975,9 +1975,7 @@ public String unzip(File zipfile, String destDir) throws IOException { File tempdir = new File(destinationDir); if (!tempdir.isDirectory()) { - logError("'" + configurationService.getProperty("org.dspace.app.batchitemimport.work.dir") + - "' as defined by the key 'org.dspace.app.batchitemimport.work.dir' in dspace.cfg " + - "is not a valid directory"); + logError("'" + destinationDir + "' is not a valid directory"); } if (!tempdir.exists() && !tempdir.mkdirs()) { From 97e904a15cfbb8ffaab3c1d567ecf0677cc19ac5 Mon Sep 17 00:00:00 2001 From: Tina Schoenborn Date: Thu, 30 Jul 2026 17:34:00 +0200 Subject: [PATCH 238/283] fix bug where workflow item would trigger a nullpointer when checked for versionhistory (cherry picked from commit 74458a03bb06e04c63396eb894be2d9400175b40) --- .../src/main/java/org/dspace/versioning/VersionHistory.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace-api/src/main/java/org/dspace/versioning/VersionHistory.java b/dspace-api/src/main/java/org/dspace/versioning/VersionHistory.java index f207fe8d4f03..5cc055adbdf1 100644 --- a/dspace-api/src/main/java/org/dspace/versioning/VersionHistory.java +++ b/dspace-api/src/main/java/org/dspace/versioning/VersionHistory.java @@ -106,6 +106,9 @@ public boolean equals(Object o) { if (this == o) { return true; } + if (o == null) { + return false; + } Class objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(o); if (!getClass().equals(objClass)) { return false; From 69261b066d1a8e323e59bed8464d985f247d0815 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 14:09:56 +0000 Subject: [PATCH 239/283] Bump toshimaru/auto-author-assign from 3.0.3 to 3.1.0 Bumps [toshimaru/auto-author-assign](https://github.com/toshimaru/auto-author-assign) from 3.0.3 to 3.1.0. - [Release notes](https://github.com/toshimaru/auto-author-assign/releases) - [Changelog](https://github.com/toshimaru/auto-author-assign/blob/main/CHANGELOG.md) - [Commits](https://github.com/toshimaru/auto-author-assign/compare/v3.0.3...v3.1.0) --- updated-dependencies: - dependency-name: toshimaru/auto-author-assign dependency-version: 3.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/pull_request_opened.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml index 7e7efc09a997..1e17cedcd179 100644 --- a/.github/workflows/pull_request_opened.yml +++ b/.github/workflows/pull_request_opened.yml @@ -21,4 +21,4 @@ jobs: # Assign the PR to whomever created it. This is useful for visualizing assignments on project boards # See https://github.com/toshimaru/auto-author-assign - name: Assign PR to creator - uses: toshimaru/auto-author-assign@v3.0.3 + uses: toshimaru/auto-author-assign@v3.1.0 From bf492ae8ddbbc3aa1c3d38f1547570095f2c7101 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 26 Aug 2026 09:55:13 +0300 Subject: [PATCH 240/283] Remove findbugs dependencies We switched to SpotBugs in 2020, as FindBugs has been unmaintained for some time. We do not use FindBugs anymore. See: https://github.com/DSpace/DSpace/pull/2971 --- dspace-api/pom.xml | 10 ---------- pom.xml | 14 -------------- 2 files changed, 24 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index 1a37a034b945..cb88ce3cbd85 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -684,16 +684,6 @@ ${flyway.version} - - - com.google.code.findbugs - jsr305 - - - com.google.code.findbugs - annotations - - jakarta.inject jakarta.inject-api diff --git a/pom.xml b/pom.xml index ab20a82254c1..846bdb22a6db 100644 --- a/pom.xml +++ b/pom.xml @@ -1747,20 +1747,6 @@ test - - - com.google.code.findbugs - jsr305 - 3.0.2 - provided - - - com.google.code.findbugs - annotations - 3.0.1u2 - provided - - com.fasterxml From 4f0b6cd9c5886f24574faf56bc04be6c621726a8 Mon Sep 17 00:00:00 2001 From: jjj-n <1357598741@qq.com> Date: Thu, 27 Aug 2026 11:16:07 +0800 Subject: [PATCH 241/283] Restrict collection item template access to submitters --- .../CollectionItemTemplateController.java | 2 +- .../rest/ItemTemplateRestControllerIT.java | 52 ++++++++++++++++--- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java index 10d877ec01ba..d3b3e13394f0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java @@ -144,7 +144,7 @@ public ResponseEntity> createTemplateItem(HttpServletRequ * @return The template item from the Collection in the request * @throws SQLException */ - @PreAuthorize("hasPermission(#uuid, 'COLLECTION', 'READ')") + @PreAuthorize("isAuthenticated() && hasPermission(#uuid, 'COLLECTION', 'ADD')") @RequestMapping(method = RequestMethod.GET) public TemplateItemResource getTemplateItem(HttpServletRequest request, @PathVariable UUID uuid) throws SQLException { diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemTemplateRestControllerIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemTemplateRestControllerIT.java index f3ba6d3aed1f..67c1f74ce6c1 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemTemplateRestControllerIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ItemTemplateRestControllerIT.java @@ -30,23 +30,19 @@ import org.dspace.app.rest.model.patch.Operation; import org.dspace.app.rest.model.patch.ReplaceOperation; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; -import org.dspace.authorize.service.ResourcePolicyService; import org.dspace.builder.CollectionBuilder; import org.dspace.builder.CommunityBuilder; +import org.dspace.builder.GroupBuilder; import org.dspace.builder.ResourcePolicyBuilder; import org.dspace.content.Collection; import org.dspace.core.Constants; import org.hamcrest.Matchers; import org.junit.Before; import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.web.servlet.MvcResult; public class ItemTemplateRestControllerIT extends AbstractControllerIntegrationTest { - @Autowired - ResourcePolicyService resourcePolicyService; - private ObjectMapper mapper; private String adminAuthToken; private Collection childCollection; @@ -168,16 +164,56 @@ public void getTemplateItemFromCollection() throws Exception { } @Test - public void getTemplateItemFromCollectionForbiddenTest() throws Exception { + public void getTemplateItemFromCollectionNotLoggedIn() throws Exception { setupTestTemplate(); - String itemUuidString = installTestTemplate(); + installTestTemplate(); + + getClient().perform(get(getCollectionTemplateItemUrlTemplate(childCollection.getID().toString()))) + .andExpect(status().isUnauthorized()); + } + + @Test + public void getTemplateItemFromCollectionNoRights() throws Exception { + setupTestTemplate(); + installTestTemplate(); - resourcePolicyService.removePolicies(context, childCollection, Constants.READ); String tokenEperson = getAuthToken(eperson.getEmail(), password); getClient(tokenEperson).perform(get(getCollectionTemplateItemUrlTemplate(childCollection.getID().toString()))) .andExpect(status().isForbidden()); } + @Test + public void getTemplateItemFromCollectionAsSubmitter() throws Exception { + setupTestTemplate(); + installTestTemplate(); + + GroupBuilder.createCollectionSubmitterGroup(context, childCollection) + .addMember(eperson) + .build(); + String submitterToken = getAuthToken(eperson.getEmail(), password); + + getClient(submitterToken) + .perform(get(getCollectionTemplateItemUrlTemplate(childCollection.getID().toString()))) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.type", is("itemtemplate"))); + } + + @Test + public void getTemplateItemFromCollectionAsCollectionAdmin() throws Exception { + setupTestTemplate(); + installTestTemplate(); + + GroupBuilder.createCollectionAdminGroup(context, childCollection) + .addMember(eperson) + .build(); + String collectionAdminToken = getAuthToken(eperson.getEmail(), password); + + getClient(collectionAdminToken) + .perform(get(getCollectionTemplateItemUrlTemplate(childCollection.getID().toString()))) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.type", is("itemtemplate"))); + } + @Test public void getTemplateItemFromItemId() throws Exception { setupTestTemplate(); From d3b6a794802067c0f08ae3eafafb3f021ffe1606 Mon Sep 17 00:00:00 2001 From: jjj-n <1357598741@qq.com> Date: Fri, 28 Aug 2026 10:13:44 +0800 Subject: [PATCH 242/283] Remove redundant item template authentication check --- .../org/dspace/app/rest/CollectionItemTemplateController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java index d3b3e13394f0..c7dc746eafe8 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/CollectionItemTemplateController.java @@ -144,7 +144,7 @@ public ResponseEntity> createTemplateItem(HttpServletRequ * @return The template item from the Collection in the request * @throws SQLException */ - @PreAuthorize("isAuthenticated() && hasPermission(#uuid, 'COLLECTION', 'ADD')") + @PreAuthorize("hasPermission(#uuid, 'COLLECTION', 'ADD')") @RequestMapping(method = RequestMethod.GET) public TemplateItemResource getTemplateItem(HttpServletRequest request, @PathVariable UUID uuid) throws SQLException { From e5c2b26805668f44352545c307c16767f7d13150 Mon Sep 17 00:00:00 2001 From: eric-pennecot Date: Thu, 27 Aug 2026 17:24:35 +0200 Subject: [PATCH 243/283] Grant write permission on automatically claimed researcher profile (cherry picked from commit ae4b965648321d77ec4958d2bdc8b3a6ccdae8ef) --- .../rest/login/impl/ResearcherProfileAutomaticClaim.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java index 8521da970b27..2244e706ea69 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java @@ -10,6 +10,7 @@ import static org.apache.commons.collections4.IteratorUtils.toList; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.dspace.content.authority.Choices.CF_ACCEPTED; +import static org.dspace.core.Constants.WRITE; import java.sql.SQLException; import java.util.List; @@ -22,6 +23,7 @@ import org.apache.logging.log4j.Logger; import org.dspace.app.rest.login.PostLoggedInAction; import org.dspace.authorize.AuthorizeException; +import org.dspace.authorize.service.AuthorizeService; import org.dspace.content.Item; import org.dspace.content.MetadataFieldName; import org.dspace.content.service.ItemService; @@ -54,6 +56,9 @@ public class ResearcherProfileAutomaticClaim implements PostLoggedInAction { @Autowired private EPersonService ePersonService; + @Autowired + private AuthorizeService authorizeService; + /** * The field of the eperson to search for. */ @@ -104,6 +109,7 @@ private void claimProfile(Context context, EPerson currentUser) throws SQLExcept if (item != null) { itemService.addMetadata(context, item, "dspace", "object", "owner", null, fullName, id.toString(), CF_ACCEPTED); + authorizeService.addPolicy(context, item, WRITE, currentUser); } } From 81f251aa2eeb69fa9548899ca88bc942ed137f43 Mon Sep 17 00:00:00 2001 From: eric-pennecot Date: Thu, 27 Aug 2026 17:25:20 +0200 Subject: [PATCH 244/283] Add assertions for WRITE policy and canEditMetadata authorization on claimed item (cherry picked from commit ac5754c9acf7cdf0a05d26367c0995793a4265e2) --- .../rest/ResearcherProfileRestRepositoryIT.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java index a0c66cddb70e..687efcef9c6f 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java @@ -1028,6 +1028,22 @@ public void testAutomaticProfileClaimByEmailWithRegularEntity() throws Exception String secondItemId = getItemIdByProfileId(newUserToken, id); assertEquals("The item should be the same", firstItemId, secondItemId); + getClient(getAuthToken(admin.getEmail(), password)) + .perform(get("/api/authz/resourcepolicies/search/resource") + .param("uuid", firstItemId)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.resourcepolicies", + hasItem(matchResourcePolicyProperties(null, user, itemToBeClaimed, null, + Constants.WRITE, null)))); + + getClient(newUserToken) + .perform(get("/api/authz/authorizations/search/object") + .param("uri", "http://localhost/api/core/items/" + firstItemId) + .param("feature", "canEditMetadata") + .param("embed", "feature")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.authorizations[0]._embedded.feature.id") + .value("canEditMetadata")); } @Test From baabb14e5ce05364b1bcaef48a6ffb499d15d5c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:17:27 +0000 Subject: [PATCH 245/283] Bump the apache-commons group across 1 directory with 2 updates Bumps the apache-commons group with 2 updates in the / directory: org.apache.commons:commons-collections4 and [commons-validator:commons-validator](https://github.com/apache/commons-validator). Updates `org.apache.commons:commons-collections4` from 4.5.0 to 4.6.0 Updates `commons-validator:commons-validator` from 1.10.1 to 1.11.0 - [Changelog](https://github.com/apache/commons-validator/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-validator/compare/rel/commons-validator-1.10.1...rel/commons-validator-1.11.0) --- updated-dependencies: - dependency-name: commons-validator:commons-validator dependency-version: 1.11.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons - dependency-name: org.apache.commons:commons-collections4 dependency-version: 4.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: apache-commons ... Signed-off-by: dependabot[bot] --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 846bdb22a6db..7e5b1d51107c 100644 --- a/pom.xml +++ b/pom.xml @@ -1515,7 +1515,7 @@ org.apache.commons commons-collections4 - 4.5.0 + 4.6.0 org.apache.commons @@ -1574,7 +1574,7 @@ commons-validator commons-validator - 1.10.1 + 1.11.0 jakarta.activation From fba2a68245154b43b435e0ff9d976c72773b8d15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:17:48 +0000 Subject: [PATCH 246/283] Bump the build-tools group with 2 updates Bumps the build-tools group with 2 updates: [com.github.spotbugs:spotbugs](https://github.com/spotbugs/spotbugs) and [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin). Updates `com.github.spotbugs:spotbugs` from 4.10.3 to 4.10.4 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.10.3...4.10.4) Updates `com.github.spotbugs:spotbugs-maven-plugin` from 4.10.3.0 to 4.10.4.0 - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.10.3.0...spotbugs-maven-plugin-4.10.4.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs dependency-version: 4.10.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-version: 4.10.4.0 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: build-tools ... Signed-off-by: dependabot[bot] --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 846bdb22a6db..92c96153605c 100644 --- a/pom.xml +++ b/pom.xml @@ -315,7 +315,7 @@ com.github.spotbugs spotbugs-maven-plugin - 4.10.3.0 + 4.10.4.0 Max Low @@ -325,7 +325,7 @@ com.github.spotbugs spotbugs - 4.10.3 + 4.10.4 From 12cb45410db491580ba58d2457adf09ef508dd21 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:30:06 +0000 Subject: [PATCH 247/283] Bump the test-tools group across 1 directory with 2 updates Bumps the test-tools group with 2 updates in the / directory: [org.xmlunit:xmlunit-core](https://github.com/xmlunit/xmlunit) and [org.apache.httpcomponents.client5:httpclient5](https://github.com/apache/httpcomponents-client). Updates `org.xmlunit:xmlunit-core` from 2.12.0 to 2.13.0 - [Release notes](https://github.com/xmlunit/xmlunit/releases) - [Changelog](https://github.com/xmlunit/xmlunit/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/xmlunit/xmlunit/compare/v2.12.0...v2.13.0) Updates `org.apache.httpcomponents.client5:httpclient5` from 5.6.3 to 5.6.4 - [Changelog](https://github.com/apache/httpcomponents-client/blob/rel/v5.6.4/RELEASE_NOTES.txt) - [Commits](https://github.com/apache/httpcomponents-client/compare/rel/v5.6.3...rel/v5.6.4) --- updated-dependencies: - dependency-name: org.apache.httpcomponents.client5:httpclient5 dependency-version: 5.6.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: test-tools - dependency-name: org.xmlunit:xmlunit-core dependency-version: 2.13.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: test-tools ... Signed-off-by: dependabot[bot] --- dspace-api/pom.xml | 2 +- dspace-server-webapp/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dspace-api/pom.xml b/dspace-api/pom.xml index cb88ce3cbd85..24341c3a28a9 100644 --- a/dspace-api/pom.xml +++ b/dspace-api/pom.xml @@ -795,7 +795,7 @@ org.xmlunit xmlunit-core - 2.12.0 + 2.13.0 test diff --git a/dspace-server-webapp/pom.xml b/dspace-server-webapp/pom.xml index 5c84efe4aa5c..c8dfe6504d90 100644 --- a/dspace-server-webapp/pom.xml +++ b/dspace-server-webapp/pom.xml @@ -588,7 +588,7 @@ org.apache.httpcomponents.client5 httpclient5 - 5.6.3 + 5.6.4 test From a96f456649284b4e183d97f8f003e470c2288489 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:34:48 +0000 Subject: [PATCH 248/283] Bump the fasterxml group across 1 directory with 3 updates Bumps the fasterxml group with 3 updates in the / directory: [com.fasterxml.jackson.core:jackson-core](https://github.com/FasterXML/jackson-core), [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson-databind) and com.fasterxml.jackson.datatype:jackson-datatype-jsr310. Updates `com.fasterxml.jackson.core:jackson-core` from 2.22.1 to 2.22.2 - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.22.1...jackson-core-2.22.2) Updates `com.fasterxml.jackson.core:jackson-databind` from 2.22.1 to 2.22.2 - [Commits](https://github.com/FasterXML/jackson-databind/compare/jackson-databind-2.22.1...jackson-databind-2.22.2) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.22.1 to 2.22.2 Updates `com.fasterxml.jackson.core:jackson-databind` from 2.22.1 to 2.22.2 - [Commits](https://github.com/FasterXML/jackson-databind/compare/jackson-databind-2.22.1...jackson-databind-2.22.2) Updates `com.fasterxml.jackson.datatype:jackson-datatype-jsr310` from 2.22.1 to 2.22.2 --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-version: 2.22.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.22.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.22.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.22.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml - dependency-name: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 dependency-version: 2.22.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: fasterxml ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 846bdb22a6db..91b7e1e681bb 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 3.12.0 2.42.0 - 2.22.1 + 2.22.2 2.22 2.1.1 4.0.5 From 719727b800e4cc9bfcacf0e631838720c725f987 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Sep 2026 02:36:43 +0000 Subject: [PATCH 249/283] Bump actions/setup-java from 5 to 6 in the github-actions group Bumps the github-actions group with 1 update: [actions/setup-java](https://github.com/actions/setup-java). Updates `actions/setup-java` from 5 to 6 - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-java dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/codescan.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ac3ecbe77869..5ca99bfe89ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: # https://github.com/actions/setup-java - name: Install JDK ${{ matrix.java }} - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: java-version: ${{ matrix.java }} distribution: 'temurin' diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index 1ae63dd41eba..5db501b72d77 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -42,7 +42,7 @@ jobs: # https://github.com/actions/setup-java - name: Install JDK - uses: actions/setup-java@v5 + uses: actions/setup-java@v6 with: java-version: 17 distribution: 'temurin' From 23746e0b5a6e2f88efeadd4b756c0e97b37670e6 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 6 Aug 2026 15:42:19 -0500 Subject: [PATCH 250/283] Protect against path traversal attacks in "import" script when run from REST API or CLI. Validate the filename input is in an expected directory (cherry picked from commit 285850b30d58acb5818f487f00f1d5f762f1ed84) --- .../org/dspace/app/itemimport/ItemImport.java | 14 ++++++++-- .../dspace/app/itemimport/ItemImportCLI.java | 28 +++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java index 33487bc8e35a..8665991129e4 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImport.java @@ -13,6 +13,7 @@ import java.io.InputStream; import java.net.URL; import java.nio.file.Files; +import java.nio.file.Path; import java.sql.SQLException; import java.util.ArrayList; import java.util.Date; @@ -39,6 +40,7 @@ import org.dspace.handle.factory.HandleServiceFactory; import org.dspace.handle.service.HandleService; import org.dspace.scripts.DSpaceRunnable; +import org.dspace.storage.secure.SecureFileAccess; import org.dspace.utils.DSpace; /** @@ -351,8 +353,16 @@ protected void readZip(Context context, ItemImportService itemImportService) thr validateZip(validationFileStream.get()); } - workFile = new File(itemImportService.getTempWorkDir() + File.separator - + zipfilename + "-" + context.getCurrentUser().getID()); + String workDir = itemImportService.getTempWorkDir(); + + // zipfilename is user controlled (via -z or -u param). So, we must validate the expected + // file path using SecureFileAccess to protect against path traversal attacks. + String fileName = zipfilename + "-" + context.getCurrentUser().getID(); + String fileAbsolutePath = SecureFileAccess.calculateAbsolutePathUsingBaseDir(fileName, workDir); + Path validatedFilePath = SecureFileAccess.validatePathForWrite(fileAbsolutePath, List.of(workDir), + "ItemImport zip validation"); + + workFile = validatedFilePath.toFile(); FileUtils.copyInputStreamToFile(optionalFileStream.get(), workFile); } else { throw new IllegalArgumentException( diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportCLI.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportCLI.java index bd29aa97fe48..4693a9e2aa26 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportCLI.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportCLI.java @@ -11,6 +11,7 @@ import java.io.FileInputStream; import java.io.InputStream; import java.net.URL; +import java.nio.file.Path; import java.sql.SQLException; import java.util.List; import java.util.Optional; @@ -23,6 +24,7 @@ import org.dspace.content.Collection; import org.dspace.core.Context; import org.dspace.eperson.EPerson; +import org.dspace.storage.secure.SecureFileAccess; /** * CLI variant for the {@link ItemImport} class. @@ -103,8 +105,14 @@ protected void readZip(Context context, ItemImportService itemImportService) thr // If this is a zip archive, unzip it first if (zip) { if (!remoteUrl) { + // zipfilename is user controlled (via -z or -u param). So, we must validate the expected + // file path using SecureFileAccess to protect against path traversal attacks. + String fileAbsolutePath = SecureFileAccess.calculateAbsolutePathUsingBaseDir(zipfilename, sourcedir); + Path validatedZipPath = SecureFileAccess.validatePathForRead(fileAbsolutePath, List.of(sourcedir), + "ItemImportCLI zip validation"); + File myZipFile = validatedZipPath.toFile(); + // confirm zip file exists - File myZipFile = new File(sourcedir + File.separator + zipfilename); if ((!myZipFile.exists()) || (!myZipFile.isFile())) { throw new IllegalArgumentException( "Error reading file, the file couldn't be found for filename: " + zipfilename); @@ -120,8 +128,7 @@ protected void readZip(Context context, ItemImportService itemImportService) thr workDir = new File(itemImportService.getTempWorkDir() + File.separator + TEMP_DIR + File.separator + context.getCurrentUser().getID()); - sourcedir = itemImportService.unzip( - new File(sourcedir + File.separator + zipfilename), workDir.getAbsolutePath()); + sourcedir = itemImportService.unzip(myZipFile, workDir.getAbsolutePath()); } else { // manage zip via remote url Optional optionalFileStream = Optional.ofNullable(new URL(zipfilename).openStream()); @@ -134,10 +141,19 @@ protected void readZip(Context context, ItemImportService itemImportService) thr validateZip(validationFileStream.get()); } - workFile = new File(itemImportService.getTempWorkDir() + File.separator - + zipfilename + "-" + context.getCurrentUser().getID()); + // zipfilename is user controlled (via -z or -u param). So, we must validate the expected + // file path using SecureFileAccess to protect against path traversal attacks. + String tempWorkDir = itemImportService.getTempWorkDir(); + String zipName = zipfilename + "-" + context.getCurrentUser().getID(); + String fileAbsolutePath = SecureFileAccess.calculateAbsolutePathUsingBaseDir(zipName, + tempWorkDir); + Path validatedZipPath = SecureFileAccess + .validatePathForWrite(fileAbsolutePath, List.of(tempWorkDir), + "ItemImportCLI remote zip validation"); + + workFile = validatedZipPath.toFile(); FileUtils.copyInputStreamToFile(optionalFileStream.get(), workFile); - workDir = new File(itemImportService.getTempWorkDir() + File.separator + TEMP_DIR + workDir = new File(tempWorkDir + File.separator + TEMP_DIR + File.separator + context.getCurrentUser().getID()); sourcedir = itemImportService.unzip(workFile, workDir.getAbsolutePath()); } else { From 0a0c7733b952c8bd1e2f4c45eb4e3afbd31f9f9c Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 6 Aug 2026 15:43:47 -0500 Subject: [PATCH 251/283] For consistency, update ItemImportServiceImpl.unzip() to use SecureFileAccess to validate unzip location. (NOTE: current code is already secure. This just updates the code to consistently use SecureFileAccess) (cherry picked from commit 6b71fdfb7d5e234cb28be8f1e8b7b0cc58b31eb3) --- .../app/itemimport/ItemImportServiceImpl.java | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java index 5bf40a3cd32a..20408be781ae 100644 --- a/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java +++ b/dspace-api/src/main/java/org/dspace/app/itemimport/ItemImportServiceImpl.java @@ -109,6 +109,7 @@ import org.dspace.handle.service.HandleService; import org.dspace.scripts.handler.DSpaceRunnableHandler; import org.dspace.services.ConfigurationService; +import org.dspace.storage.secure.SecureFileAccess; import org.dspace.workflow.WorkflowItem; import org.dspace.workflow.WorkflowService; import org.springframework.beans.factory.InitializingBean; @@ -200,7 +201,7 @@ public void afterPropertiesSet() throws Exception { //Ensure tempWorkDir exists File tempWorkDirFile = new File(tempWorkDir); if (!tempWorkDirFile.exists()) { - boolean success = tempWorkDirFile.mkdir(); + boolean success = tempWorkDirFile.mkdirs(); if (success) { logInfo("Created org.dspace.app.batchitemimport.work.dir of: " + tempWorkDir); } else { @@ -1982,9 +1983,14 @@ public String unzip(File zipfile, String destDir) throws IOException { logError("Unable to create temporary directory: " + tempdir.getAbsolutePath()); } String sourcedir = destinationDir + System.getProperty("file.separator") + zipfile.getName(); - String zipDir = destinationDir + System.getProperty("file.separator") + zipfile.getName() + System - .getProperty("file.separator"); + String zipDir = sourcedir + System.getProperty("file.separator"); + File sourcedirFile = new File(sourcedir); + // Create the source directory we will be unzipping into. We must pre-create this directory to validate + // the final path of each zip entry using SecureFileAccess (see below) + if (!sourcedirFile.exists() && !sourcedirFile.mkdirs()) { + logError("Unable to create directory for unzipping: " + sourcedir); + } // 3 String sourceDirForZip = sourcedir; @@ -1995,13 +2001,22 @@ public String unzip(File zipfile, String destDir) throws IOException { while (entries.hasMoreElements()) { entry = entries.nextElement(); String entryName = entry.getName(); - File outFile = new File(zipDir + entryName); + // Verify that this file/directory will be extracted into our zipDir (and not somewhere else!) - if (!outFile.toPath().normalize().startsWith(zipDir)) { + Path validatedOutPath; + try { + String fileAbsolutePath = + SecureFileAccess.calculateAbsolutePathUsingBaseDir(entryName, zipDir); + validatedOutPath = SecureFileAccess.validatePathForWrite(fileAbsolutePath, List.of(zipDir), + "ItemImport zip entry extraction"); + } catch (IOException e) { throw new IOException("Bad zip entry: '" + entryName + "' in file '" + zipfile.getAbsolutePath() + "'!" - + " Cannot process this file or directory."); + + " Cannot process this file or directory.", e); } + + File outFile = validatedOutPath.toFile(); + if (entry.isDirectory()) { if (!outFile.mkdirs()) { logError("Unable to create contents directory: " + zipDir + entry.getName()); @@ -2047,6 +2062,13 @@ public String unzip(File zipfile, String destDir) throws IOException { out.close(); } } + } catch (Exception e) { + // If an error occurs in unzipping, cleanup the directory we were unzipping this file into + if (sourcedirFile.exists()) { + FileUtils.deleteDirectory(sourcedirFile); + } + // Then throw error upwards + throw e; } finally { //Close zip file zf.close(); From a33fd66d1118724517626ef4b7794f2091773e41 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 6 Aug 2026 15:45:29 -0500 Subject: [PATCH 252/283] Add a basic "fail fast" validation of file paths for ALL scripts. This may not offer full protection against path traversal, but it makes it more difficult by validating files passed into scripts cannot use path characters in their name. (cherry picked from commit f005011a99a84871ba7a2777d8e035aa436cec65) --- .../org/dspace/app/rest/repository/ScriptRestRepository.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java index e26f91c88981..87b03dc11715 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/ScriptRestRepository.java @@ -191,6 +191,11 @@ private void checkFileNames(DSpaceRunnable dSpaceRunnable, List f String fileName = file.getOriginalFilename(); if (fileNames.contains(fileName)) { throw new UnprocessableEntityException("There are two files with the same name: " + fileName); + } else if (StringUtils.containsAny(fileName, "..", "/", "\\")) { + // NOTE: This is just a "fail-fast", basic protection against a potential path traversal attack. + // Individual scripts MUST also contain their own path traversal protections. + throw new UnprocessableEntityException( + "Filenames cannot contain path characters such as '..', '/', or '\\' : " + fileName); } else { fileNames.add(fileName); } From 6ebe06a00fe81c21e1bda81712a1787f6c99c606 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Thu, 6 Aug 2026 15:49:00 -0500 Subject: [PATCH 253/283] Add an integration test that proves traversal attacks are now blocked in ItemImport. This test fails on current "main" branch (cherry picked from commit 1a2844bc909ea8a07fe34be308f3484062b31817) --- .../dspace/app/itemimport/ItemImportIT.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java index 68511a9d8921..20ee48f78626 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java @@ -59,6 +59,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.mock.web.MockMultipartFile; +import org.springframework.test.web.servlet.ResultMatcher; /** * Basic integration testing for the SAF Import feature via UI {@link ItemImport}. @@ -134,6 +135,39 @@ public void importItemByZipSafWithBitstreams() throws Exception { assertTrue(workTempDir.exists()); } + @Test + public void importItemUsingInvalidZipName() throws Exception { + String zipfileName = "saf-bitstreams.zip"; + // This zip name is invalid as it must only contain a file name. + // This is an example path traversal attack. + String badZipFileName = "../../../" + zipfileName; + + // First attack attempt. Provide a path traversal via both "-z" param and "filename" of multipart request. + LinkedList parameters = new LinkedList<>(); + parameters.add(new DSpaceCommandLineParameter("-a", "")); + parameters.add(new DSpaceCommandLineParameter("-c", collection.getID().toString())); + parameters.add(new DSpaceCommandLineParameter("-z", badZipFileName)); + MockMultipartFile bitstreamFile = new MockMultipartFile("file", badZipFileName, + MediaType.APPLICATION_OCTET_STREAM_VALUE, + getClass().getResourceAsStream("saf-bitstreams.zip")); + + // Verify this import will fail and throw a 422 error + performImportScriptExpectError(parameters, bitstreamFile, status().isUnprocessableEntity()); + + // Second attack attempt. Provide a path traversal via "-z" param but a VALID file in "filename" + // of multipart request. + parameters = new LinkedList<>(); + parameters.add(new DSpaceCommandLineParameter("-a", "")); + parameters.add(new DSpaceCommandLineParameter("-c", collection.getID().toString())); + parameters.add(new DSpaceCommandLineParameter("-z", badZipFileName)); + bitstreamFile = new MockMultipartFile("file", zipfileName, + MediaType.APPLICATION_OCTET_STREAM_VALUE, + getClass().getResourceAsStream("saf-bitstreams.zip")); + + // Verify this import will also fail and throw a 422 error + performImportScriptExpectError(parameters, bitstreamFile, status().isUnprocessableEntity()); + } + @Test public void importItemByZipSafWithRelationships() throws Exception { context.turnOffAuthorisationSystem(); @@ -263,4 +297,23 @@ private void checkProcess(Process process) { .filter(b -> StringUtils.contains(b.getName(), ".zip")) .count()); } + + private void performImportScriptExpectError(LinkedList parameters, + MockMultipartFile bitstreamFile, + ResultMatcher expectedErrorMatcher) + throws Exception { + List list = parameters.stream() + .map(dSpaceCommandLineParameter -> dSpaceRunnableParameterConverter + .convert(dSpaceCommandLineParameter, Projection.DEFAULT)) + .collect(Collectors.toList()); + + AtomicReference idRef = new AtomicReference<>(); + + // Verify process fails + getClient(getAuthToken(admin.getEmail(), password)) + .perform(multipart("/api/system/scripts/import/processes") + .file(bitstreamFile) + .param("properties", mapper.writeValueAsString(list))) + .andExpect(expectedErrorMatcher); + } } From 4acefc37c0d94b235b979bfbba37c0a623e73e6d Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Tue, 1 Sep 2026 16:13:04 -0500 Subject: [PATCH 254/283] Harden /version/{id}/item endpoint with @PreAuthorize. Add tests to prove functionality. (cherry picked from commit c0b7ceb0c8388216c59ba9ab86d608b13367f429) --- .../repository/VersionItemLinkRepository.java | 2 + .../app/rest/VersionRestRepositoryIT.java | 48 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java index d171492e9fa1..265649a5fcc5 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/VersionItemLinkRepository.java @@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.data.rest.webmvc.ResourceNotFoundException; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.stereotype.Component; /** @@ -44,6 +45,7 @@ public class VersionItemLinkRepository extends AbstractDSpaceRestRepository * @return The ItemRest object that is relevant for the Version * @throws SQLException If something goes wrong */ + @PreAuthorize("@versioningSecurity.isEnableVersioning() && hasPermission(#versionId, 'VERSION', 'READ')") public ItemRest getVersionItem(@Nullable HttpServletRequest request, Integer versionId, @Nullable Pageable optionalPageable, diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/VersionRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/VersionRestRepositoryIT.java index daec24d29e70..0418643a58a8 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/VersionRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/VersionRestRepositoryIT.java @@ -84,8 +84,12 @@ public class VersionRestRepositoryIT extends AbstractControllerIntegrationTest { private Item item; + private Item adminOnlyItem; + private Version version; + private Version adminOnlyVersion; + @Autowired private VersioningService versioningService; @@ -114,7 +118,7 @@ public void setup() throws SQLException, AuthorizeException { context.turnOffAuthorisationSystem(); //** GIVEN ** - //1. A community-collection structure with one parent community with sub-community and two collections. + //1. A community-collection structure with one parent community with sub-community and one collection. parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); @@ -123,7 +127,7 @@ public void setup() throws SQLException, AuthorizeException { .build(); Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build(); - //2. Three public items that are readable by Anonymous with different subjects + //2. One public item that is readable by Anonymous item = ItemBuilder.createItem(context, col1) .withTitle("Public item 1") .withIssueDate("2017-10-17") @@ -132,6 +136,21 @@ public void setup() throws SQLException, AuthorizeException { .build(); version = VersionBuilder.createVersion(context, item, "Fixing some typos").build(); + + //3. One Admin-Only Item, created by the Admin user + context.setCurrentUser(admin); + adminOnlyItem = ItemBuilder.createItem(context, col1) + .withTitle("Admin-Only item") + .withIssueDate("2017-10-17") + .withAuthor("Smith, Donald").withAuthor("Doe, John") + .withSubject("Private") + .withReaderGroup(context.getAdminGroup()) + .build(); + adminOnlyVersion = VersionBuilder.createVersion(context, item, "Fixing some typos").build(); + + // Revert current user to EPerson for all tests + context.setCurrentUser(eperson); + context.restoreAuthSystemState(); } @@ -274,6 +293,31 @@ public void versionItemTest() throws Exception { .andExpect(jsonPath("$", Matchers.is(ItemMatcher.matchItemProperties(version.getItem())))); } + @Test + public void versionRestrictedItemAdminTest() throws Exception { + String adminToken = getAuthToken(admin.getEmail(), password); + + // The Admin-only item is visible to Admin + getClient(adminToken).perform(get("/api/versioning/versions/" + adminOnlyVersion.getID() + "/item")) + .andExpect(status().isOk()); + } + + @Test + public void versionRestrictedItemForbiddenUserTest() throws Exception { + String epersonToken = getAuthToken(eperson.getEmail(), password); + + // The Admin-only item is not visible to another user + getClient(epersonToken).perform(get("/api/versioning/versions/" + adminOnlyVersion.getID() + "/item")) + .andExpect(status().isForbidden()); + } + + @Test + public void versionRestrictedItemAnonymousTest() throws Exception { + // Anonymous user cannot access info about an Admin-only item + getClient().perform(get("/api/versioning/versions/" + adminOnlyVersion.getID() + "/item")) + .andExpect(status().isUnauthorized()); + } + @Test public void versionItemTestWrongId() throws Exception { From fea7ccdd4b7ccaaaead3ce29b4fb6d0babbb036c Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 2 Sep 2026 11:03:51 -0500 Subject: [PATCH 255/283] Fix compilation error in backport by wiring in the ObjectMapper initialized by Spring Boot --- .../src/test/java/org/dspace/app/itemimport/ItemImportIT.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java index 20ee48f78626..708a41c82ac9 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/itemimport/ItemImportIT.java @@ -82,6 +82,9 @@ public class ItemImportIT extends AbstractEntityIntegrationTest { private ProcessService processService; @Autowired private DSpaceRunnableParameterConverter dSpaceRunnableParameterConverter; + @Autowired + private ObjectMapper mapper; + private Collection collection; private Path workDir; private static final String TEMP_DIR = ItemImport.TEMP_DIR; From 75869fcecd7c84522fe2d67f5599457406139f1d Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Sat, 20 Jun 2026 21:12:14 +0200 Subject: [PATCH 256/283] add validation of JSON payload in /api/epersons/registrations REST endpoint --- .../app/rest/model/RegistrationRest.java | 8 +- .../RegistrationRestRepository.java | 123 ++++++++++++------ .../rest/RegistrationRestRepositoryIT.java | 76 +++++++++++ 3 files changed, 167 insertions(+), 40 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java index eb7c58a18cba..efa806d9a762 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java @@ -10,8 +10,11 @@ import java.util.UUID; import com.fasterxml.jackson.annotation.JsonProperty; -import org.dspace.app.rest.RestResourceController; +import jakarta.validation.constraints.Email; +import jakarta.validation.constraints.NotEmpty; + +import org.dspace.app.rest.RestResourceController; /** * This class acts as the REST representation of the RegistrationData model class. @@ -24,7 +27,10 @@ public class RegistrationRest extends RestAddressableModel { public static final String PLURAL_NAME = "registrations"; public static final String CATEGORY = EPERSON; + @Email + @NotEmpty private String email; + private UUID user; /** diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java index 9c1c3b393bbb..c85602e0e109 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java @@ -13,6 +13,9 @@ import java.sql.SQLException; import com.fasterxml.jackson.databind.ObjectMapper; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; +import java.util.Set; import jakarta.mail.MessagingException; import jakarta.servlet.ServletInputStream; import jakarta.servlet.http.HttpServletRequest; @@ -79,6 +82,12 @@ public class RegistrationRestRepository extends DSpaceRestRepository findAll(Context context, Pageable pageable) { @Override public RegistrationRest createAndReturn(Context context) { HttpServletRequest request = requestService.getCurrentRequest().getHttpServletRequest(); - ObjectMapper mapper = new ObjectMapper(); - RegistrationRest registrationRest; String accountType = request.getParameter(TYPE_QUERY_PARAM); if (StringUtils.isBlank(accountType) || (!accountType.equalsIgnoreCase(TYPE_FORGOT) && !accountType.equalsIgnoreCase(TYPE_REGISTER))) { @@ -112,61 +119,42 @@ public RegistrationRest createAndReturn(Context context) { } } + RegistrationRest registrationRest; try { ServletInputStream input = request.getInputStream(); registrationRest = mapper.readValue(input, RegistrationRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("Error parsing request body.", e1); } - if (StringUtils.isBlank(registrationRest.getEmail())) { - throw new UnprocessableEntityException("The email cannot be omitted from the Registration endpoint"); + + // Validation of deserialized object + Set> violations = validator.validate(registrationRest); + if (violations != null && !violations.isEmpty()) { + StringBuilder sb = new StringBuilder(); + for (ConstraintViolation v : violations) { + sb.append(v.getPropertyPath()) + .append(": ") + .append(v.getMessage()) + .append("; "); + } + throw new UnprocessableEntityException("Validation error: " + sb.toString()); } + EPerson eperson = null; try { eperson = ePersonService.findByEmail(context, registrationRest.getEmail()); } catch (SQLException e) { log.error("Something went wrong retrieving EPerson for email: " + registrationRest.getEmail(), e); } + if (eperson != null && accountType.equalsIgnoreCase(TYPE_FORGOT)) { - try { - if (!AuthorizeUtil.authorizeForgotPassword()) { - throw new AccessDeniedException("Password reset is not allowed!"); - } - if (!AuthorizeUtil.authorizeUpdatePassword(context, eperson.getEmail())) { - throw new DSpaceBadRequestException("Password cannot be updated for the given EPerson with email: " - + eperson.getEmail()); - } - accountService.sendForgotPasswordInfo(context, registrationRest.getEmail()); - } catch (SQLException | IOException | MessagingException | AuthorizeException e) { - log.error("Something went wrong with sending forgot password info email: " - + registrationRest.getEmail(), e); - } + resetPassword(context, registrationRest, eperson); } else if (accountType.equalsIgnoreCase(TYPE_REGISTER)) { if (eperson == null) { - try { - String email = registrationRest.getEmail(); - if (!AuthorizeUtil.authorizeNewAccountRegistration(context, request)) { - throw new AccessDeniedException( - "Registration is disabled, you are not authorized to create a new Authorization"); - } - if (!authenticationService.canSelfRegister(context, request, email)) { - throw new UnprocessableEntityException( - String.format("Registration is not allowed with email address" + - " %s", email)); - } - accountService.sendRegistrationInfo(context, email); - } catch (SQLException | IOException | MessagingException | AuthorizeException e) { - log.error("Something went wrong with sending registration info email: " - + registrationRest.getEmail(), e); - } + registerEperson(context, request, registrationRest); } else { // if an eperson with this email already exists then send "forgot password" email instead - try { - accountService.sendForgotPasswordInfo(context, registrationRest.getEmail()); - } catch (SQLException | IOException | MessagingException | AuthorizeException e) { - log.error("Something went wrong with sending forgot password info email: " - + registrationRest.getEmail(), e); - } + resetPassword(context, registrationRest, eperson); } } return null; @@ -177,6 +165,63 @@ public Class getDomainClass() { return RegistrationRest.class; } + /** + * This method will register a new eperson with the email given in the registrationRest object, and send an + * registration email to that email address. + * @param context + * @param request + * @param registrationRest + * @throws UnprocessableEntityException If self registration is not allowed. + * @throws AccessDeniedException If the user is not authorized to register a new eperson + */ + private void registerEperson(Context context, HttpServletRequest request, RegistrationRest registrationRest) + throws UnprocessableEntityException, AccessDeniedException { + try { + if (!AuthorizeUtil.authorizeNewAccountRegistration(context, request)) { + throw new AccessDeniedException( + "Registration is disabled, you are not authorized to create a new Authorization"); + } + + if (!authenticationService.canSelfRegister(context, request, registrationRest.getEmail())) { + throw new UnprocessableEntityException( + String.format("Registration is not allowed with email address" + + " %s", registrationRest.getEmail())); + } + + accountService.sendRegistrationInfo(context, registrationRest.getEmail()); + } catch (SQLException | IOException | MessagingException | AuthorizeException e) { + log.error("Something went wrong with sending registration info email: " + + registrationRest.getEmail(), e); + } + } + + /** + * This method will send a forgot password email to the email address given in the registrationRest object, if the + * email address belongs to an existing eperson. If the email address doesn't belong to any existing eperson, + * nothing will happen. + * @param context + * @param registrationRest + * @param eperson + * @throws AccessDeniedException If the user is not authorized to reset the password for the given eperson + * @throws DSpaceBadRequestException If the password cannot be updated for the given eperson + */ + private void resetPassword(Context context, RegistrationRest registrationRest, EPerson eperson) + throws AccessDeniedException, DSpaceBadRequestException { + try { + if (!AuthorizeUtil.authorizeForgotPassword()) { + throw new AccessDeniedException("Password reset is not allowed!"); + } + if (!AuthorizeUtil.authorizeUpdatePassword(context, eperson.getEmail())) { + throw new DSpaceBadRequestException("Password cannot be updated for the given EPerson with email: " + + eperson.getEmail()); + } + accountService.sendForgotPasswordInfo(context, registrationRest.getEmail()); + } catch (SQLException | IOException | MessagingException | AuthorizeException e) { + log.error("Something went wrong with sending forgot password info email: " + + registrationRest.getEmail(), e); + } + } + /** * This method will find the RegistrationRest object that is associated with the token given * @param token The token to be found and for which a RegistrationRest object will be found diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java index 1831fc6a8a85..f2dfd9e4dbb1 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java @@ -33,6 +33,7 @@ import org.dspace.app.rest.repository.RegistrationRestRepository; import org.dspace.app.rest.test.AbstractControllerIntegrationTest; import org.dspace.builder.EPersonBuilder; +import org.dspace.core.Email; import org.dspace.eperson.CaptchaServiceImpl; import org.dspace.eperson.InvalidReCaptchaException; import org.dspace.eperson.RegistrationData; @@ -40,7 +41,12 @@ import org.dspace.eperson.service.CaptchaService; import org.dspace.services.ConfigurationService; import org.hamcrest.Matchers; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.BeforeClass; import org.junit.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; public class RegistrationRestRepositoryIT extends AbstractControllerIntegrationTest { @@ -53,6 +59,29 @@ public class RegistrationRestRepositoryIT extends AbstractControllerIntegrationT private ConfigurationService configurationService; @Autowired private RegistrationRestRepository registrationRestRepository; + @Autowired + private ObjectMapper mapper; + + private static MockedStatic emailMockedStatic; + + @After + public void tearDown() throws Exception { + Iterator iterator = registrationDataDAO.findAll(context, RegistrationData.class).iterator(); + while (iterator.hasNext()) { + RegistrationData registrationData = iterator.next(); + registrationDataDAO.delete(context, registrationData); + } + } + + @BeforeClass + public static void init() throws Exception { + emailMockedStatic = Mockito.mockStatic(Email.class); + } + + @AfterClass + public static void tearDownClass() throws Exception { + emailMockedStatic.close(); + } @Test public void findByTokenTestExistingUserTest() throws Exception { @@ -472,4 +501,51 @@ public void accountEndpoint_WrongAccountTypeParam() throws Exception { .andExpect(status().isBadRequest()); } + @Test + public void registrationWithInvalidEmailFormatTest() throws Exception { + Email spy = Mockito.spy(Email.class); + doNothing().when(spy).send(); + emailMockedStatic.when(() -> Email.getEmail(any())).thenReturn(spy); + + RegistrationRest registrationRest = new RegistrationRest(); + registrationRest.setEmail("invalid-email!!!!"); + + getClient().perform(post("/api/eperson/registrations") + .param(TYPE_QUERY_PARAM, TYPE_REGISTER) + .content(mapper.writeValueAsBytes(registrationRest)) + .contentType(contentType)) + .andExpect(status().isUnprocessableEntity()); + } + + @Test + public void registrationWithEmptyEmailTest() throws Exception { + Email spy = Mockito.spy(Email.class); + doNothing().when(spy).send(); + emailMockedStatic.when(() -> Email.getEmail(any())).thenReturn(spy); + + RegistrationRest registrationRest = new RegistrationRest(); + registrationRest.setEmail(""); + + getClient().perform(post("/api/eperson/registrations") + .param(TYPE_QUERY_PARAM, TYPE_REGISTER) + .content(mapper.writeValueAsBytes(registrationRest)) + .contentType(contentType)) + .andExpect(status().isUnprocessableEntity()); + } + + @Test + public void registrationWithNullEmailTest() throws Exception { + Email spy = Mockito.spy(Email.class); + doNothing().when(spy).send(); + emailMockedStatic.when(() -> Email.getEmail(any())).thenReturn(spy); + + RegistrationRest registrationRest = new RegistrationRest(); + registrationRest.setEmail(null); + + getClient().perform(post("/api/eperson/registrations") + .param(TYPE_QUERY_PARAM, TYPE_REGISTER) + .content(mapper.writeValueAsBytes(registrationRest)) + .contentType(contentType)) + .andExpect(status().isUnprocessableEntity()); + } } From 43b03e797d8f18b5196049db41fde78ec88cf516 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Sun, 21 Jun 2026 08:33:50 +0200 Subject: [PATCH 257/283] use DSpaceBadRequestException instead of jakarta.ws.rs.BadRequestException --- .../app/rest/repository/RegistrationRestRepository.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java index c85602e0e109..0c8615912393 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java @@ -231,7 +231,11 @@ private void resetPassword(Context context, RegistrationRest registrationRest, E */ @SearchRestMethod(name = "findByToken") public RegistrationRest findByToken(@Parameter(value = "token", required = true) String token) - throws SQLException, AuthorizeException { + throws SQLException, AuthorizeException, DSpaceBadRequestException { + if (StringUtils.length(token) > 48) { + throw new DSpaceBadRequestException("Token length cannot be longer than 48 characters"); + } + Context context = obtainContext(); RegistrationData registrationData = registrationDataService.findByToken(context, token); if (registrationData == null) { From c2349d00f9c4be83b14ace776c84db72d62ca65e Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Sun, 21 Jun 2026 10:12:54 +0200 Subject: [PATCH 258/283] add tests for token parameter validation --- .../rest/RegistrationRestRepositoryIT.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java index f2dfd9e4dbb1..9ad9e51341f4 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java @@ -150,6 +150,26 @@ private void createTokenForEmail(String email) throws Exception { .andExpect(status().isCreated()); } + @Test + public void findByTokenWithoutToken() throws Exception { + getClient().perform(get("/api/eperson/registrations/search/findByToken")) + .andExpect(status().isBadRequest()); + } + + @Test + public void findByTokenWithEmptyToken() throws Exception { + getClient().perform(get("/api/eperson/registrations/search/findByToken") + .param("token", " ")) + .andExpect(status().isBadRequest()); + } + + @Test + public void findByTokenWithTooLongToken() throws Exception { + getClient().perform(get("/api/eperson/registrations/search/findByToken") + .param("token", "t".repeat(49))) // token length cannot be longer than 48 characters + .andExpect(status().isBadRequest()); + } + @Test public void registrationFlowTest() throws Exception { List registrationDataList = registrationDataDAO.findAll(context, RegistrationData.class); From 17272af59600a0052075535ee19175e8c974f04b Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Sun, 21 Jun 2026 11:42:20 +0200 Subject: [PATCH 259/283] add validation of token in PATCH operation --- .../app/rest/repository/RegistrationRestRepository.java | 3 +++ .../org/dspace/app/rest/RegistrationRestRepositoryIT.java | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java index 0c8615912393..eebfb8658c64 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java @@ -232,6 +232,9 @@ private void resetPassword(Context context, RegistrationRest registrationRest, E @SearchRestMethod(name = "findByToken") public RegistrationRest findByToken(@Parameter(value = "token", required = true) String token) throws SQLException, AuthorizeException, DSpaceBadRequestException { + if (StringUtils.isBlank(token)) { + throw new DSpaceBadRequestException("Missing or empty token query parameter"); + } if (StringUtils.length(token) > 48) { throw new DSpaceBadRequestException("Token length cannot be longer than 48 characters"); } diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java index 9ad9e51341f4..3621ac846b7c 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/RegistrationRestRepositoryIT.java @@ -158,6 +158,13 @@ public void findByTokenWithoutToken() throws Exception { @Test public void findByTokenWithEmptyToken() throws Exception { + getClient().perform(get("/api/eperson/registrations/search/findByToken") + .param("token", "")) + .andExpect(status().isBadRequest()); + } + + @Test + public void findByTokenWithBlankToken() throws Exception { getClient().perform(get("/api/eperson/registrations/search/findByToken") .param("token", " ")) .andExpect(status().isBadRequest()); From 0f7345fcf38a7e994be684d204d0d48b8c546104 Mon Sep 17 00:00:00 2001 From: Sascha Szott Date: Sun, 21 Jun 2026 12:37:39 +0200 Subject: [PATCH 260/283] reorganize imports --- .../java/org/dspace/app/rest/model/RegistrationRest.java | 2 -- .../app/rest/repository/RegistrationRestRepository.java | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java index efa806d9a762..9eef047f11dd 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/model/RegistrationRest.java @@ -10,10 +10,8 @@ import java.util.UUID; import com.fasterxml.jackson.annotation.JsonProperty; - import jakarta.validation.constraints.Email; import jakarta.validation.constraints.NotEmpty; - import org.dspace.app.rest.RestResourceController; /** diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java index eebfb8658c64..c68a39e5d1b0 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/RegistrationRestRepository.java @@ -11,14 +11,14 @@ import java.io.IOException; import java.sql.SQLException; +import java.util.Set; import com.fasterxml.jackson.databind.ObjectMapper; -import jakarta.validation.ConstraintViolation; -import jakarta.validation.Validator; -import java.util.Set; import jakarta.mail.MessagingException; import jakarta.servlet.ServletInputStream; import jakarta.servlet.http.HttpServletRequest; +import jakarta.validation.ConstraintViolation; +import jakarta.validation.Validator; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; From 4e54443b22874e7d0f0b0bb85daf8d18aef0bde4 Mon Sep 17 00:00:00 2001 From: Tim Donohue Date: Wed, 2 Sep 2026 16:45:41 -0500 Subject: [PATCH 261/283] Ensure queries built in IIIF search are always sanitizing user input (cherry picked from commit 5adac98b91e58638b26e8868a60b54c1d0739a32) --- .../org/dspace/app/iiif/service/WordHighlightSolrSearch.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dspace-iiif/src/main/java/org/dspace/app/iiif/service/WordHighlightSolrSearch.java b/dspace-iiif/src/main/java/org/dspace/app/iiif/service/WordHighlightSolrSearch.java index 9e6022548dbe..4a65e88e7c3c 100644 --- a/dspace-iiif/src/main/java/org/dspace/app/iiif/service/WordHighlightSolrSearch.java +++ b/dspace-iiif/src/main/java/org/dspace/app/iiif/service/WordHighlightSolrSearch.java @@ -24,6 +24,7 @@ import org.apache.solr.client.solrj.impl.HttpSolrClient; import org.apache.solr.client.solrj.impl.NoOpResponseParser; import org.apache.solr.client.solrj.request.QueryRequest; +import org.apache.solr.client.solrj.util.ClientUtils; import org.apache.solr.common.params.CommonParams; import org.apache.solr.common.util.NamedList; import org.dspace.app.iiif.model.generator.AnnotationGenerator; @@ -126,8 +127,10 @@ private String adjustQuery(String query) { * @return solr query */ private SolrQuery getSolrQuery(String query, String manifestId) { + String safeQuery = ClientUtils.escapeQueryChars(query); + String safeManifestId = ClientUtils.escapeQueryChars(manifestId); SolrQuery solrQuery = new SolrQuery(); - solrQuery.set("q", "ocr_text:" + query + " AND manifest_url:\"" + manifestId + "\""); + solrQuery.set("q", "ocr_text:" + safeQuery + " AND manifest_url:\"" + safeManifestId + "\""); solrQuery.set(CommonParams.WT, "json"); solrQuery.set("hl", "true"); solrQuery.set("hl.ocr.fl", "ocr_text"); From 2f970e45ec1452f20560a0c3a605497a54200965 Mon Sep 17 00:00:00 2001 From: eric-pennecot Date: Thu, 27 Aug 2026 17:24:35 +0200 Subject: [PATCH 262/283] Grant write permission on automatically claimed researcher profile (cherry picked from commit ae4b965648321d77ec4958d2bdc8b3a6ccdae8ef) --- .../rest/login/impl/ResearcherProfileAutomaticClaim.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java index 8521da970b27..2244e706ea69 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/login/impl/ResearcherProfileAutomaticClaim.java @@ -10,6 +10,7 @@ import static org.apache.commons.collections4.IteratorUtils.toList; import static org.apache.commons.lang3.StringUtils.isBlank; import static org.dspace.content.authority.Choices.CF_ACCEPTED; +import static org.dspace.core.Constants.WRITE; import java.sql.SQLException; import java.util.List; @@ -22,6 +23,7 @@ import org.apache.logging.log4j.Logger; import org.dspace.app.rest.login.PostLoggedInAction; import org.dspace.authorize.AuthorizeException; +import org.dspace.authorize.service.AuthorizeService; import org.dspace.content.Item; import org.dspace.content.MetadataFieldName; import org.dspace.content.service.ItemService; @@ -54,6 +56,9 @@ public class ResearcherProfileAutomaticClaim implements PostLoggedInAction { @Autowired private EPersonService ePersonService; + @Autowired + private AuthorizeService authorizeService; + /** * The field of the eperson to search for. */ @@ -104,6 +109,7 @@ private void claimProfile(Context context, EPerson currentUser) throws SQLExcept if (item != null) { itemService.addMetadata(context, item, "dspace", "object", "owner", null, fullName, id.toString(), CF_ACCEPTED); + authorizeService.addPolicy(context, item, WRITE, currentUser); } } From b2e00d6ab7c0bd38e3a35d69dfb2d8f734d7bd18 Mon Sep 17 00:00:00 2001 From: eric-pennecot Date: Thu, 27 Aug 2026 17:25:20 +0200 Subject: [PATCH 263/283] Add assertions for WRITE policy and canEditMetadata authorization on claimed item (cherry picked from commit ac5754c9acf7cdf0a05d26367c0995793a4265e2) --- .../rest/ResearcherProfileRestRepositoryIT.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java index a0c66cddb70e..687efcef9c6f 100644 --- a/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java +++ b/dspace-server-webapp/src/test/java/org/dspace/app/rest/ResearcherProfileRestRepositoryIT.java @@ -1028,6 +1028,22 @@ public void testAutomaticProfileClaimByEmailWithRegularEntity() throws Exception String secondItemId = getItemIdByProfileId(newUserToken, id); assertEquals("The item should be the same", firstItemId, secondItemId); + getClient(getAuthToken(admin.getEmail(), password)) + .perform(get("/api/authz/resourcepolicies/search/resource") + .param("uuid", firstItemId)) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.resourcepolicies", + hasItem(matchResourcePolicyProperties(null, user, itemToBeClaimed, null, + Constants.WRITE, null)))); + + getClient(newUserToken) + .perform(get("/api/authz/authorizations/search/object") + .param("uri", "http://localhost/api/core/items/" + firstItemId) + .param("feature", "canEditMetadata") + .param("embed", "feature")) + .andExpect(status().isOk()) + .andExpect(jsonPath("$._embedded.authorizations[0]._embedded.feature.id") + .value("canEditMetadata")); } @Test From f05573a0a300d440c836af28b075ee015d25b513 Mon Sep 17 00:00:00 2001 From: Kim Shepherd Date: Tue, 1 Sep 2026 18:02:28 +0200 Subject: [PATCH 264/283] Hardening of OAI ingestion crosswalk Use DSpaceHttpClient factory for ORE, disable redirects Implement better allowed / forbidden host lists Add integration tests (cherry picked from commit 5a2a73ab48e86d804000811306ecd0e57569f09c) --- .../crosswalk/OREIngestionCrosswalk.java | 284 +++++++++++------- .../crosswalk/OREIngestionCrosswalkTest.java | 239 +++++++++++++++ dspace/config/modules/oai.cfg | 27 +- 3 files changed, 443 insertions(+), 107 deletions(-) create mode 100644 dspace-api/src/test/java/org/dspace/content/crosswalk/OREIngestionCrosswalkTest.java diff --git a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java index 9e890a6046fa..40281a7aac39 100644 --- a/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java +++ b/dspace-api/src/main/java/org/dspace/content/crosswalk/OREIngestionCrosswalk.java @@ -10,13 +10,13 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import java.net.ConnectException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; import java.sql.SQLException; import java.text.NumberFormat; +import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.Date; import java.util.HashSet; import java.util.List; @@ -24,7 +24,15 @@ import java.util.Objects; import java.util.Set; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.impl.client.CloseableHttpClient; import org.apache.logging.log4j.Logger; +import org.dspace.app.client.DSpaceHttpClientFactory; import org.dspace.authorize.AuthorizeException; import org.dspace.content.Bitstream; import org.dspace.content.BitstreamFormat; @@ -56,7 +64,7 @@ * @author Alexey Maslov */ public class OREIngestionCrosswalk - implements IngestionCrosswalk { + implements IngestionCrosswalk { /** * log4j category */ @@ -64,30 +72,30 @@ public class OREIngestionCrosswalk /* Namespaces */ public static final Namespace ATOM_NS = - Namespace.getNamespace("atom", "http://www.w3.org/2005/Atom"); + Namespace.getNamespace("atom", "http://www.w3.org/2005/Atom"); private static final Namespace ORE_ATOM = - Namespace.getNamespace("oreatom", "http://www.openarchives.org/ore/atom/"); + Namespace.getNamespace("oreatom", "http://www.openarchives.org/ore/atom/"); private static final Namespace ORE_NS = - Namespace.getNamespace("ore", "http://www.openarchives.org/ore/terms/"); + Namespace.getNamespace("ore", "http://www.openarchives.org/ore/terms/"); private static final Namespace RDF_NS = - Namespace.getNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + Namespace.getNamespace("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); private static final Namespace DCTERMS_NS = - Namespace.getNamespace("dcterms", "http://purl.org/dc/terms/"); + Namespace.getNamespace("dcterms", "http://purl.org/dc/terms/"); private static final Namespace DS_NS = - Namespace.getNamespace("ds", "http://www.dspace.org/objectModel/"); + Namespace.getNamespace("ds", "http://www.dspace.org/objectModel/"); + private String[] forbiddenHostUrls = null; protected BitstreamService bitstreamService = ContentServiceFactory.getInstance().getBitstreamService(); protected BitstreamFormatService bitstreamFormatService = ContentServiceFactory.getInstance() - .getBitstreamFormatService(); + .getBitstreamFormatService(); protected BundleService bundleService = ContentServiceFactory.getInstance().getBundleService(); protected ItemService itemService = ContentServiceFactory.getInstance().getItemService(); protected ConfigurationService configurationService = DSpaceServicesFactory.getInstance().getConfigurationService(); - @Override public void ingest(Context context, DSpaceObject dso, List metadata, boolean createMissingMetadataFields) - throws CrosswalkException, IOException, SQLException, AuthorizeException { + throws CrosswalkException, IOException, SQLException, AuthorizeException { // If this list contains only the root already, just pass it on if (metadata.size() == 1) { @@ -104,7 +112,7 @@ public void ingest(Context context, DSpaceObject dso, List metadata, bo @Override public void ingest(Context context, DSpaceObject dso, Element root, boolean createMissingMetadataFields) - throws CrosswalkException, IOException, SQLException, AuthorizeException { + throws CrosswalkException, IOException, SQLException, AuthorizeException { Date timeStart = new Date(); @@ -118,21 +126,26 @@ public void ingest(Context context, DSpaceObject dso, Element root, boolean crea return; } + var followRedirects = configurationService + .getBooleanProperty("oai.harvester.ore.follow-redirects", false); + var requestConfig = RequestConfig.custom() + .setRedirectsEnabled(followRedirects).build(); + Document doc = new Document(); doc.addContent(root.detach()); List aggregatedResources; String entryId; XPathExpression xpathLinks = - XPathFactory.instance() + XPathFactory.instance() .compile("/atom:entry/atom:link[@rel=\"" + ORE_NS.getURI() + "aggregates" + "\"]", - Filters.element(), null, ATOM_NS); + Filters.element(), null, ATOM_NS); aggregatedResources = xpathLinks.evaluate(doc); XPathExpression xpathAltHref = - XPathFactory.instance() + XPathFactory.instance() .compile("/atom:entry/atom:link[@rel='alternate']/@href", - Filters.attribute(), null, ATOM_NS); + Filters.attribute(), null, ATOM_NS); entryId = xpathAltHref.evaluateFirst(doc).getValue(); // Next for each resource, create a bitstream @@ -143,18 +156,24 @@ public void ingest(Context context, DSpaceObject dso, Element root, boolean crea for (Element resource : aggregatedResources) { String href = resource.getAttributeValue("href"); log.debug("ORE processing: " + href); + String processedURL; + try { + processedURL = new URIBuilder(href).build().toString(); + } catch (URISyntaxException e) { + throw new CrosswalkException("Could not parse URI: " + href, e); + } String bundleName; Element desc = null; XPathExpression xpathDesc = - XPathFactory.instance() - .compile("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + - this.encodeForURL(href) + "\"][1]", - Filters.element(), null, ATOM_NS, ORE_ATOM, RDF_NS); + XPathFactory.instance() + .compile("/atom:entry/oreatom:triples/rdf:Description[@rdf:about=\"" + + this.encodeForURL(href) + "\"][1]", + Filters.element(), null, ATOM_NS, ORE_ATOM, RDF_NS); desc = xpathDesc.evaluateFirst(doc); if (desc != null && desc.getChild("type", RDF_NS).getAttributeValue("resource", RDF_NS) - .equals(DS_NS.getURI() + "DSpaceBitstream")) { + .equals(DS_NS.getURI() + "DSpaceBitstream")) { bundleName = desc.getChildText("description", DCTERMS_NS); log.debug("Setting bundle name to: " + bundleName); } else { @@ -167,63 +186,81 @@ public void ingest(Context context, DSpaceObject dso, Element root, boolean crea Bundle targetBundle; // if null, create the new bundle and add it in - if (targetBundles.size() == 0) { + if (targetBundles.isEmpty()) { targetBundle = bundleService.create(context, item, bundleName); itemService.addBundle(context, item, targetBundle); } else { targetBundle = targetBundles.get(0); } - URL ARurl = null; - InputStream in = null; - if (href != null) { - try { - // Make sure the url string escapes all the oddball characters - String processedURL = encodeForURL(href); - if (validResourceUri(entryId, processedURL)) { - // Generate a request for the aggregated resource - ARurl = new URL(processedURL); - in = ARurl.openStream(); - } else { - throw new FileNotFoundException("Failed to validate " + processedURL); - } - } catch (FileNotFoundException fe) { - log.error("The provided URI failed to return a resource: " + href); - } catch (ConnectException fe) { - log.error("The provided URI was invalid: " + href); - } - } else { - throw new CrosswalkException("Entry did not contain link to resource: " + entryId); + if (StringUtils.isBlank(href)) { + throw new CrosswalkException("The href attribute is required for the ORE ingestion."); } - - // ingest and update - if (in != null) { - Bitstream newBitstream = bitstreamService.create(context, targetBundle, in); - - String bsName = resource.getAttributeValue("title"); - newBitstream.setName(context, bsName); - - // Identify the format - String mimeString = resource.getAttributeValue("type"); - BitstreamFormat bsFormat = bitstreamFormatService.findByMIMEType(context, mimeString); - if (bsFormat == null) { - bsFormat = bitstreamFormatService.guessFormat(context, newBitstream); + try (CloseableHttpClient httpClient = DSpaceHttpClientFactory.getInstance() + .buildWithRequestConfig(requestConfig)) { + if (!validResourceUri(processedURL)) { + throw new FileNotFoundException("Invalid resource URI: " + processedURL); + } + // Generate a request for the aggregated resource + HttpGet httpGet = new HttpGet(processedURL); + HttpResponse response = httpClient.execute(httpGet); + if (response == null || response.getEntity() == null) { + throw new FileNotFoundException(processedURL + " returned a null response or body"); + } + if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { + throw new FileNotFoundException(processedURL + + " returned a " + response.getStatusLine() + " response"); } - newBitstream.setFormat(context, bsFormat); - bitstreamService.update(context, newBitstream); + if (response.getEntity() == null || response.getEntity().getContent() == null) { + throw new FileNotFoundException(processedURL + " returned an empty body"); + } + // ingest and update + try (InputStream in = response.getEntity().getContent()) { + ingestStreamAsBitstream(context, in, targetBundle, resource, entryId); + } + } + } + log.info("OREIngest for Item " + item.getID() + " took: " + + (new Date().getTime() - timeStart.getTime()) + "ms."); + } - bundleService.addBitstream(context, targetBundle, newBitstream); - bundleService.update(context, targetBundle); - } else { - throw new CrosswalkException("Could not retrieve bitstream: " + entryId); + /** + * Read an input stream and ingest it as a bitstream to the target bundle + * @param context Dspace context + * @param inputStream input stream containing bitstream content + * @param targetBundle the target bundle for the new bitstream + * @param resource the ORE resource Element + * @param entryId the entry ID of the ORE resource + * @throws AuthorizeException if current user does not have permission to add / create bitstream + * @throws IOException if the input stream is null or unreadable + * @throws SQLException if bitstream or bundle database operations fail + */ + void ingestStreamAsBitstream(Context context, InputStream inputStream, + Bundle targetBundle, Element resource, String entryId) + throws AuthorizeException, IOException, SQLException { + // ingest and update + if (inputStream != null) { + Bitstream newBitstream = bitstreamService.create(context, targetBundle, inputStream); + + String bsName = resource.getAttributeValue("title"); + newBitstream.setName(context, bsName); + + // Identify the format + String mimeString = resource.getAttributeValue("type"); + BitstreamFormat bsFormat = bitstreamFormatService.findByMIMEType(context, mimeString); + if (bsFormat == null) { + bsFormat = bitstreamFormatService.guessFormat(context, newBitstream); } + newBitstream.setFormat(context, bsFormat); + bitstreamService.update(context, newBitstream); + bundleService.addBitstream(context, targetBundle, newBitstream); + bundleService.update(context, targetBundle); + } else { + throw new IOException("Could not read input stream for: " + entryId); } - log.info( - "OREIngest for Item " + item.getID() + " took: " + (new Date().getTime() - timeStart.getTime()) + "ms."); } - /** * Helper method to escape all characters that are not part of the canon set * @@ -264,58 +301,101 @@ private String encodeForURL(String sourceString) { /** * Validate a resource URI against the host and scheme of the remote OAI endpoint, or a configured - * list of allowed prefixes. - * This still implicitly "trusts" the remote OAI server, but will reject resource URIs with a totally - * different hostname to avoid downloading malicious resources from a compromised endpoint. + * list of allowed prefixes. Some default forbidden hosts are also included to prevent SSRF. * Even if the URL prefix validation is disabled, schemes will still be enforced to http(s) so file:/// and * other unwanted schemes cannot be used - * @param entryUrl the entryId of the parent ORE resource * @param resourceUrl the resource URL of the aggregated ORE resource * @return result of the validation */ - private boolean validResourceUri(String entryUrl, String resourceUrl) { + boolean validResourceUri(String resourceUrl) { + URI resourceUri; try { - Set allowedSchemes = Set.of("http", "https"); - URI entryUri = new URI(entryUrl).normalize(); - URI resourceUri = new URI(resourceUrl).normalize(); - String scheme = resourceUri.getScheme(); - - if (scheme == null || - !allowedSchemes.contains(scheme.toLowerCase(Locale.ROOT))) { - log.warn("Illegal scheme requested for ORE resource: {}", resourceUri); - return false; - } + resourceUri = new URI(resourceUrl).normalize(); + } catch (URISyntaxException | NullPointerException e) { + log.error("Invalid resource URI: " + resourceUrl); + return false; + } + String resourceHost = resourceUri.getHost(); - if (configurationService.getBooleanProperty("oai.harvester.ore.file.validateUrlPrefix", false)) { - for (String allowedPrefix : configurationService - .getArrayProperty("oai.harvester.ore.file.allowedUrlPrefix")) { - URI allowedUri = new URI(allowedPrefix).normalize(); - // Return true on the first allowed prefix match - if (Objects.equals(resourceUri.getScheme(), allowedUri.getScheme()) - && Objects.equals(resourceUri.getHost().toLowerCase(Locale.ROOT), - allowedUri.getHost().toLowerCase(Locale.ROOT))) { - return true; - } - } + Set allowedSchemes = Set.of("http", "https"); + String resourceScheme = resourceUri.getScheme(); + if (resourceScheme == null || + !allowedSchemes.contains(resourceScheme.toLowerCase(Locale.ROOT))) { + log.warn("Illegal scheme requested for ORE resource: {}", resourceUrl); + return false; + } - // If no allowed prefixes were matched, we require scheme + host to match the remote OAI server - if (!Objects.equals(entryUri.getScheme(), resourceUri.getScheme())) { - log.warn("Illegal scheme requested for ORE resource: {}", resourceUri); - return false; - } - if (!Objects.equals( - entryUri.getHost().toLowerCase(Locale.ROOT), - resourceUri.getHost().toLowerCase(Locale.ROOT))) { - log.warn("Illegal host requested for ORE resource: {}", resourceUri); + initializeForbiddenHosts(); + if (forbiddenHostUrls != null) { + for (String forbiddenHostUrl : forbiddenHostUrls) { + String forbiddenHost = extractHostname(forbiddenHostUrl); + if (forbiddenHost != null && Objects.equals(forbiddenHost, resourceHost)) { + log.warn("Forbidden hostname in ORE resource URL: {}", resourceUrl); return false; } } + } + // This is now very strict - it is up to administrators to configure a list of allowed URL prefixes. + // If validateHost is set to 'true', and an empty list will cause every resource URL to be rejected + // Unlike forbidden URLs, we expect these to be hostnames rather than partial or full URIs as well + if (configurationService.getBooleanProperty("oai.harvester.ore.file.validateHost", false)) { + for (String allowedHost : configurationService + .getArrayProperty("oai.harvester.ore.file.allowedHosts")) { + if (Objects.equals(resourceUri.getHost().toLowerCase(Locale.ROOT), + allowedHost.toLowerCase(Locale.ROOT))) { + return true; + } + } + } else { return true; + } + return false; + } + /** + * To keep config easier to maintain with both plain hostnames like 'bad.example.com' and references + * to partial URLs elsewhere in configuration like ${dspace.ui.url}, we test to see which it is + * and return the string representing the hostname. + * @param urlOrHost URL, partial URL or hostname to extract and validate + * @return extracted hostname or null + */ + String extractHostname(String urlOrHost) { + if (StringUtils.isBlank(urlOrHost)) { + return null; + } + try { + URI uri = new URI(urlOrHost); + String host = uri.getHost(); + if (host != null) { + return host.toLowerCase(Locale.ROOT); + } } catch (URISyntaxException e) { - log.warn("Could not validate ORE resource URI: {}", resourceUrl); - return false; + // pass through + } + // Return plain lower-cased string as defaulg + return urlOrHost.toLowerCase(Locale.ROOT); + } + + /** + * Initialize forbidden hosts from config, if not set already + */ + void initializeForbiddenHosts() { + if (forbiddenHostUrls == null) { + String dspaceServerUrl = configurationService.getProperty("dspace.server.url"); + String dspaceUiUrl = configurationService.getProperty("dspace.ui.url"); + String[] localAndEC2Hosts = {"localhost", "127.0.0.1", "[::1]", "169.254.169.254", "[fd00:ec2::254]"}; + List defaultForbiddenUrlPrefixes = new ArrayList<>(); + Collections.addAll(defaultForbiddenUrlPrefixes, localAndEC2Hosts); + if (StringUtils.isNotBlank(dspaceServerUrl)) { + defaultForbiddenUrlPrefixes.add(dspaceServerUrl); + } + if (StringUtils.isNotBlank(dspaceUiUrl)) { + defaultForbiddenUrlPrefixes.add(dspaceUiUrl); + } + forbiddenHostUrls = configurationService.getArrayProperty( + "oai.harvester.ore.file.forbiddenHostUrls", + defaultForbiddenUrlPrefixes.toArray(new String[0])); } } diff --git a/dspace-api/src/test/java/org/dspace/content/crosswalk/OREIngestionCrosswalkTest.java b/dspace-api/src/test/java/org/dspace/content/crosswalk/OREIngestionCrosswalkTest.java new file mode 100644 index 000000000000..c4662805ac06 --- /dev/null +++ b/dspace-api/src/test/java/org/dspace/content/crosswalk/OREIngestionCrosswalkTest.java @@ -0,0 +1,239 @@ +/** + * The contents of this file are subject to the license and copyright + * detailed in the LICENSE and NOTICE files at the root of the source + * tree and available online at + * + * http://www.dspace.org/license/ + */ +package org.dspace.content.crosswalk; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.List; + +import org.apache.http.HttpEntity; +import org.apache.http.StatusLine; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.dspace.AbstractIntegrationTestWithDatabase; +import org.dspace.app.client.DSpaceHttpClientFactory; +import org.dspace.builder.BundleBuilder; +import org.dspace.builder.CollectionBuilder; +import org.dspace.builder.CommunityBuilder; +import org.dspace.builder.ItemBuilder; +import org.dspace.content.Bundle; +import org.dspace.content.Collection; +import org.dspace.content.Item; +import org.dspace.content.factory.ContentServiceFactory; +import org.dspace.content.service.ItemService; +import org.dspace.eperson.EPerson; +import org.jdom2.Element; +import org.jdom2.Namespace; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.mockito.MockedStatic; +import org.mockito.Mockito; + +/** + * Test class for OREIngestionCrosswalk + * + * @author Kim Shepherd + */ +public class OREIngestionCrosswalkTest extends AbstractIntegrationTestWithDatabase { + + private Bundle bundle; + private OREIngestionCrosswalk crosswalk; + private Item item; + private ItemService itemService; + private EPerson prevUser; + + private static final Namespace ATOM_NS = Namespace.getNamespace("atom", "http://www.w3.org/2005/Atom"); + private static final Namespace ORE_NS = Namespace.getNamespace("ore", "http://www.openarchives.org/ore/terms/"); + + @Before + @Override + public void setUp() throws Exception { + super.setUp(); + crosswalk = new OREIngestionCrosswalk(); + itemService = ContentServiceFactory.getInstance().getItemService(); + + context.turnOffAuthorisationSystem(); + parentCommunity = CommunityBuilder.createCommunity(context).build(); + Collection collection = CollectionBuilder.createCollection(context, parentCommunity).build(); + item = ItemBuilder.createItem(context, collection).withTitle("Test ORE Object").build(); + bundle = BundleBuilder.createBundle(context, item).withName("ORIGINAL").build(); + context.restoreAuthSystemState(); + prevUser = context.getCurrentUser(); + context.setCurrentUser(admin); + } + + @After + public void tearDown() throws Exception { + context.setCurrentUser(prevUser); + } + + @Test + public void testIngestNullRoot() throws Exception { + // should just return without exception + crosswalk.ingest(context, item, (Element) null, false); + } + + @Test + public void testIngestEmptyResources() throws Exception { + Element entry = createOREEntryWithoutResources(); + crosswalk.ingest(context, item, entry, false); + + List bundles = itemService.getBundles(item, "ORIGINAL"); + assertTrue("Should have no bundles or empty bundle", + bundles.isEmpty() || bundles.get(0).getBitstreams().isEmpty()); + } + + @Test(expected = CrosswalkException.class) + public void testIngestInvalidURISyntaxThrowsException() throws Exception { + Element entry = createOREEntryWithInvalidURI(); + crosswalk.ingest(context, item, entry, false); + } + + @Test + public void testHostValidation() { + // localhost = forbidden + boolean result = crosswalk.validResourceUri("http://localhost:8080/resource"); + assertFalse("localhost should be forbidden", result); + + // 127.0.0.1 = forbidden + result = crosswalk.validResourceUri("http://127.0.0.1:8080/resource"); + assertFalse("127.0.0.1 should be forbidden", result); + + // allowed.example.com = not forbidden + result = crosswalk.validResourceUri("http://allowed.example.com/resource"); + assertTrue("External host should be allowed", result); + } + + @Test + public void testSchemeValidation() throws Exception { + boolean result = crosswalk.validResourceUri("file:///etc/passwd"); + assertFalse("file:// scheme should be forbidden", result); + + result = crosswalk.validResourceUri("ftp://example.com/resource"); + assertFalse("ftp:// scheme should be forbidden", result); + + result = crosswalk.validResourceUri("https://example.com/resource"); + assertTrue("https:// scheme should be allowed", result); + } + + @Test + public void testSuccessfulBitstreamIngest() throws Exception { + // fully mocked response + try (MockedStatic mockedFactory = + mockHttpClient(200, "Test bitstream content")) { + + Element entry = createValidOREEntry(); + crosswalk.ingest(context, item, entry, false); + + List bundles = itemService.getBundles(item, "ORIGINAL"); + assertFalse("Should have created bundle", bundles.isEmpty()); + assertFalse("Bundle should have bitstream", bundles.get(0).getBitstreams().isEmpty()); + } + } + + @Test + public void testIngestStreamAsBitstream() throws Exception { + String testContent = "Test bitstream content"; + InputStream inputStream = new ByteArrayInputStream(testContent.getBytes()); + + Element resource = new Element("link", ATOM_NS); + resource.setAttribute("href", "http://example.com/test.pdf"); + resource.setAttribute("title", "Test Document"); + resource.setAttribute("type", "application/pdf"); + + crosswalk.ingestStreamAsBitstream(context, inputStream, bundle, resource, "test-entry"); + + assertFalse("Bundle should have bitstream", bundle.getBitstreams().isEmpty()); + assertEquals("Bitstream should have correct name", "Test Document", + bundle.getBitstreams().get(0).getName()); + } + + @Test(expected = IOException.class) + public void testIngestStreamAsBitstreamNullStreamThrowsException() throws Exception { + Element resource = new Element("link", ATOM_NS); + resource.setAttribute("href", "http://example.com/test.pdf"); + + crosswalk.ingestStreamAsBitstream(context, null, bundle, resource, "test-entry"); + } + + private Element createValidOREEntry() { + Element entry = new Element("entry", ATOM_NS); + Element altLink = new Element("link", ATOM_NS); + altLink.setAttribute("rel", "alternate"); + altLink.setAttribute("href", "http://example.com/entry/123"); + entry.addContent(altLink); + Element resLink = new Element("link", ATOM_NS); + resLink.setAttribute("rel", ORE_NS.getURI() + "aggregates"); + resLink.setAttribute("href", "http://example.com/resource.pdf"); + resLink.setAttribute("title", "Test Resource"); + resLink.setAttribute("type", "application/pdf"); + entry.addContent(resLink); + return entry; + } + + private Element createOREEntryWithoutResources() { + Element entry = new Element("entry", ATOM_NS); + Element altLink = new Element("link", ATOM_NS); + altLink.setAttribute("rel", "alternate"); + altLink.setAttribute("href", "http://example.com/entry/123"); + entry.addContent(altLink); + return entry; + } + + + private Element createOREEntryWithInvalidURI() { + Element entry = new Element("entry", ATOM_NS); + Element altLink = new Element("link", ATOM_NS); + altLink.setAttribute("rel", "alternate"); + altLink.setAttribute("href", "http://example.com/entry/123"); + entry.addContent(altLink); + Element resLink = new Element("link", ATOM_NS); + resLink.setAttribute("rel", ORE_NS.getURI() + "aggregates"); + resLink.setAttribute("href", "hello, i am an invalid URI"); + entry.addContent(resLink); + return entry; + } + + private MockedStatic mockHttpClient(int statusCode, String content) throws IOException { + MockedStatic mockedFactory = Mockito.mockStatic(DSpaceHttpClientFactory.class); + + CloseableHttpClient mockClient = mock(CloseableHttpClient.class); + DSpaceHttpClientFactory mockFactoryInstance = mock(DSpaceHttpClientFactory.class); + CloseableHttpResponse mockResponse = mockHttpResponse(statusCode, content); + + when(mockFactoryInstance.buildWithRequestConfig(any())).thenReturn(mockClient); + when(mockClient.execute(any(HttpGet.class))).thenReturn(mockResponse); + mockedFactory.when(DSpaceHttpClientFactory::getInstance).thenReturn(mockFactoryInstance); + + return mockedFactory; + } + + private CloseableHttpResponse mockHttpResponse(int statusCode, String content) throws IOException { + CloseableHttpResponse mockResponse = mock(CloseableHttpResponse.class); + HttpEntity mockEntity = mock(HttpEntity.class); + StatusLine mockStatus = mock(StatusLine.class); + + when(mockStatus.getStatusCode()).thenReturn(statusCode); + when(mockEntity.getContent()).thenReturn(new ByteArrayInputStream(content.getBytes())); + when(mockResponse.getStatusLine()).thenReturn(mockStatus); + when(mockResponse.getEntity()).thenReturn(mockEntity); + + return mockResponse; + } + +} diff --git a/dspace/config/modules/oai.cfg b/dspace/config/modules/oai.cfg index 1d36cce175d2..b481a7cc1754 100644 --- a/dspace/config/modules/oai.cfg +++ b/dspace/config/modules/oai.cfg @@ -146,9 +146,26 @@ oai.harvester.unknownSchema = fail # this config parameter, a new handle will be minted instead. Default value: 123456789. #oai.harvester.rejectedHandlePrefix = 123456789, myTestHandle -# If ingesting files with ORE, only files with URLs that match the base URL of the remote -# OAI endpoint's domain name are accepted, or a list of other URL prefixes defined below -#oai.harvester.ore.file.validateUrlPrefix = true + +# If ingesting files with ORE, enforce some validation on resource URL hosts and schemes. + +# Should redirects be followed? The safe default is 'false' +# to avoid a malicious endpoint from circumventing the below hostname / URL validation +#oai.harvester.ore.follow-redirects = false + +# The following forbidden hosts are configured by default. It is highly recommended not to +# remove entries from this list unless you are very certain you can trust ORE harvested content. +# Both plain hosts (with or without URI scheme) and URLs can be listed here; the host will +# be extracted from a constructed URI object. +#oai.harvester.ore.file.forbiddenHostUrls = localhost, 127.0.0.1, [::1], 169.254.169.254, [fd00:ec2::254], \ +# ${dspace.server.url}, ${dspace.ui.url} + +# If validateUrlPrefix is true, then *only* resource URLs matching +# the configured URL prefixes are allowed by ORE harvesting. This is the strictest +# setting and requires some knowledge of trusted ORE sources and their contents +# but it is also the best mitigation against an ORE source becoming compromised +# and linking to malicious resource URLs +#oai.harvester.ore.file.validateHost = true # Prefixes that are allowed globally (for any endpoint) are below -#oai.harvester.ore.file.allowedUrlPrefix = dspace.myinstitution.edu -#oai.harvester.ore.file.allowedUrlPrefix = files.myinstitution.edu +#oai.harvester.ore.file.allowedHosts = dspace.remote-institution.edu +#oai.harvester.ore.file.allowedHosts = files.remote-institution.edu From 859b16412903ae3b27f97b303c564e2a5355de57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Martin=20L=C3=B6hden?= Date: Thu, 3 Sep 2026 16:54:47 +0200 Subject: [PATCH 265/283] Replace System.err with System.out for no-objects-message. --- .../main/java/org/dspace/identifier/doi/DOIOrganiser.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java index bc73cf8dcf11..ab4abc7c0415 100644 --- a/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java +++ b/dspace-api/src/main/java/org/dspace/identifier/doi/DOIOrganiser.java @@ -221,7 +221,7 @@ public static void runCLI(Context context, DOIOrganiser organiser, String[] args List dois = doiService .getDOIsByStatus(context, Arrays.asList(DOIIdentifierProvider.TO_BE_RESERVED)); if (dois.isEmpty()) { - System.err.println("There are no objects in the database " + System.out.println("There are no objects in the database " + "that could be reserved."); } @@ -248,7 +248,7 @@ public static void runCLI(Context context, DOIOrganiser organiser, String[] args List dois = doiService .getDOIsByStatus(context, Arrays.asList(DOIIdentifierProvider.TO_BE_REGISTERED)); if (dois.isEmpty()) { - System.err.println("There are no objects in the database " + System.out.println("There are no objects in the database " + "that could be registered."); } for (DOI doi : dois) { @@ -278,7 +278,7 @@ public static void runCLI(Context context, DOIOrganiser organiser, String[] args DOIIdentifierProvider.UPDATE_RESERVED, DOIIdentifierProvider.UPDATE_REGISTERED)); if (dois.isEmpty()) { - System.err.println("There are no objects in the database " + System.out.println("There are no objects in the database " + "whose metadata needs an update."); } @@ -298,7 +298,7 @@ public static void runCLI(Context context, DOIOrganiser organiser, String[] args List dois = doiService .getDOIsByStatus(context, Arrays.asList(DOIIdentifierProvider.TO_BE_DELETED)); if (dois.isEmpty()) { - System.err.println("There are no objects in the database " + System.out.println("There are no objects in the database " + "that could be deleted."); } From 27fe4567ee956d8cefbf85e39c17a303e79d15df Mon Sep 17 00:00:00 2001 From: bram-atmire Date: Wed, 2 Sep 2026 10:20:28 +0200 Subject: [PATCH 266/283] Retire obsolete configuration files during "ant update" "ant update" has only ever added or overwritten configuration files; it has never withdrawn one. A file which DSpace used to ship, but no longer ships, is therefore left behind in ${dspace.dir}/config forever. That is harmless for configs which are loaded by name, but not for the ones which are loaded by a wildcard: APISpringLoader, RESTSpringLoader and OAISpringLoader each hand Spring a "config/spring//*.xml" glob, so any leftover file in those directories is still loaded. When it references a class which no longer exists, the kernel fails to start. That is what happens when upgrading from 9.3, which shipped config/spring/api/sherpa.xml. The Open Policy Finder rename (PR #12005) replaced it with openpolicyfinder.xml and deleted the classes it refers to, so "ant update" fails at test_database with a ClassNotFoundException for org.dspace.app.sherpa.submit.SHERPASubmitConfigurationService until the admin finds and deletes sherpa.xml by hand. Add a list of withdrawn config files to build.xml, and a new "update_configs" step which renames each one it still finds to ".obsolete-". Renaming rather than deleting means the file simply stops matching "*.xml", so no decision has to be made about whether the admin customised it: nothing is deleted, no bytes are rewritten, and the change is undone with "mv". The same trick is already used deliberately by config/spring/api/virtual-metadata.xml.openaire4. The list is a rather than a , because it names files instead of matching patterns: entries which are not installed are skipped by , and removing the last entry leaves an empty list. A with no include patterns matches everything, which would rename the whole config directory. Retired files are reported at the end of the step and can be removed later with the new "clean_obsolete" target. They are deliberately kept out of "clean_backups": a *.bak- directory is a second copy of something the admin still has, whereas a retired config is the only remaining copy of a file DSpace has withdrawn, so clearing disk space should not silently discard it. Fixes #13017 Claude-Session: https://claude.ai/code/session_017odRv9QLrNAJJUYCW1qa94 (cherry picked from commit d93a32ef323cba4fa01f7fe77c1c564ebe09abbd) --- dspace/src/main/config/build.xml | 85 +++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/dspace/src/main/config/build.xml b/dspace/src/main/config/build.xml index f588eb023877..44acfb393428 100644 --- a/dspace/src/main/config/build.xml +++ b/dspace/src/main/config/build.xml @@ -126,6 +126,7 @@ Common usage: + @@ -163,6 +164,16 @@ Common usage: + + + + + + + + + @@ -178,11 +189,83 @@ Common usage: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +==================================================================== + The following configuration files are no longer part of DSpace. + Each one has been renamed to "<filename>.obsolete-${build.date}" + so that it can no longer be loaded by DSpace: + + ${obsolete.configs.found} + + Nothing was deleted. Review these files for any local customizations + you still need, then run "ant clean_obsolete" to remove them. +==================================================================== + + + + @@ -1930,7 +1930,7 @@ scm:git:git@github.com:DSpace/DSpace.git scm:git:git@github.com:DSpace/DSpace.git https://github.com/DSpace/DSpace - dspace-8_x + dspace-8.5