comparison Plugin/ResourceHierarchyCache.h @ 77:94a9484d7f8f

fix security issues allowing to browse remote dicom servers + introduced UnitTests
author Alain Mazy <am@osimis.io>
date Wed, 15 Mar 2023 16:36:42 +0100
parents 1a13c4fbc9a1
children a2e5ea1869bd
comparison
equal deleted inserted replaced
76:d301047ee3c4 77:94a9484d7f8f
23 #include "OrthancResource.h" 23 #include "OrthancResource.h"
24 24
25 #include <Compatibility.h> // For std::unique_ptr<> 25 #include <Compatibility.h> // For std::unique_ptr<>
26 26
27 #include <orthanc/OrthancCPlugin.h> 27 #include <orthanc/OrthancCPlugin.h>
28
29 #if BUILD_UNIT_TESTS == 1
30 # include <gtest/gtest_prod.h>
31 #endif
28 32
29 namespace OrthancPlugins 33 namespace OrthancPlugins
30 { 34 {
31 class ResourceHierarchyCache : public boost::noncopyable 35 class ResourceHierarchyCache : public boost::noncopyable
32 { 36 {
82 const std::string& orthancId); 86 const std::string& orthancId);
83 87
84 bool LookupOrthancId(std::string& target, 88 bool LookupOrthancId(std::string& target,
85 Orthanc::ResourceType level, 89 Orthanc::ResourceType level,
86 const std::string& dicomUid); 90 const std::string& dicomUid);
91
92 FRIEND_TEST(DefaultAuthorizationParser, Parse);
93 protected:
94 void AddOrthancDicomMapping(Orthanc::ResourceType level,
95 const std::string& orthancId,
96 const std::string& dicomUid);
97
98 void AddParentLink(Orthanc::ResourceType childLevel,
99 const std::string& childOrthancId,
100 const std::string& parentOrthancId);
101
87 }; 102 };
88 } 103 }