Mercurial > hg > orthanc-authorization
changeset 98:c82f0c7d2c6a
Fix parsing of dicom-web/studies/../series/../instances/../bulk/.. routes
author | Alain Mazy <am@osimis.io> |
---|---|
date | Mon, 22 May 2023 09:06:34 +0200 |
parents | aa34aa6b4ec1 |
children | a52e634e4372 |
files | NEWS Plugin/DefaultAuthorizationParser.cpp UnitTestsSources/UnitTestsMain.cpp |
diffstat | 3 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Mon May 15 10:09:27 2023 +0200 +++ b/NEWS Mon May 22 09:06:34 2023 +0200 @@ -1,3 +1,5 @@ +* Fix parsing of dicom-web/studies/../series/../instances/../bulk/.. routes + 2023-05-15 - v 0.5.2 ====================
--- a/Plugin/DefaultAuthorizationParser.cpp Mon May 15 10:09:27 2023 +0200 +++ b/Plugin/DefaultAuthorizationParser.cpp Mon May 22 09:06:34 2023 +0200 @@ -47,7 +47,7 @@ "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)(|/instances|/rendered|/metadata)(|/)$"); dicomWebInstances_ = boost::regex( - "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)/instances/([.0-9]+)(|/|/frames/.*|/rendered|/metadata)(|/)$"); + "^" + tmp + "/studies/([.0-9]+)/series/([.0-9]+)/instances/([.0-9]+)(|/|/frames/.*|/rendered|/metadata|/bulk/.*)(|/)$"); dicomWebQidoRsFind_ = boost::regex( "^" + tmp + "/(studies|series|instances)(|/)$");
--- a/UnitTestsSources/UnitTestsMain.cpp Mon May 15 10:09:27 2023 +0200 +++ b/UnitTestsSources/UnitTestsMain.cpp Mon May 22 09:06:34 2023 +0200 @@ -205,6 +205,13 @@ ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + accesses.clear(); + parser.Parse(accesses, "/dicom-web/studies/2.2/series/3.3/instances/4.4/bulk/7fe00010", noGetArguments.GetMap()); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Instance, instanceOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Series, seriesOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Study, studyOrthancId)); + ASSERT_TRUE(IsAccessing(accesses, AccessLevel_Patient, patientOrthancId)); + { accesses.clear(); const char* getKeys[] = {"0020000D"};