# HG changeset patch # User Alain Mazy # Date 1784293655 -7200 # Node ID 00052ea493bd0aba3c51127882d7ca2dc7fac9c4 # Parent c62278fb2d742afaaa0dc81ffca8da282c8faebe# Parent e3f08ad9fb57bde0dc0faab6ad7bfb8f4a6f9527 integration default -> streaming diff -r c62278fb2d74 -r 00052ea493bd NEWS --- a/NEWS Fri Jul 17 11:16:56 2026 +0200 +++ b/NEWS Fri Jul 17 15:07:35 2026 +0200 @@ -57,7 +57,9 @@ REST API -------- -* API version upgraded to 32 +* API version upgraded to 34 (34 in streaming branch, 33 in default and 1.12.11 was 30 ! + TODO: for the release, we may go backward to 31 but we need to change the conditional + tests - see this commit: https://orthanc.uclouvain.be/hg/orthanc-tests/rev/3a440ee47213) * New fields reported in the "/system" route: - "OverwriteInstancesMode" (Boolean field "OverwriteInstances" is kept for backward compatibility) @@ -76,6 +78,9 @@ monitoring. These metrics have been replaced by "orthanc_jobs_total_completed", "orthanc_jobs_total_success" and "orthanc_jobs_total_failed" that are now considering all the jobs that have run since Orthanc started. +* The "/tools/bulk-delete" route now also accepts a payload of this type: + {"Resources": [{"Level": "Study", "ID": "..."}]}. This payload reduces the number + of calls to the SQL DB and is more suitable for the authorization plugin. Plugin SDK ---------- @@ -105,7 +110,7 @@ * Fix a Denial of Service via Deeply Nested DICOM Sequences (CVE-2026-10528): https://orthanc.uclouvain.be/bugs/show_bug.cgi?id=258 Security issue reported by Jose Lopez Martinez (aka elpe_pinillo) from Deloitte. -* Fixed various OOB read/write (TODO: finalize release notes) +* Fixed various OOB read/write (TODO: still waiting for CVE ID) * Improved preview and rendering of multiframe instances a with a Color Lookup Table; notably, some cardiac US instances. * Lua: Fix the "ReceivedCStoreInstanceFilter" Lua callback whose return value was diff -r c62278fb2d74 -r 00052ea493bd OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake --- a/OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake Fri Jul 17 11:16:56 2026 +0200 +++ b/OrthancFramework/Resources/CMake/OrthancFrameworkParameters.cmake Fri Jul 17 15:07:35 2026 +0200 @@ -39,7 +39,7 @@ # Version of the Orthanc API, can be retrieved from "/system" URI in # order to check whether new URI endpoints are available even if using # the mainline version of Orthanc -set(ORTHANC_API_VERSION "32") +set(ORTHANC_API_VERSION "34") ##################################################################### diff -r c62278fb2d74 -r 00052ea493bd OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Jul 17 11:16:56 2026 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestResources.cpp Fri Jul 17 15:07:35 2026 +0200 @@ -4226,13 +4226,19 @@ static void BulkDelete(RestApiPostCall& call) { + static const char* const KEY_RESOURCES = "Resources"; + static const char* const KEY_LEVEL = "Level"; + static const char* const KEY_ID = "ID"; + if (call.IsDocumentation()) { call.GetDocumentation() .SetTag("System") .SetSummary("Delete a set of resources") - .SetRequestField("Resources", RestApiCallDocumentation::Type_JsonListOfStrings, - "List of the Orthanc identifiers of the patients/studies/series/instances of interest.", true) + .SetRequestField(KEY_RESOURCES, RestApiCallDocumentation::Type_JsonListOfStrings, + "List of the Orthanc identifiers of the patients/studies/series/instances of interest. " + "Starting from Orthanc 1.13.0, this array can also contain an array of JSON objects with " + "2 fields each: 'Level' and 'ID'.", true) .SetDescription("Delete all the DICOM patients, studies, series or instances " "whose identifiers are provided in the `Resources` field."); return; @@ -4249,19 +4255,44 @@ } else { - std::set resources; - SerializationToolbox::ReadSetOfStrings(resources, request, "Resources"); - - for (std::set::const_iterator - it = resources.begin(); it != resources.end(); ++it) + if (!request.isMember(KEY_RESOURCES) || !request[KEY_RESOURCES].isArray()) + { + throw OrthancException(ErrorCode_BadRequest, + std::string("The body must contain a ") + KEY_RESOURCES + " array"); + } + + for (Json::ArrayIndex i = 0; i < request[KEY_RESOURCES].size(); ++i) { - ResourceType type; Json::Value remainingAncestor; // Unused - - if (!context.GetIndex().LookupResourceType(type, *it) || - !context.DeleteResource(remainingAncestor, *it, type)) + + const Json::Value& resource = request[KEY_RESOURCES][i]; + if (resource.isString()) { - CLOG(INFO, HTTP) << "Unknown resource during a bulk deletion: " << *it; + ResourceType type; + + const std::string& resourceId = resource.asString(); + + if (!context.GetIndex().LookupResourceType(type, resourceId) || + !context.DeleteResource(remainingAncestor, resourceId, type)) + { + CLOG(INFO, HTTP) << "Unknown resource during a bulk deletion: " << resourceId; + } + } + else if (resource.isObject() && resource.isMember(KEY_ID) && resource[KEY_ID].isString() + && resource.isMember(KEY_LEVEL) && resource[KEY_LEVEL].isString()) + { + ResourceType type = StringToResourceType(resource[KEY_LEVEL].asString().c_str()); + + const std::string& resourceId = resource[KEY_ID].asString(); + + if (!context.DeleteResource(remainingAncestor, resourceId, type)) + { + CLOG(INFO, HTTP) << "Unknown resource during a bulk deletion: " << resourceId; + } + } + else + { + throw OrthancException(ErrorCode_BadRequest, "Invalid payload"); } } diff -r c62278fb2d74 -r 00052ea493bd TODO --- a/TODO Fri Jul 17 11:16:56 2026 +0200 +++ b/TODO Fri Jul 17 15:07:35 2026 +0200 @@ -71,6 +71,13 @@ "admin": { "Password": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "Hashing": "sha1"} } +<<<<<<< working copy +======= +* Have a single instance of "ThreadedInstancesLoader" shared by all the jobs + in the Orthanc server to prevent resource exhaustion. +* Unable to cancel an ArchiveJob when Orthanc does not have access to the storage anymore. + (To reproduce: remove the cable while downloading a study from S3) +>>>>>>> merge rev ============================